Transports: use transportType as static member.

This commit is contained in:
Alexey Rybalchenko
2017-03-14 11:41:56 +01:00
committed by Mohammad Al-Turany
parent b237b3f9d7
commit 3c73c690f7
12 changed files with 24 additions and 15 deletions

View File

@@ -14,11 +14,10 @@
using namespace std;
using namespace FairMQ::shmem;
static FairMQ::Transport gTransportType = FairMQ::Transport::SHM;
// uint64_t FairMQMessageSHM::fMessageID = 0;
// string FairMQMessageSHM::fDeviceID = string();
atomic<bool> FairMQMessageSHM::fInterrupted(false);
FairMQ::Transport FairMQMessageSHM::fTransportType = FairMQ::Transport::SHM;
FairMQMessageSHM::FairMQMessageSHM()
: fMessage()
@@ -234,7 +233,7 @@ void FairMQMessageSHM::SetDeviceId(const string& /*deviceId*/)
FairMQ::Transport FairMQMessageSHM::GetType() const
{
return gTransportType;
return fTransportType;
}
void FairMQMessageSHM::Copy(const unique_ptr<FairMQMessage>& msg)

View File

@@ -61,6 +61,7 @@ class FairMQMessageSHM : public FairMQMessage
bool fQueued;
bool fMetaCreated;
static std::atomic<bool> fInterrupted;
static FairMQ::Transport fTransportType;
bipc::managed_shared_memory::handle_t fHandle;
size_t fChunkSize;
void* fLocalPtr;

View File

@@ -12,7 +12,7 @@
using namespace std;
static FairMQ::Transport gTransportType = FairMQ::Transport::SHM;
FairMQ::Transport FairMQTransportFactorySHM::fTransportType = FairMQ::Transport::SHM;
FairMQTransportFactorySHM::FairMQTransportFactorySHM()
{
@@ -59,6 +59,6 @@ FairMQPollerPtr FairMQTransportFactorySHM::CreatePoller(const FairMQSocket& cmdS
FairMQ::Transport FairMQTransportFactorySHM::GetType() const
{
return gTransportType;
return fTransportType;
}

View File

@@ -35,6 +35,9 @@ class FairMQTransportFactorySHM : public FairMQTransportFactory
virtual FairMQ::Transport GetType() const;
virtual ~FairMQTransportFactorySHM() {};
private:
static FairMQ::Transport fTransportType;
};
#endif /* FAIRMQTRANSPORTFACTORYSHM_H_ */