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:
Mohammad Al-Turany
2013-06-07 08:07:48 +00:00
commit 231c7c8f7e
38 changed files with 2596 additions and 0 deletions

45
fairmq/FairMQLogger.h Normal file
View File

@@ -0,0 +1,45 @@
/*
* FairMQLogger.h
*
* Created on: Dec 4, 2012
* Author: dklein
*/
#ifndef FAIRMQLOGGER_H_
#define FAIRMQLOGGER_H_
#include <string>
#include <sstream>
//#ifndef _MAKECINT_
#include <sys/time.h>
//#endif
#include "Rtypes.h"
#include "TString.h"
class FairMQLogger
{
private:
static FairMQLogger* instance;
TString fBindAddress;
public:
enum {
DEBUG, INFO, ERROR
};
FairMQLogger();
FairMQLogger(TString bindAdress);
virtual ~FairMQLogger();
void Log(Int_t type, TString logmsg);
static FairMQLogger* GetInstance();
static FairMQLogger* InitInstance(TString bindAddress);
};
typedef unsigned long long timestamp_t;
static timestamp_t get_timestamp ()
{
struct timeval now;
gettimeofday (&now, NULL);
return now.tv_usec + (timestamp_t)now.tv_sec * 1000000;
}
#endif /* FAIRMQLOGGER_H_ */