encapsulate and use fairmq default xml and json parser if command line mq-config file.extension is called. The .xml and .json files are recognized internally. Remove explicit json parsing in runSimpleMQStateMAchine.h. Propagate the new commandline mq-config where the runstatemachine function is used

This commit is contained in:
winckler
2016-04-05 17:52:10 +02:00
parent 8df656a302
commit 3b985cd2cd
3 changed files with 49 additions and 10 deletions

View File

@@ -34,6 +34,8 @@ class FairMQProgOptions : public FairProgOptions
FairMQProgOptions();
virtual ~FairMQProgOptions();
// parse command line and txt/INI configuration file.
// default parser for the mq-configuration file (JSON/XML) is called if command line key mq-config is called
virtual int ParseAll(const int argc, char** argv, bool allowUnregistered = false);
// external parser, store function
@@ -75,12 +77,25 @@ class FairMQProgOptions : public FairProgOptions
return fFairMQMap;
}
// to customize title of the executable help command line
void SetHelpTitle(const std::string& title)
{
fHelpTitle=title;
}
// to customize the executable version command line
void SetVersion(const std::string& version)
{
fVersion=version;
}
protected:
po::options_description fMQParserOptions;
po::options_description fMQOptionsInCfg;
po::options_description fMQOptionsInCmd;
pt::ptree fMQtree;
FairMQMap fFairMQMap;
std::string fHelpTitle;
std::string fVersion;
virtual int NotifySwitchOption(); // for custom help & version printing
void InitOptionDescription();