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:
Alexey Rybalchenko
2015-12-04 15:18:46 +01:00
committed by Mohammad Al-Turany
parent f1abb9ecdd
commit 82ab7670a9
7 changed files with 81 additions and 65 deletions

View File

@@ -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());