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

@@ -22,9 +22,8 @@
using namespace std;
static FairMQ::Transport gTransportType = FairMQ::Transport::NN;
string FairMQMessageNN::fDeviceID = string();
FairMQ::Transport FairMQMessageNN::fTransportType = FairMQ::Transport::NN;
FairMQMessageNN::FairMQMessageNN()
: fMessage(nullptr)
@@ -149,7 +148,7 @@ void FairMQMessageNN::SetDeviceId(const string& deviceId)
FairMQ::Transport FairMQMessageNN::GetType() const
{
return gTransportType;
return fTransportType;
}
void FairMQMessageNN::Copy(const unique_ptr<FairMQMessage>& msg)

View File

@@ -54,6 +54,7 @@ class FairMQMessageNN : public FairMQMessage
size_t fSize;
bool fReceiving;
static std::string fDeviceID;
static FairMQ::Transport fTransportType;
void Clear();
};

View File

@@ -16,7 +16,7 @@
using namespace std;
static FairMQ::Transport gTransportType = FairMQ::Transport::NN;
FairMQ::Transport FairMQTransportFactoryNN::fTransportType = FairMQ::Transport::NN;
FairMQTransportFactoryNN::FairMQTransportFactoryNN()
{
@@ -60,5 +60,5 @@ FairMQPollerPtr FairMQTransportFactoryNN::CreatePoller(const FairMQSocket& cmdSo
FairMQ::Transport FairMQTransportFactoryNN::GetType() const
{
return gTransportType;
return fTransportType;
}

View File

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