The Gaudi Framework  v38r3 (c3fc9673)
Gaudi::Property< TYPE, VERIFIER, HANDLERS > Class Template Reference

Implementation of property with value of concrete type. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Property.h>

Inheritance diagram for Gaudi::Property< TYPE, VERIFIER, HANDLERS >:
Collaboration diagram for Gaudi::Property< TYPE, VERIFIER, HANDLERS >:

Public Types

using StorageType = TYPE
 Hosted type. More...
 
using ValueType = typename std::remove_reference< StorageType >::type
 
using VerifierType = VERIFIER
 
using HandlersType = HANDLERS
 

Public Member Functions

template<class T = StorageType>
 Property (std::string name, T &&value, std::string doc="", std::string semantics="")
 the constructor with property name, value and documentation. More...
 
template<typename OWNER , typename T = ValueType, typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>, typename = std::enable_if_t<std::is_default_constructible_v<T>>>
 Property (OWNER *owner, std::string name)
 Autodeclaring constructor with property name, value and documentation. More...
 
template<class OWNER , class T = StorageType, typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
 Property (OWNER *owner, std::string name, T &&value, std::string doc="", std::string semantics="")
 Autodeclaring constructor with property name, value and documentation. More...
 
template<class OWNER , class T = StorageType, typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
 Property (OWNER *owner, std::string name, T &&value, std::function< void(PropertyBase &)> handler, std::string doc="", std::string semantics="")
 Autodeclaring constructor with property name, value, updateHandler and documentation. More...
 
template<class OWNER , class T = StorageType, typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
 Property (OWNER *owner, std::string name, T &&value, void(OWNER::*handler)(PropertyBase &), std::string doc="", std::string semantics="")
 Autodeclaring constructor with property name, value, pointer to member function updateHandler and documentation. More...
 
template<class OWNER , class T = StorageType, typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
 Property (OWNER *owner, std::string name, T &&value, void(OWNER::*handler)(), std::string doc="", std::string semantics="")
 Autodeclaring constructor with property name, value, pointer to member function updateHandler and documentation. More...
 
template<class OWNER , class T = StorageType, typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
 Property (OWNER *owner, std::string name, T &&value, std::function< void(PropertyBase &)> handler, Details::Property::ImmediatelyInvokeHandler invoke, std::string doc="", std::string semantics="")
 Autodeclaring constructor with property name, value, updateHandler and documentation. More...
 
template<typename T , typename = not_copying<T>>
 Property (T &&v)
 Construct an anonymous property from a value. More...
 
template<typename T = StorageType, typename = std::enable_if_t<!std::is_reference_v<T>>>
 Property ()
 Construct an anonymous property with default constructed value. More...
 
Details::PropertyBasedeclareReadHandler (std::function< void(Details::PropertyBase &)> fun) override
 set new callback for reading More...
 
Details::PropertyBasedeclareUpdateHandler (std::function< void(Details::PropertyBase &)> fun) override
 set new callback for update More...
 
const std::function< void(Details::PropertyBase &)> readCallBack () const override
 get a reference to the readCallBack More...
 
const std::function< void(Details::PropertyBase &)> updateCallBack () const override
 get a reference to the updateCallBack More...
 
bool useUpdateHandler () override
 manual trigger for callback for update More...
 
 operator const ValueType & () const
 Automatic conversion to value (const reference). More...
 
template<typename Dummy = TYPE, typename = std::enable_if_t<std::is_constructible_v<std::string_view, Dummy>>>
 operator std::string_view () const
 
std::ostreamfillStream (std::ostream &stream) const override
 Properly quote string properties when printing them. More...
 
 operator std::string_view () const
 
template<class T >
bool operator== (const T &other) const
 equality comparison More...
 
template<class T >
bool operator!= (const T &other) const
 inequality comparison More...
 
template<class T >
bool operator< (const T &other) const
 "less" comparison More...
 
template<class T = ValueType>
Propertyoperator= (T &&v)
 Assignment from value. More...
 
const VerifierTypeverifier () const
 Accessor to verifier. More...
 
VerifierTypeverifier ()
 Accessor to verifier. More...
 
template<class... Args>
decltype( operator() (Args &&... args) const noexcept(noexcept(std::declval< ValueType >()(std::declval< Args && >()...))) std::declval< ValueType >()(std::declval< Args && >()...))
 
bool assign (const Details::PropertyBase &source) override
 get the value from another property More...
 
