FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
runTestDetectorFileSink.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
10 #include "runFairMQDevice.h"
11 
12 namespace bpo = boost::program_options;
13 
14 void addCustomOptions(bpo::options_description& options)
15 {
16  // clang-format off
17  options.add_options()
18  ("in-channel", bpo::value<std::string>()->default_value("data2"), "Name of the input channel")
19  ("ack-channel", bpo::value<std::string>()->default_value("ack"), "Name of the acknowledgement channel")
20  ("data-format", bpo::value<std::string>()->default_value("binary"), "Data format (binary|boost|flatbuffers|msgpack|protobuf|tmessage)");
21  // clang-format on
22 }
23 
24 FairMQDevicePtr getDevice(const FairMQProgOptions& config)
25 {
26  std::string dataFormat = config.GetValue<std::string>("data-format");
27 
28  if (dataFormat == "binary") {
30  } else if (dataFormat == "boost") {
32  void(boost::archive::binary_iarchive&,
33  const unsigned int)>::value
34  == 0) {
35  LOG(error) << "Boost serialization for Input Payload requested, but the input type does not support it. "
36  "Check the TIn parameter. Aborting.";
37  return nullptr;
38  }
40  } else if (dataFormat == "tmessage") {
42  }
43 #ifdef FLATBUFFERS
44  else if (dataFormat == "flatbuffers") {
46  }
47 #endif
48 #ifdef MSGPACK
49  else if (dataFormat == "msgpack") {
51  }
52 #endif
53 #ifdef PROTOBUF
54  else if (dataFormat == "protobuf") {
56  }
57 #endif
58  else {
59  LOG(error)
60  << "No valid data format provided. (--data-format binary|boost|flatbuffers|msgpack|protobuf|tmessage). ";
61  return nullptr;
62  }
63 }
void addCustomOptions(bpo::options_description &options)
FairMQDevicePtr getDevice(const FairMQProgOptions &config)