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:
44
fairmq/FairMQContext.cxx
Normal file
44
fairmq/FairMQContext.cxx
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* FairMQContext.cxx
|
||||
*
|
||||
* Created on: Dec 5, 2012
|
||||
* Author: dklein
|
||||
*/
|
||||
|
||||
#include "FairMQContext.h"
|
||||
#include <sstream>
|
||||
|
||||
|
||||
const TString FairMQContext::PAYLOAD = "payload";
|
||||
const TString FairMQContext::LOG = "log";
|
||||
const TString FairMQContext::CONFIG = "config";
|
||||
const TString FairMQContext::CONTROL = "control";
|
||||
|
||||
FairMQContext::FairMQContext(TString deviceId, TString contextId, Int_t numIoThreads)
|
||||
{
|
||||
std::stringstream id;
|
||||
id << deviceId << "." << contextId;
|
||||
fId = id.str();
|
||||
|
||||
fContext = new zmq::context_t(numIoThreads);
|
||||
}
|
||||
|
||||
FairMQContext::~FairMQContext()
|
||||
{
|
||||
}
|
||||
|
||||
TString FairMQContext::GetId()
|
||||
{
|
||||
return fId;
|
||||
}
|
||||
|
||||
zmq::context_t* FairMQContext::GetContext()
|
||||
{
|
||||
return fContext;
|
||||
}
|
||||
|
||||
void FairMQContext::Close()
|
||||
{
|
||||
fContext->close();
|
||||
}
|
||||
|
Reference in New Issue
Block a user