FairMQSocket: add versions of Send/Receive methods with int flags instead of string, which is more flexible and performant.

Int flags are mapped to their ZeroMQ/nanomsg versions behind the transport interface.
Methods with string flags are kept for backwards compatibility.
This commit is contained in:
Alexey Rybalchenko
2015-01-25 21:40:00 +01:00
committed by Mohammad Al-Turany
parent a9b7e8866c
commit 6518b7cd41
5 changed files with 103 additions and 5 deletions

View File

@@ -23,13 +23,25 @@ using namespace std;
class FairMQSocket
{
public:
const int SNDMORE;
const int RCVMORE;
const int NOBLOCK;
FairMQSocket(int sndMore, int rcvMore, int noBlock)
: SNDMORE(sndMore)
, RCVMORE(rcvMore)
, NOBLOCK(noBlock)
{}
virtual string GetId() = 0;
virtual void Bind(const string& address) = 0;
virtual void Connect(const string& address) = 0;
virtual int Send(FairMQMessage* msg, const string& flag="") = 0;
virtual int Send(FairMQMessage* msg, const int flags) = 0;
virtual int Receive(FairMQMessage* msg, const string& flag="") = 0;
virtual int Receive(FairMQMessage* msg, const int flags) = 0;
virtual void* GetSocket() = 0;
virtual int GetSocket(int nothing) = 0;