bool load (Details::PropertyBase &dest) const override
 set value to another property More...
 
StatusCode fromString (const std::string &source) override
 string -> value More...
 
std::string toString () const override
 value -> string More...
 
void toStream (std::ostream &out) const override
 value -> stream More...
 
const ValueTypevalue () const
 
ValueTypevalue ()
 
bool setValue (const ValueType &v)
 
bool set (const ValueType &v)
 
Details::PropertyBaseclone () const override
 clones the current property More...
 
Helpers for easy use of string and vector properties.

They are instantiated only if they are implemented in the wrapped class.

template<class = ValueType>
Propertyoperator++ ()
 
template<class = ValueType>
ValueType operator++ (int)
 
template<class = ValueType>
Propertyoperator-- ()
 
template<class = ValueType>
ValueType operator-- (int)
 
template<class T = ValueType>
Propertyoperator+= (const T &other)
 
template<class T = ValueType>
Propertyoperator-= (const T &other)
 
- Public Member Functions inherited from Gaudi::Details::PropertyBase
const std::string name () const
 property name More...
 
std::string documentation () const
 property documentation More...
 
std::string semantics () const
 property semantics More...
 
const std::type_infotype_info () const
 property type-info More...
 
std::string type () const
 property type More...
 
template<class HT >
PropertyBasedeclareReadHandler (void(HT::*MF)(PropertyBase &), HT *instance)
 
template<class HT >
PropertyBasedeclareUpdateHandler (void(HT::*MF)(PropertyBase &), HT *instance)
 
virtual ~PropertyBase ()
 virtual destructor More...
 
void setName (std::string value)
 set the new value for the property name More...
 
void setDocumentation (std::string value)
 set the documentation string More...
 
void setSemantics (std::string value)
 set the semantics string More...
 
void setOwnerType (const std::type_info &ownerType)
 set the type of the owner class (used for documentation) More...
 
template<class OWNER >
void setOwnerType ()
 set the type of the owner class (used for documentation) More...
 
const std::type_infoownerType () const
 get the type of the owner class (used for documentation) More...
 
std::string ownerTypeName () const
 get the string for the type of the owner class (used for documentation) More...
 

Private Attributes

StorageType m_value
 Storage. More...
 
VerifierType m_verifier
 
HandlersType m_handlers
 
template<class T >
using not_copying = std::enable_if_t<!is_this_type_v< T > >
 
template<class T >
static constexpr bool is_this_type_v = std::is_same_v<Property, std::remove_reference_t<T>>
 helper typedefs for SFINAE More...
 

Additional Inherited Members

- Protected Member Functions inherited from Gaudi::Details::PropertyBase
 PropertyBase (const std::type_info &type, std::string name="", std::string doc="", std::string semantics="")
 constructor from the property name and the type More...
 
 PropertyBase (std::string name, const std::type_info &type)
 constructor from the property name and the type More...
 
 PropertyBase (const PropertyBase &)=default
 copy constructor More...
 
PropertyBaseoperator= (const PropertyBase &)=default
 assignment operator More...
 

Detailed Description

template<class TYPE, class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
class Gaudi::Property< TYPE, VERIFIER, HANDLERS >

Implementation of property with value of concrete type.

Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-02-27
Author
Marco Clemencic
Date
2016-06-16

Definition at line 39 of file Property.h.

Member Typedef Documentation

◆ HandlersType

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
using Gaudi::Property< TYPE, VERIFIER, HANDLERS >::HandlersType = HANDLERS

Definition at line 46 of file Property.h.

◆ not_copying

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class T >
using Gaudi::Property< TYPE, VERIFIER, HANDLERS >::not_copying = std::enable_if_t<!is_this_type_v<T> >
private

Definition at line 59 of file Property.h.

◆ StorageType

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
using Gaudi::Property< TYPE, VERIFIER, HANDLERS >::StorageType = TYPE

Hosted type.

Definition at line 43 of file Property.h.

◆ ValueType

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
using Gaudi::Property< TYPE, VERIFIER, HANDLERS >::ValueType = typename std::remove_reference<StorageType>::type

Definition at line 44 of file Property.h.

◆ VerifierType

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
using Gaudi::Property< TYPE, VERIFIER, HANDLERS >::VerifierType = VERIFIER

Definition at line 45 of file Property.h.

Constructor & Destructor Documentation

◆ Property() [1/9]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class T = StorageType>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( std::string  name,
T &&  value,
std::string  doc = "",
std::string  semantics = "" 
)
inline

