Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (f31105fd)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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<std::derived_from< IProperty > OWNER, typename T = ValueType>
 requires (std::is_default_constructible_v< T >) Property(OWNER *owner
 Autodeclaring constructor with property name, value and documentation. More...
 
std::string setOwnerType ()
 
template<std::derived_from< IProperty > OWNER, class T = StorageType>
 Property (OWNER *owner, std::string name, T &&value, std::string doc="", std::string semantics="")
 Autodeclaring constructor with property name, value and documentation. More...
 
template<std::derived_from< IProperty > OWNER, class T = StorageType>
 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<std::derived_from< IProperty > OWNER, class T = StorageType>
 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<std::derived_from< IProperty > OWNER, class T = StorageType>
 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<std::derived_from< IProperty > OWNER, class T = StorageType>
 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 >
 requires (!std::is_same_v< Property, std::remove_reference_t< T >>) Property(T &&v)
 Construct an anonymous property from a value. More...
 
template<typename T = StorageType>
 requires (!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>
 requires (std::is_constructible_v< std::string_view, Dummy >) operator std
 
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...
 
virtual std::ostreamfillStream (std::ostream &) const
 the printout of the property value 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...
 

Public Attributes

std::string name: Property( std::move( name )
 
std::string ValueType {}
 

Private Attributes

StorageType m_value
 Storage. More...
 
VerifierType m_verifier
 
HandlersType m_handlers
 

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 37 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 44 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 41 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 42 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 43 of file Property.h.

Constructor & Destructor Documentation

◆ Property() [1/6]

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 57 of file Property.h.

58  : Details::PropertyBase( typeid( ValueType ), std::move( name ), std::move( doc ), std::move( semantics ) )
59  , m_value( std::forward<T>( value ) ) {
61  }

◆ Property() [2/6]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<std::derived_from< IProperty > OWNER, class T = StorageType>
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 of requires is required to avoid ambiguities

Definition at line 74 of file Property.h.

75  : Property( std::move( name ), std::forward<T>( value ), std::move( doc ), std::move( semantics ) ) {
76  owner->declareProperty( *this );
77  setOwnerType<OWNER>();
78  }

◆ Property() [3/6]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<std::derived_from< IProperty > OWNER, class T = StorageType>
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 of requires is required to avoid ambiguities

Definition at line 83 of file Property.h.

85  : Property( owner, std::move( name ), std::forward<T>( value ), std::move( doc ), std::move( semantics ) ) {
86  declareUpdateHandler( std::move( handler ) );
87  }

◆ Property() [4/6]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<std::derived_from< IProperty > OWNER, class T = StorageType>
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 of requires is required to avoid ambiguities

Definition at line 92 of file Property.h.

94  : Property(
95  owner, std::move( name ), std::forward<T>( value ),
96  [owner, handler]( PropertyBase& p ) { ( owner->*handler )( p ); }, std::move( doc ),
97  std::move( semantics ) ) {}

◆ Property() [5/6]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<std::derived_from< IProperty > OWNER, class T = StorageType>
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 of requires is required to avoid ambiguities

Definition at line 101 of file Property.h.

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

◆ Property() [6/6]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<std::derived_from< IProperty > OWNER, class T = StorageType>
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 of requires is required to avoid ambiguities

Definition at line 111 of file Property.h.

113  : Property( owner, std::move( name ), std::forward<T>( value ), std::move( handler ), std::move( doc ),
114  std::move( semantics ) ) {
115  if ( invoke ) useUpdateHandler();
116  }

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 367 of file Property.h.

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

◆ 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 244 of file Property.h.

244 { 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 135 of file Property.h.

135  {
136  m_handlers.setReadHandler( std::move( fun ) );
137  return *this;
138  }

◆ 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 140 of file Property.h.

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

◆ 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 384 of file Property.h.

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

◆ 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 379 of file Property.h.

379  {
380  // delegate to the 'opposite' method
381  return dest.assign( *this );
382  }

◆ 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 161 of file Property.h.

161  {
162  m_handlers.useReadHandler( *this );
163  return m_value;
164  }

◆ 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 360 of file Property.h.

361  {
362  return value()( std::forward<Args>( args )... );
363  }

◆ 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 303 of file Property.h.

303  {
304  ++value();
305  return *this;
306  }

◆ 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 308 of file Property.h.

308  {
309  return m_value++;
310  }

◆ 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 321 of file Property.h.

321  {
322  m_value += other;
323  return *this;
324  }

◆ 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 312 of file Property.h.

312  {
313  --value();
314  return *this;
315  }

◆ 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 317 of file Property.h.

317  {
318  return m_value--;
319  }

◆ 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  }

◆ 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 146 of file Property.h.

146  {
147  return m_handlers.getReadHandler();
148  }

◆ requires() [1/4]

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

Construct an anonymous property with default constructed value.

Can be used only if StorageType is default constructible.

Definition at line 128 of file Property.h.

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

◆ requires() [2/4]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<typename T >
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::requires ( !std::is_same_v< Property< TYPE, VERIFIER, HANDLERS >, std::remove_reference_t< T >>  ) &&
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 122 of file Property.h.

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

◆ requires() [3/4]

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

Definition at line 172 of file Property.h.

173  {
174  m_handlers.useReadHandler( *this );
175  return m_value;
176  }
177 
179  std::ostream& fillStream( std::ostream& stream ) const override {
180  stream << " '" << name() << "':";
181  if constexpr ( std::is_same_v<ValueType, std::string> ) {
183  toStream( value(), stream );
184  } else {
185  stream << toString();
186  }
187  return stream;
188  }
189 
190  operator std::string_view() const {
191  m_handlers.useReadHandler( *this );
192  return m_value;
193  }
194 
196  template <class T>
197  bool operator==( const T& other ) const {
198  return m_value == other;
199  }
200 
202  template <class T>
203  bool operator!=( const T& other ) const {
204  return m_value != other;
205  }
206 
208  template <class T>
209  bool operator<( const T& other ) const {
210  return m_value < other;
211  }
212 
214  template <class T>
215  decltype( auto ) operator+( const T& other ) const {
216  return m_value + other;
217  }
218 
220  template <class T = ValueType>
221  Property& operator=( T&& v ) {
222  m_verifier( v );
223  m_value = std::forward<T>( v );
224  m_handlers.useUpdateHandler( *this );
225  return *this;
226  }

◆ requires() [4/4]

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<std::derived_from< IProperty > OWNER, typename T = ValueType>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::requires ( std::is_default_constructible_v< T >  )

Autodeclaring constructor with property name, value and documentation.

Note
the use of requires is required to avoid ambiguities

◆ 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 240 of file Property.h.

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

◆ setOwnerType()

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

◆ 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 236 of file Property.h.

236  {
237  *this = v;
238  return true;
239  }

◆ 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 417 of file Property.h.

417  {
418  m_handlers.useReadHandler( *this );
419  using Utils::toStream;
420  toStream( m_value, out );
421  }

◆ 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 412 of file Property.h.

412  {
413  using Converter = Details::Property::StringConverter<ValueType>;
414  return Converter().toString( *this );
415  }

◆ 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 150 of file Property.h.

150  {
151  return m_handlers.getUpdateHandler();
152  }

◆ 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 155 of file Property.h.

155  {
156  m_handlers.useUpdateHandler( *this );
157  return true;
158  }

◆ 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 235 of file Property.h.

235 { 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 234 of file Property.h.

234 { 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 231 of file Property.h.

231 { 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 229 of file Property.h.

229 { return m_verifier; }

Member Data Documentation

◆ 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 51 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 49 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 50 of file Property.h.

◆ name

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

Definition at line 66 of file Property.h.

◆ ValueType

template<class TYPE , class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
std::string Gaudi::Property< TYPE, VERIFIER, HANDLERS >::ValueType {}

Definition at line 66 of file Property.h.


The documentation for this class was generated from the following file:
Write.stream
stream
Definition: Write.py:32
std::string
STL class.
std::exception
STL class.
std::move
T move(T... args)
Gaudi::Details::PropertyBase::operator=
PropertyBase & operator=(const PropertyBase &)=default
assignment operator
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:315
Gaudi::operator==
bool operator==(const T &v, const Property< TP, V, H > &p)
delegate (value == property) to property operator==
Definition: Property.h:426
GaudiException
Definition: GaudiException.h:32
Gaudi::Property::m_handlers
HandlersType m_handlers
Definition: Property.h:51
Gaudi::Property::name
std::string name
Definition: Property.h:66
Gaudi::Property::fromString
StatusCode fromString(const std::string &source) override
string -> value
Definition: Property.h:384
Gaudi::Details::Property::ParsingErrorPolicy
ParsingErrorPolicy
Definition: Property.h:221
Gaudi::Details::PropertyBase::fillStream
virtual std::ostream & fillStream(std::ostream &) const
the printout of the property value
Definition: Property.cpp:60
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:140
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:234
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:50
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:155
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:417
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:49
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:334
Gaudi::Property::toString
std::string toString() const override
value -> string
Definition: Property.h:412
Gaudi::operator<
bool operator<(const Gaudi::Histo1DDef &left, const Gaudi::Histo1DDef &right)
Definition: HistoDef.cpp:59
Properties.v
v
Definition: Properties.py:122
Gaudi::Property::Property
Property(std::string name, T &&value, std::string doc="", std::string semantics="")
the constructor with property name, value and documentation.
Definition: Property.h:57
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::operator!=
bool operator!=(const T &v, const Property< TP, V, H > &p)
delegate (value != property) to property operator!=
Definition: Property.h:432
Gaudi::Property::ValueType
typename std::remove_reference< StorageType >::type ValueType
Definition: Property.h:42
std::abort
T abort(T... args)
std::exception::what
T what(T... args)
Gaudi::Functional::details::out
OptOut && out
Definition: details.h:174