The Gaudi Framework  v40r0 (475e45c1)
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_info * type_info () const
 property type-info More...
 
std::string type () const
 property type More...
 
virtual PropertyBasedeclareReadHandler (std::function< void(PropertyBase &)> fun)=0
 set new callback for reading More...
 
virtual PropertyBasedeclareUpdateHandler (std::function< void(PropertyBase &)> fun)=0
 set new callback for update 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::ostream & fillStream (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_info * ownerType () 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
 
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 35 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 41 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 38 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 39 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 40 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 51 of file Property.h.

52  : Details::PropertyBase( typeid( ValueType ), std::move( name ), std::move( doc ), std::move( semantics ) )
53  , m_value( std::forward<T>( value ) ) {
55  }

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

69  : Property( std::move( name ), std::forward<T>( value ), std::move( doc ), std::move( semantics ) ) {
70  owner->declareProperty( *this );
71  setOwnerType<OWNER>();
72  }

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

79  : Property( owner, std::move( name ), std::forward<T>( value ), std::move( doc ), std::move( semantics ) ) {
80  declareUpdateHandler( std::move( handler ) );
81  }

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

88  : Property(
89  owner, std::move( name ), std::forward<T>( value ),
90  [owner, handler]( PropertyBase& p ) { ( owner->*handler )( p ); }, std::move( doc ),
91  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 95 of file Property.h.

97  : Property(
98  owner, std::move( name ), std::forward<T>( value ),
99  [owner, handler]( PropertyBase& ) { ( owner->*handler )(); }, std::move( doc ), std::move( semantics ) ) {
100  }

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

107  : Property( owner, std::move( name ), std::forward<T>( value ), std::move( handler ), std::move( doc ),
108  std::move( semantics ) ) {
109  if ( invoke ) useUpdateHandler();
110  }

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

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

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

239 { 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)
inlineoverride

set new callback for reading

Definition at line 130 of file Property.h.

130  {
131  m_handlers.setReadHandler( std::move( fun ) );
132  return *this;
133  }

◆ 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)
inlineoverride

set new callback for update

Definition at line 135 of file Property.h.

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

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

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

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

373  {
374  // delegate to the 'opposite' method
375  return dest.assign( *this );
376  }

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

156  {
157  m_handlers.useReadHandler( *this );
158  return m_value;
159  }

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

355  {
356  return value()( std::forward<Args>( args )... );
357  }

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

298  {
299  ++value();
300  return *this;
301  }

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

303  {
304  return m_value++;
305  }

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

316  {
317  m_value += other;
318  return *this;
319  }

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

307  {
308  --value();
309  return *this;
310  }

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

312  {
313  return m_value--;
314  }

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

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

141  {
142  return m_handlers.getReadHandler();
143  }

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

124  : 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 116 of file Property.h.

118  : 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 167 of file Property.h.

168  {
169  m_handlers.useReadHandler( *this );
170  return m_value;
171  }
172 
174  std::ostream& fillStream( std::ostream& stream ) const override {
175  stream << " '" << name() << "':";
176  if constexpr ( std::is_same_v<ValueType, std::string> ) {
178  toStream( value(), stream );
179  } else {
180  stream << toString();
181  }
182  return stream;
183  }
184 
185  operator std::string_view() const {
186  m_handlers.useReadHandler( *this );
187  return m_value;
188  }
189 
191  template <class T>
192  bool operator==( const T& other ) const {
193  return m_value == other;
194  }
195 
197  template <class T>
198  bool operator!=( const T& other ) const {
199  return m_value != other;
200  }
201 
203  template <class T>
204  bool operator<( const T& other ) const {
205  return m_value < other;
206  }
207 
209  template <class T>
210  decltype( auto ) operator+( const T& other ) const {
211  return m_value + other;
212  }
213 
215  template <class T = ValueType>
216  Property& operator=( T&& v ) {
217  m_verifier( v );
218  m_value = std::forward<T>( v );
219  m_handlers.useUpdateHandler( *this );
220  return *this;
221  }

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

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

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

231  {
232  *this = v;
233  return true;
234  }

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

411  {
412  m_handlers.useReadHandler( *this );
413  using Utils::toStream;
414  toStream( m_value, out );
415  }

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

406  {
407  using Converter = Details::Property::StringConverter<ValueType>;
408  return Converter().toString( *this );
409  }

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

145  {
146  return m_handlers.getUpdateHandler();
147  }

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

150  {
151  m_handlers.useUpdateHandler( *this );
152  return true;
153  }

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

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

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

226 { 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 224 of file Property.h.

224 { 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 46 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

Definition at line 44 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 45 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 60 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 60 of file Property.h.


The documentation for this class was generated from the following file:
Write.stream
stream
Definition: Write.py:32
Gaudi::Details::PropertyBase::operator=
PropertyBase & operator=(const PropertyBase &)=default
assignment operator
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
Gaudi::operator==
bool operator==(const T &v, const Property< TP, V, H > &p)
delegate (value == property) to property operator==
Definition: Property.h:420
GaudiException
Definition: GaudiException.h:29
Gaudi::Property::m_handlers
HandlersType m_handlers
Definition: Property.h:46
Gaudi::Property::name
std::string name
Definition: Property.h:60
Gaudi::Property::fromString
StatusCode fromString(const std::string &source) override
string -> value
Definition: Property.h:378
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:45
Converter
Definition: Converter.h:33
Gaudi::Property::declareUpdateHandler
Details::PropertyBase & declareUpdateHandler(std::function< void(Details::PropertyBase &)> fun) override
set new callback for update
Definition: Property.h:135
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:229
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:117
Gaudi::Property::m_verifier
VerifierType m_verifier
Definition: Property.h:45
Gaudi::Details::PropertyBase::semantics
std::string semantics() const
property semantics
Definition: PropertyBase.h:42
Gaudi::Property::useUpdateHandler
bool useUpdateHandler() override
manual trigger for callback for update
Definition: Property.h:150
Gaudi::Details::Property::parsingErrorPolicy
ParsingErrorPolicy parsingErrorPolicy()
Definition: Property.cpp:476
gaudirun.dest
dest
Definition: gaudirun.py:224
Gaudi::Property::toStream
void toStream(std::ostream &out) const override
value -> stream
Definition: Property.h:411
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:99
gaudirun.args
args
Definition: gaudirun.py:336
Gaudi::Property::m_value
StorageType m_value
Definition: Property.h:44
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:304
Gaudi::Property::toString
std::string toString() const override
value -> string
Definition: Property.h:406
Gaudi::operator<
bool operator<(const Gaudi::Histo1DDef &left, const Gaudi::Histo1DDef &right)
Definition: HistoDef.cpp:44
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:51
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:100
Gaudi::Details::PropertyBase::ownerTypeName
std::string ownerTypeName() const
get the string for the type of the owner class (used for documentation)
Definition: PropertyBase.h:111
Gaudi::operator!=
bool operator!=(const T &v, const Property< TP, V, H > &p)
delegate (value != property) to property operator!=
Definition: Property.h:426
Gaudi::Property::ValueType
typename std::remove_reference< StorageType >::type ValueType
Definition: Property.h:39
Gaudi::Functional::details::out
OptOut && out
Definition: details.h:196