the constructor with property name, value and documentation.

Definition at line 65 of file Property.h.

66  : Details::PropertyBase( typeid( ValueType ), std::move( name ), std::move( doc ), std::move( semantics ) )
67  , m_value( std::forward<T>( value ) ) {
69  }

◆ Property() [2/9]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<typename OWNER , typename T = ValueType, typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>, typename = std::enable_if_t<std::is_default_constructible_v<T>>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER *  owner,
std::string  name 
)
inline

Autodeclaring constructor with property name, value and documentation.

Note
the use std::enable_if is required to avoid ambiguities

Definition at line 74 of file Property.h.

74  : Property( std::move( name ), ValueType{}, "" ) {
75  owner->declareProperty( *this );
76  setOwnerType<OWNER>();
77  }

◆ Property() [3/9]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class OWNER , class T = StorageType, typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER *  owner,
std::string  name,
T &&  value,
std::string  doc = "",
std::string  semantics = "" 
)
inline

Autodeclaring constructor with property name, value and documentation.

Note
the use std::enable_if is required to avoid ambiguities

Definition at line 82 of file Property.h.

83  : Property( std::move( name ), std::forward<T>( value ), std::move( doc ), std::move( semantics ) ) {
84  owner->declareProperty( *this );
85  setOwnerType<OWNER>();
86  }

◆ Property() [4/9]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class OWNER , class T = StorageType, typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER *  owner,
std::string  name,
T &&  value,
std::function< void(PropertyBase &)>  handler,
std::string  doc = "",
std::string  semantics = "" 
)
inline

Autodeclaring constructor with property name, value, updateHandler and documentation.

Note
the use std::enable_if is required to avoid ambiguities

Definition at line 91 of file Property.h.

93  : Property( owner, std::move( name ), std::forward<T>( value ), std::move( doc ), std::move( semantics ) ) {
94  declareUpdateHandler( std::move( handler ) );
95  }

◆ Property() [5/9]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class OWNER , class T = StorageType, typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER *  owner,
std::string  name,
T &&  value,
void(OWNER::*)(PropertyBase &)  handler,
std::string  doc = "",
std::string  semantics = "" 
)
inline

Autodeclaring constructor with property name, value, pointer to member function updateHandler and documentation.

Note
the use std::enable_if is required to avoid ambiguities

Definition at line 100 of file Property.h.

102  : Property(
103  owner, std::move( name ), std::forward<T>( value ),
104  [owner, handler]( PropertyBase& p ) { ( owner->*handler )( p ); }, std::move( doc ),
105  std::move( semantics ) ) {}

◆ Property() [6/9]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class OWNER , class T = StorageType, typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER *  owner,
std::string  name,
T &&  value,
void(OWNER::*)()  handler,
std::string  doc = "",
std::string  semantics = "" 
)
inline

Autodeclaring constructor with property name, value, pointer to member function updateHandler and documentation.

Note
the use std::enable_if is required to avoid ambiguities

Definition at line 109 of file Property.h.

111  : Property(
112  owner, std::move( name ), std::forward<T>( value ),
113  [owner, handler]( PropertyBase& ) { ( owner->*handler )(); }, std::move( doc ), std::move( semantics ) ) {
114  }

◆ Property() [7/9]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class OWNER , class T = StorageType, typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER *  owner,
std::string  name,
T &&  value,
std::function< void(PropertyBase &)>  handler,
Details::Property< TYPE, VERIFIER, HANDLERS >::ImmediatelyInvokeHandler  invoke,
std::string  doc = "",
std::string  semantics = "" 
)
inline

Autodeclaring constructor with property name, value, updateHandler and documentation.

Note
the use std::enable_if is required to avoid ambiguities

Definition at line 119 of file Property.h.

121  : Property( owner, std::move( name ), std::forward<T>( value ), std::move( handler ), std::move( doc ),
122  std::move( semantics ) ) {
123  if ( invoke ) useUpdateHandler();
124  }

◆ Property() [8/9]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<typename T , typename = not_copying<T>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( T &&  v)
inline

Construct an anonymous property from a value.

This constructor is not generated if T is the current type, so that the compiler picks up the copy constructor instead of this one.

Definition at line 130 of file Property.h.

130 : Details::PropertyBase( typeid( ValueType ), "", "", "" ), m_value( std::forward<T>( v ) ) {}

