mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
FairMQProgOptions fixes and cleanup
- Remove singular key names from JSON schema. - Align the property tree created by `FairMQSuboptParser` with the format required by the main parser (plural names). - Fix `--print-options` to print all options (not only those that have their value set). - remove XML parser (outdated and unused). - various code cleanup.
This commit is contained in:
committed by
Mohammad Al-Turany
parent
4e2a195289
commit
f8d4fe01d0
@@ -17,11 +17,18 @@
|
||||
#include "FairMQParser.h" // for FairMQMap
|
||||
#include <boost/program_options.hpp>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
namespace po = boost::program_options;
|
||||
|
||||
namespace FairMQParser
|
||||
namespace fair
|
||||
{
|
||||
namespace mq
|
||||
{
|
||||
namespace parser
|
||||
{
|
||||
|
||||
/**
|
||||
* A parser implementation for FairMQ channel properties.
|
||||
* The parser handles a comma separated key=value list format by using the
|
||||
@@ -38,39 +45,42 @@ namespace FairMQParser
|
||||
* the concept is extensible by renaming UserParser to ChannelPropertyParser
|
||||
* and introducing additional parser functions.
|
||||
*/
|
||||
struct SUBOPT {
|
||||
enum channelOptionKeyIds {
|
||||
NAME = 0, // name of the channel
|
||||
TYPE, // push, pull, publish, subscribe, etc
|
||||
METHOD, // bind or connect
|
||||
ADDRESS, // host, protocol and port address
|
||||
TRANSPORT, //
|
||||
SNDBUFSIZE, // size of the send queue
|
||||
RCVBUFSIZE, // size of the receive queue
|
||||
SNDKERNELSIZE,
|
||||
RCVKERNELSIZE,
|
||||
RATELOGGING, // logging rate
|
||||
lastsocketkey
|
||||
};
|
||||
struct SUBOPT
|
||||
{
|
||||
enum channelOptionKeyIds
|
||||
{
|
||||
NAME = 0, // name of the channel
|
||||
TYPE, // push, pull, publish, subscribe, etc
|
||||
METHOD, // bind or connect
|
||||
ADDRESS, // host, protocol and port address
|
||||
TRANSPORT, //
|
||||
SNDBUFSIZE, // size of the send queue
|
||||
RCVBUFSIZE, // size of the receive queue
|
||||
SNDKERNELSIZE,
|
||||
RCVKERNELSIZE,
|
||||
RATELOGGING, // logging rate
|
||||
lastsocketkey
|
||||
};
|
||||
|
||||
constexpr static const char *channelOptionKeys[] = {
|
||||
/*[NAME] = */ "name",
|
||||
/*[TYPE] = */ "type",
|
||||
/*[METHOD] = */ "method",
|
||||
/*[ADDRESS] = */ "address",
|
||||
/*[TRANSPORT] = */ "transport",
|
||||
/*[SNDBUFSIZE] = */ "sndBufSize",
|
||||
/*[RCVBUFSIZE] = */ "rcvBufSize",
|
||||
/*[SNDKERNELSIZE] = */ "sndKernelSize",
|
||||
/*[RCVKERNELSIZE] = */ "rcvKernelSize",
|
||||
/*[RATELOGGING] = */ "rateLogging",
|
||||
nullptr
|
||||
};
|
||||
constexpr static const char *channelOptionKeys[] = {
|
||||
/*[NAME] = */ "name",
|
||||
/*[TYPE] = */ "type",
|
||||
/*[METHOD] = */ "method",
|
||||
/*[ADDRESS] = */ "address",
|
||||
/*[TRANSPORT] = */ "transport",
|
||||
/*[SNDBUFSIZE] = */ "sndBufSize",
|
||||
/*[RCVBUFSIZE] = */ "rcvBufSize",
|
||||
/*[SNDKERNELSIZE] = */ "sndKernelSize",
|
||||
/*[RCVKERNELSIZE] = */ "rcvKernelSize",
|
||||
/*[RATELOGGING] = */ "rateLogging",
|
||||
nullptr
|
||||
};
|
||||
|
||||
constexpr static const char* OptionKeyChannelConfig = "channel-config";
|
||||
|
||||
FairMQMap UserParser(const po::variables_map& omap, const std::string& deviceId, const std::string& rootNode = "fairMQOptions");
|
||||
FairMQMap UserParser(const std::vector<std::string>& channelConfig, const std::string& deviceId, const std::string& rootNode = "fairMQOptions");
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* FAIRMQPARSER_SUBOPT_H */
|
||||
|
Reference in New Issue
Block a user