Add DDS and Copy+Push examples.

This commit is contained in:
Alexey Rybalchenko
2015-08-18 09:35:31 +02:00
committed by Mohammad Al-Turany
parent 96cd2afac7
commit 105e734808
46 changed files with 1517 additions and 143 deletions

View File

@@ -26,17 +26,18 @@ FairMQExample1Sink::FairMQExample1Sink()
void FairMQExample1Sink::Run()
{
while (GetCurrentState() == RUNNING)
while (CheckCurrentState(RUNNING))
{
FairMQMessage* msg = fTransportFactory->CreateMessage();
fChannels.at("data-in").at(0).Receive(msg);
if (fChannels.at("data-in").at(0).Receive(msg) > 0)
{
LOG(INFO) << "Received message: \""
<< string(static_cast<char*>(msg->GetData()), msg->GetSize())
<< "\"";
LOG(INFO) << "Received message: \""
<< string(static_cast<char*>(msg->GetData()), msg->GetSize())
<< "\"";
delete msg;
delete msg;
}
}
}

View File

@@ -0,0 +1,8 @@
Example 1: Sampler -> Sink
===============
A simple topology of two devices - **Sampler** and **Sink**. **Sampler** sends data to **Sink** via the **PUSH-PULL** pattern.
`runExample1Sampler.cxx` and `runExample1Sink.cxx` configure and run the devices in their main function.
The executables take two required command line parameters: `--id` and `--config-json-file`. The value of `--id` should be a unique identifier and the value for `-config-json-file` a path to a config file. The config file for this example is `ex1-sampler-sink.json` and it contains configuration for the communication channels of the devices. The mapping between a specific device and the configuration (which can contain multiple devices) is done based on the **id**.

View File

@@ -6,7 +6,7 @@
* copied verbatim in the file "LICENSE" *
********************************************************************************/
/**
* runExampleSampler.cxx
* runExample1Sampler.cxx
*
* @since 2013-04-23
* @author D. Klein, A. Rybalchenko

View File

@@ -6,7 +6,7 @@
* copied verbatim in the file "LICENSE" *
********************************************************************************/
/**
* runExampleSink.cxx
* runExample1Sink.cxx
*
* @since 2013-04-23
* @author D. Klein, A. Rybalchenko