◆ Property() [9/9]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<typename T = StorageType, typename = std::enable_if_t<!std::is_reference_v<T>>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( )
inline

Construct an anonymous property with default constructed value.

Can be used only if StorageType is default constructible.

Definition at line 135 of file Property.h.

135 : Details::PropertyBase( typeid( ValueType ), "", "", "" ), m_value() {}

Member Function Documentation

◆ assign()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::assign ( const Details::PropertyBase source)
inlineoverridevirtual

get the value from another property

Implements Gaudi::Details::PropertyBase.

Definition at line 372 of file Property.h.

372  {
373  // Check if the property is of "the same" type, except for strings
374  const Property* p =
375  ( std::is_same_v<ValueType, std::string> ) ? nullptr : dynamic_cast<const Property*>( &source );
376  if ( p ) {
377  *this = p->value();
378  } else {
379  return this->fromString( source.toString() ).isSuccess();
380  }
381  return true;
382  }

◆ clone()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
Details::PropertyBase* Gaudi::Property< TYPE, VERIFIER, HANDLERS >::clone ( ) const
inlineoverridevirtual

clones the current property

Implements Gaudi::Details::PropertyBase.

Definition at line 249 of file Property.h.

249 { return new Property( *this ); }

◆ declareReadHandler()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
Details::PropertyBase& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::declareReadHandler ( std::function< void(Details::PropertyBase &)>  fun)
inlineoverridevirtual

set new callback for reading

Implements Gaudi::Details::PropertyBase.

Definition at line 141 of file Property.h.

141  {
142  m_handlers.setReadHandler( std::move( fun ) );
143  return *this;
144  }

◆ declareUpdateHandler()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
Details::PropertyBase& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::declareUpdateHandler ( std::function< void(Details::PropertyBase &)>  fun)
inlineoverridevirtual

set new callback for update

Implements Gaudi::Details::PropertyBase.

Definition at line 146 of file Property.h.

146  {
147  m_handlers.setUpdateHandler( std::move( fun ) );
148  return *this;
149  }

◆ fillStream()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
std::ostream& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::fillStream ( std::ostream stream) const
inlineoverridevirtual

Properly quote string properties when printing them.

Reimplemented from Gaudi::Details::PropertyBase.

Definition at line 184 of file Property.h.

184  {
185  stream << " '" << name() << "':";
186  if constexpr ( std::is_same_v<ValueType, std::string> ) {
188  toStream( value(), stream );
189  } else {
190  stream << toString();
191  }
192  return stream;
193  }

◆ fromString()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
StatusCode Gaudi::Property< TYPE, VERIFIER, HANDLERS >::fromString ( const std::string source)
inlineoverridevirtual

string -> value

Implements Gaudi::Details::PropertyBase.

Definition at line 389 of file Property.h.

389  {
390  try {
391  using Converter = Details::Property::StringConverter<ValueType>;
392  *this = Converter().fromString( m_value, source );
393  return StatusCode::SUCCESS;
394  } catch ( const std::exception& err ) {
397  const std::string errMsg =
398  "Cannot convert '" + source + "' for property '" + name() + "' in class '" + ownerTypeName() + "'";
399  switch ( parsingErrorPolicy() ) {
400  case ParsingErrorPolicy::Ignore:
401  break;
402  case ParsingErrorPolicy::Exception:
403  throw GaudiException( errMsg, "Property::fromString", StatusCode::FAILURE, err );
404  break;
405  case ParsingErrorPolicy::Warning:
406  std::cerr << "WARNING: " << errMsg << "': " << err.what() << '\n';
407  break;
408  case ParsingErrorPolicy::Abort:
409  std::cerr << "FATAL: " << errMsg << "': " << err.what() << '\n';
410  std::abort();
411  break;
412  }
413  return StatusCode::FAILURE;
414  }
415  }

◆ load()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::load ( Details::PropertyBase dest) const
inlineoverridevirtual

set value to another property

Implements Gaudi::Details::PropertyBase.

Definition at line 384 of file Property.h.

384  {
385  // delegate to the 'opposite' method
386  return dest.assign( *this );
387  }

◆ operator const ValueType &()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator const ValueType & ( ) const
inline

Automatic conversion to value (const reference).

Definition at line 167 of file Property.h.

167  {
168  m_handlers.useReadHandler( *this );
169  return m_value;
170  }

◆ operator std::string_view() [1/2]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<typename Dummy = TYPE, typename = std::enable_if_t<std::is_constructible_v<std::string_view, Dummy>>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator std::string_view ( ) const
inline

