mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 18:11:49 +00:00
Rename device property to have a common format and some code cleanup.
FairMQDevice: Rename property for socket rate logging to have common format (old name is still available for compatibility). FairMQ: Avoid using std namespace in class headers (may require adding std namespace to some child devices). FairMQ: A bit of code cleanup FairMQConfigurable: Stop with an error if a property assignment failed due to incorrect key.
This commit is contained in:
committed by
Florian Uhlig
parent
61f24eb73a
commit
26a1033e9d
@@ -16,6 +16,8 @@
|
||||
|
||||
#include "FairMQPollerNN.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
FairMQPollerNN::FairMQPollerNN(const vector<FairMQSocket*>& inputs)
|
||||
: items()
|
||||
, fNumItems()
|
||||
|
@@ -20,12 +20,10 @@
|
||||
#include "FairMQPoller.h"
|
||||
#include "FairMQSocket.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class FairMQPollerNN : public FairMQPoller
|
||||
{
|
||||
public:
|
||||
FairMQPollerNN(const vector<FairMQSocket*>& inputs);
|
||||
FairMQPollerNN(const std::vector<FairMQSocket*>& inputs);
|
||||
|
||||
virtual void Poll(int timeout);
|
||||
virtual bool CheckInput(int index);
|
||||
|
@@ -18,6 +18,8 @@
|
||||
#include "FairMQMessageNN.h"
|
||||
#include "FairMQLogger.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
FairMQSocketNN::FairMQSocketNN(const string& type, int num, int numIoThreads)
|
||||
: FairMQSocket(0, 0, NN_DONTWAIT)
|
||||
, fSocket()
|
||||
|
@@ -26,16 +26,16 @@
|
||||
class FairMQSocketNN : public FairMQSocket
|
||||
{
|
||||
public:
|
||||
FairMQSocketNN(const string& type, int num, int numIoThreads); // numIoThreads is not used in nanomsg.
|
||||
FairMQSocketNN(const std::string& type, int num, int numIoThreads); // numIoThreads is not used in nanomsg.
|
||||
|
||||
virtual string GetId();
|
||||
virtual std::string GetId();
|
||||
|
||||
virtual bool Bind(const string& address);
|
||||
virtual void Connect(const string& address);
|
||||
virtual bool Bind(const std::string& address);
|
||||
virtual void Connect(const std::string& address);
|
||||
|
||||
virtual int Send(FairMQMessage* msg, const string& flag="");
|
||||
virtual int Send(FairMQMessage* msg, const std::string& flag="");
|
||||
virtual int Send(FairMQMessage* msg, const int flags);
|
||||
virtual int Receive(FairMQMessage* msg, const string& flag="");
|
||||
virtual int Receive(FairMQMessage* msg, const std::string& flag="");
|
||||
virtual int Receive(FairMQMessage* msg, const int flags);
|
||||
|
||||
virtual void* GetSocket();
|
||||
@@ -43,21 +43,21 @@ class FairMQSocketNN : public FairMQSocket
|
||||
virtual void Close();
|
||||
virtual void Terminate();
|
||||
|
||||
virtual void SetOption(const string& option, const void* value, size_t valueSize);
|
||||
virtual void GetOption(const string& option, void* value, size_t* valueSize);
|
||||
virtual void SetOption(const std::string& option, const void* value, size_t valueSize);
|
||||
virtual void GetOption(const std::string& option, void* value, size_t* valueSize);
|
||||
|
||||
unsigned long GetBytesTx();
|
||||
unsigned long GetBytesRx();
|
||||
unsigned long GetMessagesTx();
|
||||
unsigned long GetMessagesRx();
|
||||
|
||||
static int GetConstant(const string& constant);
|
||||
static int GetConstant(const std::string& constant);
|
||||
|
||||
virtual ~FairMQSocketNN();
|
||||
|
||||
private:
|
||||
int fSocket;
|
||||
string fId;
|
||||
std::string fId;
|
||||
unsigned long fBytesTx;
|
||||
unsigned long fBytesRx;
|
||||
unsigned long fMessagesTx;
|
||||
|
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "FairMQTransportFactoryNN.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
FairMQTransportFactoryNN::FairMQTransportFactoryNN()
|
||||
{
|
||||
LOG(INFO) << "Using nanomsg library";
|
||||
|
@@ -30,8 +30,8 @@ class FairMQTransportFactoryNN : public FairMQTransportFactory
|
||||
virtual FairMQMessage* CreateMessage();
|
||||
virtual FairMQMessage* CreateMessage(size_t size);
|
||||
virtual FairMQMessage* CreateMessage(void* data, size_t size, fairmq_free_fn *ffn = NULL, void* hint = NULL);
|
||||
virtual FairMQSocket* CreateSocket(const string& type, int num, int numIoThreads);
|
||||
virtual FairMQPoller* CreatePoller(const vector<FairMQSocket*>& inputs);
|
||||
virtual FairMQSocket* CreateSocket(const std::string& type, int num, int numIoThreads);
|
||||
virtual FairMQPoller* CreatePoller(const std::vector<FairMQSocket*>& inputs);
|
||||
|
||||
virtual ~FairMQTransportFactoryNN() {};
|
||||
};
|
||||
|
Reference in New Issue
Block a user