12 #include "boost/algorithm/string/join.hpp" 13 #include "boost/format.hpp" 17 bool gp::PropertyValue::IsSimple()
const {
return std::holds_alternative<std::string>( value_ ); }
19 bool gp::PropertyValue::IsVector()
const {
return std::holds_alternative<std::vector<std::string>>( value_ ); }
21 bool gp::PropertyValue::IsMap()
const {
return std::holds_alternative<std::map<std::string, std::string>>( value_ ); }
23 gp::PropertyValue& gp::PropertyValue::operator+=(
const PropertyValue& right ) {
25 if ( IsReference() ) {
throw PropertyValueException::WrongLValue(); }
33 lhs.
insert( rhs.begin(), rhs.end() );
35 [](
auto&,
const auto& ) {
throw PropertyValueException::WrongRValue(); } ),
36 value_, right.value_ );
44 gp::PropertyValue& gp::PropertyValue::operator-=(
const PropertyValue& right ) {
45 if ( IsReference() ) {
throw PropertyValueException::WrongLValue(); }
54 for (
const auto& item : rhs ) lhs.
erase( item );
56 [](
std::string&,
const auto& ) {
throw PropertyValueException::WrongLValue(); },
57 [](
auto&,
const auto& ) {
throw PropertyValueException::WrongRValue(); } ),
58 value_, right.value_ );
67 if ( IsReference() ) {
68 const auto& value = std::get<std::vector<std::string>>( value_ );
69 if ( value.at( 0 ) !=
"" ) {
70 return "@" + value.
at( 0 ) +
"." + value.at( 1 );
72 return "@" + value.at( 0 );
77 return '[' + boost::algorithm::join( v,
", " ) +
']';
82 for (
const auto& in : v ) {
83 result += delim + in.first +
":" + in.second;
decltype(auto) operator+(const T &v, const Property< TP, V, H > &p)
implemantation of (value + property)
GAUDI_API Stat operator-(const Stat &stat, const double value)
external operator for subtraction of Stat and a number
auto overload(lambda_ts &&... lambdas)