mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 01:51:45 +00:00
Add FlatBuffers & MessagePack examples
- Add FlatBuffers serialization example to Tutorial 3 - Add MessagePack serialization example to Tutorial 3 - Performance improvements in Boost serialization example - Use `GetEntriesFast()` for FairTestDetectorRecoTask - Use `Clear()` instead of `Delete()` in MQ parts of Tutorial 3 - Fix CMake variables from preventing compilation without nanomsg. - create macro/data directories in install directory - Get rid of data duplication in fill_parameters.C - Various cleanups and fixes
This commit is contained in:
committed by
Mohammad Al-Turany
parent
f1abb9ecdd
commit
82ab7670a9
@@ -29,17 +29,17 @@ FairMQMerger::~FairMQMerger()
|
||||
|
||||
void FairMQMerger::Run()
|
||||
{
|
||||
std::unique_ptr<FairMQPoller> poller(fTransportFactory->CreatePoller(fChannels.at("data-in")));
|
||||
|
||||
// store the channel references to avoid traversing the map on every loop iteration
|
||||
auto& dataInChannelRef = fChannels.at("data-in");
|
||||
const FairMQChannel& dataOutChannel = fChannels.at("data-out").at(0);
|
||||
std::vector<FairMQChannel*> dataInChannels(fChannels.at("data-in").size());
|
||||
for (unsigned int i = 0; i < fChannels.at("data-in").size(); ++i)
|
||||
int numInputs = dataInChannelRef.size();
|
||||
std::vector<FairMQChannel*> dataInChannels(numInputs);
|
||||
for (int i = 0; i < numInputs; ++i)
|
||||
{
|
||||
dataInChannels.at(i) = &(fChannels.at("data-in").at(i));
|
||||
dataInChannels.at(i) = &(dataInChannelRef.at(i));
|
||||
}
|
||||
|
||||
int numInputs = fChannels.at("data-in").size();
|
||||
std::unique_ptr<FairMQPoller> poller(fTransportFactory->CreatePoller(dataInChannelRef));
|
||||
|
||||
while (CheckCurrentState(RUNNING))
|
||||
{
|
||||
|
@@ -28,17 +28,18 @@ FairMQSplitter::~FairMQSplitter()
|
||||
|
||||
void FairMQSplitter::Run()
|
||||
{
|
||||
int direction = 0;
|
||||
int numOutputs = fChannels.at("data-out").size();
|
||||
|
||||
// store the channel references to avoid traversing the map on every loop iteration
|
||||
auto& dataOutChannelRef = fChannels.at("data-out");
|
||||
const FairMQChannel& dataInChannel = fChannels.at("data-in").at(0);
|
||||
FairMQChannel* dataOutChannels[fChannels.at("data-out").size()];
|
||||
int numOutputs = dataOutChannelRef.size();
|
||||
std::vector<FairMQChannel*> dataOutChannels(numOutputs);
|
||||
for (int i = 0; i < numOutputs; ++i)
|
||||
{
|
||||
dataOutChannels[i] = &(fChannels.at("data-out").at(i));
|
||||
dataOutChannels[i] = &(dataOutChannelRef.at(i));
|
||||
}
|
||||
|
||||
int direction = 0;
|
||||
|
||||
while (CheckCurrentState(RUNNING))
|
||||
{
|
||||
std::unique_ptr<FairMQMessage> msg(fTransportFactory->CreateMessage());
|
||||
|
Reference in New Issue
Block a user