mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
add function helpers for FairProgOptions which simplify FairProgOptions.cxx
This commit is contained in:
committed by
Mohammad Al-Turany
parent
13d3729fec
commit
819a8df952
@@ -18,7 +18,7 @@
|
||||
#include "FairMQLogger.h"
|
||||
#include <boost/program_options.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include "FairProgOptionsHelper.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
@@ -55,12 +55,6 @@
|
||||
* }
|
||||
*/
|
||||
|
||||
template<class T>
|
||||
std::ostream& operator<<(std::ostream& os, const std::vector<T>& v)
|
||||
{
|
||||
std::copy(v.begin(), v.end(), std::ostream_iterator<T>(os, " "));
|
||||
return os;
|
||||
}
|
||||
|
||||
namespace po = boost::program_options;
|
||||
namespace fs = boost::filesystem;
|
||||
@@ -165,19 +159,6 @@ class FairProgOptions
|
||||
|
||||
VarValInfo_t GetVariableValueInfo(const po::variable_value& varValue);
|
||||
|
||||
template<typename T>
|
||||
std::string VariableValueToString(const po::variable_value& varValue)
|
||||
{
|
||||
auto& value = varValue.value();
|
||||
std::ostringstream ostr;
|
||||
if (auto q = boost::any_cast<T>(&value))
|
||||
{
|
||||
ostr << *q;
|
||||
}
|
||||
std::string valStr = ostr.str();
|
||||
return valStr;
|
||||
}
|
||||
|
||||
static void Max(int &val, const int &comp)
|
||||
{
|
||||
if (comp > val)
|
||||
|
Reference in New Issue
Block a user