mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 01:51:45 +00:00
Use FairMQProgOptions for Sink and BenchmarkSampler
This commit is contained in:
@@ -17,21 +17,20 @@ namespace pt = boost::property_tree;
|
||||
class FairMQProgOptions : public FairProgOptions
|
||||
{
|
||||
protected:
|
||||
typedef std::map<std::string, std::vector<FairMQChannel> > FairMQMap;
|
||||
|
||||
typedef std::map< std::string,std::vector<FairMQChannel> > FairMQMap;
|
||||
|
||||
public:
|
||||
FairMQProgOptions();
|
||||
virtual ~FairMQProgOptions();
|
||||
virtual int ParseAll(const int argc, char** argv, bool AllowUnregistered=false);
|
||||
|
||||
|
||||
virtual int ParseAll(const int argc, char** argv, bool AllowUnregistered = false);
|
||||
|
||||
// external parser, store function
|
||||
template < typename T, typename ...Args>
|
||||
template <typename T, typename ...Args>
|
||||
int UserParser(Args &&... args)
|
||||
{
|
||||
try
|
||||
{
|
||||
Store( T().UserParser(std::forward<Args>(args)...) );
|
||||
Store(T().UserParser(std::forward<Args>(args)...));
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
@@ -40,38 +39,36 @@ public:
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int Store(const po::variables_map& vm)
|
||||
{
|
||||
fvarmap = vm;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int Store(const pt::ptree& tree)
|
||||
{
|
||||
fMQtree = tree;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int Store(const FairMQMap& channels)
|
||||
{
|
||||
fFairMQmap = channels;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
FairMQMap GetFairMQMap()
|
||||
{
|
||||
return fFairMQmap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
po::options_description fMQParserOptions;
|
||||
pt::ptree fMQtree;
|
||||
FairMQMap fFairMQmap;
|
||||
|
||||
virtual int NotifySwitchOption();// for custom help & version printing
|
||||
|
||||
virtual int NotifySwitchOption(); // for custom help & version printing
|
||||
void InitOptionDescription();
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user