mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Zero MQ implimentation and example (Tutorial3)
git-svn-id: https://subversion.gsi.de/fairroot/fairbase/trunk@20162 0381ead4-6506-0410-b988-94b70fbc4730
This commit is contained in:
47
fairmq/FairMQSocket.h
Normal file
47
fairmq/FairMQSocket.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* FairMQSocket.h
|
||||
*
|
||||
* Created on: Dec 5, 2012
|
||||
* Author: dklein
|
||||
*/
|
||||
|
||||
#ifndef FAIRMQSOCKET_H_
|
||||
#define FAIRMQSOCKET_H_
|
||||
|
||||
#include <zmq.hpp>
|
||||
#include <string>
|
||||
#include "FairMQContext.h"
|
||||
#include "FairMQMessage.h"
|
||||
#include "Rtypes.h"
|
||||
#include "TString.h"
|
||||
|
||||
|
||||
class FairMQSocket
|
||||
{
|
||||
private:
|
||||
zmq::socket_t* fSocket;
|
||||
TString fId;
|
||||
ULong_t fBytesTx;
|
||||
ULong_t fBytesRx;
|
||||
ULong_t fMessagesTx;
|
||||
ULong_t fMessagesRx;
|
||||
public:
|
||||
const static TString TCP, IPC, INPROC;
|
||||
FairMQSocket(FairMQContext* context, Int_t type, Int_t num);
|
||||
virtual ~FairMQSocket();
|
||||
TString GetId();
|
||||
static TString GetTypeString(Int_t type);
|
||||
Bool_t Send(FairMQMessage* msg);
|
||||
Bool_t Receive(FairMQMessage* msg);
|
||||
void Close();
|
||||
Bool_t Bind(TString address);
|
||||
Bool_t Connect(TString address);
|
||||
zmq::socket_t* GetSocket();
|
||||
ULong_t GetBytesTx();
|
||||
ULong_t GetBytesRx();
|
||||
ULong_t GetMessagesTx();
|
||||
ULong_t GetMessagesRx();
|
||||
|
||||
};
|
||||
|
||||
#endif /* FAIRMQSOCKET_H_ */
|
Reference in New Issue
Block a user