Definition at line 178 of file Property.h.

178  {
179  m_handlers.useReadHandler( *this );
180  return m_value;
181  }

◆ operator std::string_view() [2/2]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator std::string_view ( ) const
inline

Definition at line 195 of file Property.h.

195  {
196  m_handlers.useReadHandler( *this );
197  return m_value;
198  }

◆ operator!=()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class T >
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator!= ( const T &  other) const
inline

inequality comparison

Definition at line 208 of file Property.h.

208  {
209  return m_value != other;
210  }

◆ operator()()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class... Args>
decltype( Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator() ( Args &&...  args) const
inlinenoexcept

Definition at line 365 of file Property.h.

366  {
367  return value()( std::forward<Args>( args )... );
368  }

◆ operator++() [1/2]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class = ValueType>
Property& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator++ ( )
inline

Definition at line 308 of file Property.h.

308  {
309  ++value();
310  return *this;
311  }

◆ operator++() [2/2]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class = ValueType>
ValueType Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator++ ( int  )
inline

Definition at line 313 of file Property.h.

313  {
314  return m_value++;
315  }

◆ operator+=()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class T = ValueType>
Property& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator+= ( const T &  other)
inline

Definition at line 326 of file Property.h.

326  {
327  m_value += other;
328  return *this;
329  }

◆ operator--() [1/2]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class = ValueType>
Property& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator-- ( )
inline

Definition at line 317 of file Property.h.

317  {
318  --value();
319  return *this;
320  }

◆ operator--() [2/2]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class = ValueType>
ValueType Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator-- ( int  )
inline

Definition at line 322 of file Property.h.

322  {
323  return m_value--;
324  }

◆ operator-=()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class T = ValueType>
Property& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator-= ( const T &  other)
inline

Definition at line 331 of file Property.h.

331  {
332  m_value -= other;
333  return *this;
334  }

◆ operator<()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class T >
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator< ( const T &  other) const
inline

"less" comparison

Definition at line 214 of file Property.h.

214  {
215  return m_value < other;
216  }

◆ operator=()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class T = ValueType>
Property& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator= ( T &&  v)
inline

Assignment from value.

Definition at line 226 of file Property.h.

226  {
227  m_verifier( v );
228  m_value = std::forward<T>( v );
229  m_handlers.useUpdateHandler( *this );
230  return *this;
231  }

◆ operator==()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class T >
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator== ( const T &  other) const
inline

equality comparison

Definition at line 202 of file Property.h.

202  {
203  return m_value == other;
204  }

◆ readCallBack()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
const std::function<void( Details::PropertyBase& )> Gaudi::Property< TYPE, VERIFIER, HANDLERS >::readCallBack ( ) const
inlineoverridevirtual

get a reference to the readCallBack

Implements Gaudi::Details::PropertyBase.

Definition at line 152 of file Property.h.

152  {
153  return m_handlers.getReadHandler();
154  }

◆ set()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::set ( const ValueType v)
inline

Definition at line 245 of file Property.h.

245  {
246  *this = v;
247  return true;
248  }

◆ setValue()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::setValue ( const ValueType v)
inline

Definition at line 241 of file Property.h.

241  {
242  *this = v;
243  return true;
244  }

◆ toStream()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
void Gaudi::Property< TYPE, VERIFIER, HANDLERS >::toStream ( std::ostream out) const
inlineoverridevirtual

value -> stream

Implements Gaudi::Details::PropertyBase.

Definition at line 422 of file Property.h.

422  {
423  m_handlers.useReadHandler( *this );
424  using Utils::toStream;
425  toStream( m_value, out );
426  }

◆ toString()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
std::string Gaudi::Property< TYPE, VERIFIER, HANDLERS >::toString ( ) const
inlineoverridevirtual

value -> string

Implements Gaudi::Details::PropertyBase.

Definition at line 417 of file Property.h.

417  {
418  using Converter = Details::Property::StringConverter<ValueType>;
419  return Converter().toString( *this );
420  }

◆ updateCallBack()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
const std::function<void( Details::PropertyBase& )> Gaudi::Property< TYPE, VERIFIER, HANDLERS >::updateCallBack ( ) const
inlineoverridevirtual

get a reference to the updateCallBack

Implements Gaudi::Details::PropertyBase.

Definition at line 156 of file Property.h.

156  {
157  return m_handlers.getUpdateHandler();
158  }

◆ useUpdateHandler()

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::useUpdateHandler ( )
inlineoverridevirtual

manual trigger for callback for update

Implements Gaudi::Details::PropertyBase.

Definition at line 161 of file Property.h.

161  {
162  m_handlers.useUpdateHandler( *this );
163  return true;
164  }

◆ value() [1/2]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
ValueType& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::value ( )
inline

Definition at line 240 of file Property.h.

240 { return const_cast<ValueType&>( (const ValueType&)*this ); }

◆ value() [2/2]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
const ValueType& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::value ( ) const
inline

Definition at line 239 of file Property.h.

239 { return *this; }

◆ verifier() [1/2]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
VerifierType& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::verifier ( )
inline

Accessor to verifier.

Definition at line 236 of file Property.h.

236 { return m_verifier; }

◆ verifier() [2/2]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
const VerifierType& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::verifier ( ) const
inline

Accessor to verifier.

Definition at line 234 of file Property.h.

234 { return m_verifier; }

Member Data Documentation

◆ is_this_type_v

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class T >
constexpr bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::is_this_type_v = std::is_same_v<Property, std::remove_reference_t<T>>
inlinestaticconstexprprivate

helper typedefs for SFINAE

Definition at line 57 of file Property.h.

◆ m_handlers

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
HandlersType Gaudi::Property< TYPE, VERIFIER, HANDLERS >::m_handlers
private

Definition at line 53 of file Property.h.

◆ m_value

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
StorageType Gaudi::Property< TYPE, VERIFIER, HANDLERS >::m_value
private

Storage.

Definition at line 51 of file Property.h.

◆ m_verifier

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
VerifierType Gaudi::Property< TYPE, VERIFIER, HANDLERS >::m_verifier
private

Definition at line 52 of file Property.h.


The documentation for this class was generated from the following file:
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: PropertyBase.h:39
Write.stream
stream
Definition: Write.py:32
std::string
STL class.
std::exception
STL class.
std::move
T move(T... args)
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
GaudiException
Definition: GaudiException.h:31
Gaudi::Property::m_handlers
HandlersType m_handlers
Definition: Property.h:53
Gaudi::Property::fromString
StatusCode fromString(const std::string &source) override
string -> value
Definition: Property.h:389
Gaudi::Details::Property::ParsingErrorPolicy
ParsingErrorPolicy
Definition: Property.h:221
Converter
Definition: Converter.h:34
std::cerr
Gaudi::Property::declareUpdateHandler
Details::PropertyBase & declareUpdateHandler(std::function< void(Details::PropertyBase &)> fun) override
set new callback for update
Definition: Property.h:146
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:239
Gaudi::Details::PropertyBase::PropertyBase
PropertyBase(const std::type_info &type, std::string name="", std::string doc="", std::string semantics="")
constructor from the property name and the type
Definition: PropertyBase.h:118
Gaudi::Property::m_verifier
VerifierType m_verifier
Definition: Property.h:52
Gaudi::Details::PropertyBase::semantics
std::string semantics() const
property semantics
Definition: PropertyBase.h:43
Gaudi::Property::useUpdateHandler
bool useUpdateHandler() override
manual trigger for callback for update
Definition: Property.h:161
Gaudi::Details::Property::parsingErrorPolicy
ParsingErrorPolicy parsingErrorPolicy()
Definition: Property.cpp:522
gaudirun.dest
dest
Definition: gaudirun.py:224
Gaudi::Property::toStream
void toStream(std::ostream &out) const override
value -> stream
Definition: Property.h:422
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
gaudirun.args
args
Definition: gaudirun.py:336
Gaudi::Property::m_value
StorageType m_value
Storage.
Definition: Property.h:51
Gaudi::Utils::toStream
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
Definition: ToStream.h:300
Gaudi::Property::toString
std::string toString() const override
value -> string
Definition: Property.h:417
Properties.v
v
Definition: Properties.py:122
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::Details::PropertyBase::ownerTypeName
std::string ownerTypeName() const
get the string for the type of the owner class (used for documentation)
Definition: PropertyBase.h:112
Gaudi::Property::ValueType
typename std::remove_reference< StorageType >::type ValueType
Definition: Property.h:44
std::abort
T abort(T... args)
std::exception::what
T what(T... args)
PrepareBase.out
out
Definition: PrepareBase.py:20
Gaudi::Property::Property
Property()
Construct an anonymous property with default constructed value.
Definition: Property.h:135