11 #include <boost/format.hpp> 15 bool gp::PropertyValue::IsSimple()
const {
return boost::get<std::string>( &value_ ) != NULL; }
17 bool gp::PropertyValue::IsVector()
const {
return boost::get<std::vector<std::string>>( &value_ ) != NULL; }
19 bool gp::PropertyValue::IsMap()
const {
return boost::get<std::map<std::string, std::string>>( &value_ ) != NULL; }
21 gp::PropertyValue& gp::PropertyValue::operator+=(
const PropertyValue& right )
24 if ( IsSimple() || IsReference() ) {
25 throw PropertyValueException::WrongLValue();
30 boost::get<VectorOfStrings>( value_ ).
push_back( boost::get<std::string>( right.
value_ ) );
35 for (
const auto& item : boost::get<VectorOfStrings>( right.
value_ ) ) {
40 throw PropertyValueException::WrongRValue();
44 if ( !right.
IsMap() ) {
45 throw PropertyValueException::WrongRValue();
49 for (
const auto& item : rmap ) {
62 gp::PropertyValue& gp::PropertyValue::operator-=(
const PropertyValue& right )
64 if ( IsSimple() || IsReference() ) {
65 throw PropertyValueException::WrongLValue();
77 for (
const auto& item : rvec ) {
82 throw PropertyValueException::WrongRValue();
94 for (
const auto& item : rvec ) {
99 throw PropertyValueException::WrongRValue();
101 throw PropertyValueException::WrongLValue();
111 if ( IsReference() ) {
113 assert( value != NULL );
114 if ( value->
at( 0 ) !=
"" ) {
115 return "@" + value->
at( 0 ) +
"." + value->
at( 1 );
117 return "@" + value->
at( 0 );
120 if (
const std::string* value = boost::get<std::string>( &value_ ) ) {
125 for (
const auto& in : *value ) {
126 result += delim + in;
134 for (
const auto& in : *value ) {
135 result += delim + in.first +
":" + in.second;
void push_back(Container &c, const Value &v, std::true_type)
struct GAUDI_API map
Parametrisation class for map-like implementation.
KeyedObjectManager< vector > Vector
Forward declaration of specialized std::vector-like object manager.
VectorOfStrings & Vector()
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
KeyedObjectManager< map > Map
Forward declaration of specialized std::map-like object manager.