Update JSON files & readme, use FairMQDevicePtr, cleanup.

This commit is contained in:
Alexey Rybalchenko
2016-10-28 15:42:15 +02:00
parent da3010b20c
commit 79fba8ec4c
17 changed files with 234 additions and 132 deletions

View File

@@ -96,7 +96,7 @@ struct ToString
{
typedef std::string returned_type;
template<typename T>
std::string Value(const po::variable_value& varValue,const std::string&, const std::string&, const std::string&)
std::string Value(const po::variable_value& varValue, const std::string&, const std::string&, const std::string&)
{
return ConvertVariableValueToString<T>(varValue);
}
@@ -112,7 +112,7 @@ struct ToVarInfo
{
typedef std::tuple<std::string, std::string,std::string, std::string> returned_type;
template<typename T>
returned_type Value(const po::variable_value& varValue,const std::string& type, const std::string& defaulted, const std::string& empty)
returned_type Value(const po::variable_value& varValue, const std::string& type, const std::string& defaulted, const std::string& empty)
{
std::string valueStr = ConvertVariableValueToString<T>(varValue);
return make_tuple(valueStr, type, defaulted, empty);
@@ -155,75 +155,75 @@ struct ConvertVariableValue : T
//////////////////////////////// std types
// std::string albeit useless here
if (is_this_type<std::string>(varValue))
return T::template Value<std::string>(varValue,std::string(" <string>"),defaultedValue,emptyValue);
return T::template Value<std::string>(varValue, std::string(" <string>"), defaultedValue, emptyValue);
// std::vector<std::string>
if (is_this_type<std::vector<std::string>>(varValue))
return T::template Value<std::vector<std::string>>(varValue,std::string(" <vector<string>>"),defaultedValue,emptyValue);
return T::template Value<std::vector<std::string>>(varValue, std::string(" <vector<string>>"), defaultedValue, emptyValue);
// int
if (is_this_type<int>(varValue))
return T::template Value<int>(varValue,std::string(" <int>"),defaultedValue,emptyValue);
return T::template Value<int>(varValue, std::string(" <int>"), defaultedValue, emptyValue);
// std::vector<int>
if (is_this_type<std::vector<int>>(varValue))
return T::template Value<std::vector<int>>(varValue,std::string(" <vector<int>>"),defaultedValue,emptyValue);
return T::template Value<std::vector<int>>(varValue, std::string(" <vector<int>>"), defaultedValue, emptyValue);
// float
if (is_this_type<float>(varValue))
return T::template Value<float>(varValue,std::string(" <float>"),defaultedValue,emptyValue);
return T::template Value<float>(varValue, std::string(" <float>"), defaultedValue, emptyValue);
// std::vector float
if (is_this_type<std::vector<float>>(varValue))
return T::template Value<std::vector<float>>(varValue,std::string(" <vector<float>>"),defaultedValue,emptyValue);
return T::template Value<std::vector<float>>(varValue, std::string(" <vector<float>>"), defaultedValue, emptyValue);
// double
if (is_this_type<double>(varValue))
return T::template Value<double>(varValue,std::string(" <double>"),defaultedValue,emptyValue);
return T::template Value<double>(varValue, std::string(" <double>"), defaultedValue, emptyValue);
// std::vector double
if (is_this_type<std::vector<double>>(varValue))
return T::template Value<std::vector<double>>(varValue,std::string(" <vector<double>>"),defaultedValue,emptyValue);
return T::template Value<std::vector<double>>(varValue, std::string(" <vector<double>>"), defaultedValue, emptyValue);
// short
if (is_this_type<short>(varValue))
return T::template Value<short>(varValue,std::string(" <short>"),defaultedValue,emptyValue);
return T::template Value<short>(varValue, std::string(" <short>"), defaultedValue, emptyValue);
// std::vector short
if (is_this_type<std::vector<short>>(varValue))
return T::template Value<std::vector<short>>(varValue,std::string(" <vector<short>>"),defaultedValue,emptyValue);
return T::template Value<std::vector<short>>(varValue, std::string(" <vector<short>>"), defaultedValue, emptyValue);
// long
if (is_this_type<long>(varValue))
return T::template Value<long>(varValue,std::string(" <long>"),defaultedValue,emptyValue);
return T::template Value<long>(varValue, std::string(" <long>"), defaultedValue, emptyValue);
// std::vector short
if (is_this_type<std::vector<long>>(varValue))
return T::template Value<std::vector<long>>(varValue,std::string(" <vector<long>>"),defaultedValue,emptyValue);
return T::template Value<std::vector<long>>(varValue, std::string(" <vector<long>>"), defaultedValue, emptyValue);
// size_t
if (is_this_type<std::size_t>(varValue))
return T::template Value<std::size_t>(varValue,std::string(" <std::size_t>"),defaultedValue,emptyValue);
return T::template Value<std::size_t>(varValue, std::string(" <std::size_t>"), defaultedValue, emptyValue);
// std::vector size_t
if (is_this_type<std::vector<std::size_t>>(varValue))
return T::template Value<std::vector<std::size_t>>(varValue,std::string(" <vector<std::size_t>>"),defaultedValue,emptyValue);
return T::template Value<std::vector<std::size_t>>(varValue, std::string(" <vector<std::size_t>>"), defaultedValue, emptyValue);
// bool
if (is_this_type<bool>(varValue))
return T::template Value<bool>(varValue,std::string(" <bool>"),defaultedValue,emptyValue);
return T::template Value<bool>(varValue, std::string(" <bool>"), defaultedValue, emptyValue);
// std::vector bool
if (is_this_type<std::vector<bool>>(varValue))
return T::template Value<std::vector<bool>>(varValue,std::string(" <vector<bool>>"),defaultedValue,emptyValue);
return T::template Value<std::vector<bool>>(varValue, std::string(" <vector<bool>>"), defaultedValue, emptyValue);
//////////////////////////////// boost types
// boost::filesystem::path
if (is_this_type<boost::filesystem::path>(varValue))
return T::template Value<boost::filesystem::path>(varValue,std::string(" <boost::filesystem::path>"),defaultedValue,emptyValue);
return T::template Value<boost::filesystem::path>(varValue, std::string(" <boost::filesystem::path>"), defaultedValue, emptyValue);
// if we get here, the type is not supported return unknown info
return T::DefaultValue(defaultedValue,emptyValue);
return T::DefaultValue(defaultedValue, emptyValue);
}
};