The Gaudi Framework  v30r4 (9b837755)
Gaudi::Property< TYPE, VERIFIER, HANDLERS > Class Template Reference

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

#include <GaudiKernel/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="")
 the constructor with property name, value and documentation. More...
 
template<typename OWNER , typename T = ValueType, typename = std::enable_if_t<std::is_base_of<IProperty, OWNER>::value>, typename = std::enable_if_t<std::is_default_constructible<T>::value>>
 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<IProperty, OWNER>::value>>
 Property (OWNER *owner, std::string name, T &&value, std::string doc="")
 Autodeclaring constructor with property name, value and documentation. More...
 
template<class OWNER , class T = StorageType, typename = std::enable_if_t<std::is_base_of<IProperty, OWNER>::value>>
 Property (OWNER *owner, std::string name, T &&value, std::function< void(PropertyBase &)> handler, std::string doc="")
 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<IProperty, OWNER>::value>>
 Property (OWNER *owner, std::string name, T &&value, void(OWNER::*handler)(PropertyBase &), std::string doc="")
 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<IProperty, OWNER>::value>>
 Property (OWNER *owner, std::string name, T &&value, void(OWNER::*handler)(), std::string doc="")
 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<IProperty, OWNER>::value>>
 Property (OWNER *owner, std::string name, T &&value, std::function< void(PropertyBase &)> handler, Details::Property::ImmediatelyInvokeHandler invoke, std::string doc="")
 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<T>::value>>
 Property ()
 Construct an anonymous property with default constructed value. More...
 
template<class OWNER , typename = std::enable_if_t<std::is_base_of<IProperty, OWNER>::value>>
void setOwner (OWNER *owner)
 Set the owner of this property. 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<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
 Backward compatibility (. More...
 
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...
 
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 ()=default
 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...
 
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...
 

Private Types

template<class T >
using is_this_type = std::is_same< Property, std::remove_reference_t< T >>
 helper typedefs for SFINAE More...
 
template<class T >
using not_copying = std::enable_if_t<!is_this_type< T >::value >
 

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="")
 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 383 of file Property.h.

Member Typedef Documentation

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

Definition at line 391 of file Property.h.

template<class TYPE, class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class T >
using Gaudi::Property< TYPE, VERIFIER, HANDLERS >::is_this_type = std::is_same<Property, std::remove_reference_t<T>>
private

helper typedefs for SFINAE

Definition at line 402 of file Property.h.

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<T>::value>
private

Definition at line 404 of file Property.h.

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

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

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

Definition at line 390 of file Property.h.

Constructor & Destructor Documentation

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 = "" 
)
inline

the constructor with property name, value and documentation.

Definition at line 410 of file Property.h.

411  : Details::PropertyBase( typeid( ValueType ), std::move( name ), std::move( doc ) )
412  , m_value( std::forward<T>( value ) )
413  {
414  m_verifier( m_value );
415  }
StorageType m_value
Storage.
Definition: Property.h:396
typename std::remove_reference< StorageType >::type ValueType
Definition: Property.h:389
T move(T...args)
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:587
VerifierType m_verifier
Definition: Property.h:397
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<IProperty, OWNER>::value>, typename = std::enable_if_t<std::is_default_constructible<T>::value>>
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 421 of file Property.h.

421  : Property( std::move( name ), ValueType{}, "" )
422  {
423  setOwner( owner );
424  }
void setOwner(OWNER *owner)
Set the owner of this property.
Definition: Property.h:493
Property()
Construct an anonymous property with default constructed value.
Definition: Property.h:484
typename std::remove_reference< StorageType >::type ValueType
Definition: Property.h:389
T move(T...args)
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<IProperty, OWNER>::value>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER *  owner,
std::string  name,
T &&  value,
std::string  doc = "" 
)
inline

Autodeclaring constructor with property name, value and documentation.

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

Definition at line 429 of file Property.h.

430  : Property( std::move( name ), std::forward<T>( value ), std::move( doc ) )
431  {
432  setOwner( owner );
433  }
void setOwner(OWNER *owner)
Set the owner of this property.
Definition: Property.h:493
Property()
Construct an anonymous property with default constructed value.
Definition: Property.h:484
T move(T...args)
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:587
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<IProperty, OWNER>::value>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER *  owner,
std::string  name,
T &&  value,
std::function< void(PropertyBase &)>  handler,
std::string  doc = "" 
)
inline

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

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

Definition at line 438 of file Property.h.

440  : Property( owner, std::move( name ), std::forward<T>( value ), std::move( doc ) )
441  {
442  declareUpdateHandler( std::move( handler ) );
443  }
Details::PropertyBase & declareUpdateHandler(std::function< void(Details::PropertyBase &)> fun) override
set new callback for update
Definition: Property.h:506
Property()
Construct an anonymous property with default constructed value.
Definition: Property.h:484
T move(T...args)
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:587
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<IProperty, OWNER>::value>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER *  owner,
std::string  name,
T &&  value,
void(OWNER::*)(PropertyBase &)  handler,
std::string  doc = "" 
)
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 448 of file Property.h.

450  : Property( owner, std::move( name ), std::forward<T>( value ),
451  [owner, handler]( PropertyBase& p ) { ( owner->*handler )( p ); }, std::move( doc ) )
452  {
453  }
PropertyBase(const std::type_info &type, std::string name="", std::string doc="")
constructor from the property name and the type
Definition: Property.h:118
Property()
Construct an anonymous property with default constructed value.
Definition: Property.h:484
T move(T...args)
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:587
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<IProperty, OWNER>::value>>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER *  owner,
std::string  name,
T &&  value,
void(OWNER::*)()  handler,
std::string  doc = "" 
)
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 457 of file Property.h.

458  : Property( owner, std::move( name ), std::forward<T>( value ),
459  [owner, handler]( PropertyBase& ) { ( owner->*handler )(); }, std::move( doc ) )
460  {
461  }
PropertyBase(const std::type_info &type, std::string name="", std::string doc="")
constructor from the property name and the type
Definition: Property.h:118
Property()
Construct an anonymous property with default constructed value.
Definition: Property.h:484
T move(T...args)
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:587
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<IProperty, OWNER>::value>>
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 = "" 
)
inline

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

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

Definition at line 466 of file Property.h.

468  : Property( owner, std::move( name ), std::forward<T>( value ), std::move( handler ), std::move( doc ) )
469  {
470  if ( invoke ) useUpdateHandler();
471  }
bool useUpdateHandler() override
manual trigger for callback for update
Definition: Property.h:524
Property()
Construct an anonymous property with default constructed value.
Definition: Property.h:484
T move(T...args)
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:587
auto invoke(F &&f, ArgTypes &&...args) noexcept(noexcept(detail2::INVOKE(std::forward< F >(f), std::forward< ArgTypes >(args)...))) -> decltype(detail2::INVOKE(std::forward< F >(f), std::forward< ArgTypes >(args)...))
Definition: invoke.h:93
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 477 of file Property.h.

477  : Details::PropertyBase( typeid( ValueType ), "", "" ), m_value( std::forward<T>( v ) )
478  {
479  }
StorageType m_value
Storage.
Definition: Property.h:396
typename std::remove_reference< StorageType >::type ValueType
Definition: Property.h:389
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<T>::value>>
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 484 of file Property.h.

484  : Details::PropertyBase( typeid( ValueType ), "", "" ), m_value()
485  {
486  }
StorageType m_value
Storage.
Definition: Property.h:396
typename std::remove_reference< StorageType >::type ValueType
Definition: Property.h:389

Member Function Documentation

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

764  {
765  // Check if the property of is of "the same" type, except for strings
766  const Property* p =
767  ( std::is_same<ValueType, std::string>::value ) ? nullptr : dynamic_cast<const Property*>( &source );
768  if ( p ) {
769  *this = p->value();
770  } else {
771  this->fromString( source.toString() ).ignore();
772  }
773  return true;
774  }
Gaudi::Details::PropertyBase Property
backward compatibility hack for old Property base class
Definition: PropertyFwd.h:28
StatusCode fromString(const std::string &source) override
string -> value
Definition: Property.h:782
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 599 of file Property.h.

599 { return new Property( *this ); }
Property()
Construct an anonymous property with default constructed value.
Definition: Property.h:484
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 500 of file Property.h.

501  {
502  m_handlers.setReadHandler( std::move( fun ) );
503  return *this;
504  }
HandlersType m_handlers
Definition: Property.h:398
T move(T...args)
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 506 of file Property.h.

507  {
508  m_handlers.setUpdateHandler( std::move( fun ) );
509  return *this;
510  }
HandlersType m_handlers
Definition: Property.h:398
T move(T...args)
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 782 of file Property.h.

783  {
784  using Converter = Details::Property::StringConverter<ValueType>;
785  *this = Converter().fromString( m_value, source );
786  return StatusCode::SUCCESS;
787  }
StorageType m_value
Storage.
Definition: Property.h:396
Converter base class.
Definition: Converter.h:24
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
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 776 of file Property.h.

777  {
778  // delegate to the 'opposite' method
779  return dest.assign( *this );
780  }
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 531 of file Property.h.

532  {
533  m_handlers.useReadHandler( *this );
534  return m_value;
535  }
HandlersType m_handlers
Definition: Property.h:398
StorageType m_value
Storage.
Definition: Property.h:396
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 551 of file Property.h.

552  {
553  return m_value != other;
554  }
StorageType m_value
Storage.
Definition: Property.h:396
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 755 of file Property.h.

757  {
758  return value()( std::forward<Args>( args )... );
759  }
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:587
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 671 of file Property.h.

672  {
673  ++value();
674  return *this;
675  }
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:587
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 677 of file Property.h.

678  {
679  return m_value++;
680  }
StorageType m_value
Storage.
Definition: Property.h:396
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 693 of file Property.h.

694  {
695  m_value += other;
696  return *this;
697  }
StorageType m_value
Storage.
Definition: Property.h:396
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 682 of file Property.h.

683  {
684  --value();
685  return *this;
686  }
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:587
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 688 of file Property.h.

689  {
690  return m_value--;
691  }
StorageType m_value
Storage.
Definition: Property.h:396
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 699 of file Property.h.

700  {
701  m_value -= other;
702  return *this;
703  }
StorageType m_value
Storage.
Definition: Property.h:396
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 558 of file Property.h.

559  {
560  return m_value < other;
561  }
StorageType m_value
Storage.
Definition: Property.h:396
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 572 of file Property.h.

573  {
574  m_verifier( v );
575  m_value = std::forward<T>( v );
576  m_handlers.useUpdateHandler( *this );
577  return *this;
578  }
HandlersType m_handlers
Definition: Property.h:398
StorageType m_value
Storage.
Definition: Property.h:396
VerifierType m_verifier
Definition: Property.h:397
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 544 of file Property.h.

545  {
546  return m_value == other;
547  }
StorageType m_value
Storage.
Definition: Property.h:396
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 513 of file Property.h.

514  {
515  return m_handlers.getReadHandler();
516  }
HandlersType m_handlers
Definition: Property.h:398
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 594 of file Property.h.

595  {
596  *this = v;
597  return true;
598  }
template<class TYPE, class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
template<class OWNER , typename = std::enable_if_t<std::is_base_of<IProperty, OWNER>::value>>
void Gaudi::Property< TYPE, VERIFIER, HANDLERS >::setOwner ( OWNER *  owner)
inline

Set the owner of this property.

Definition at line 493 of file Property.h.

494  {
495  owner->declareProperty( *this );
496  setOwnerType<OWNER>();
497  }
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 589 of file Property.h.

590  {
591  *this = v;
592  return true;
593  }
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 795 of file Property.h.

796  {
797  m_handlers.useReadHandler( *this );
798  using Utils::toStream;
799  toStream( m_value, out );
800  }
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:303
HandlersType m_handlers
Definition: Property.h:398
StorageType m_value
Storage.
Definition: Property.h:396
void toStream(std::ostream &out) const override
value -> stream
Definition: Property.h:795
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 789 of file Property.h.

790  {
791  using Converter = Details::Property::StringConverter<ValueType>;
792  return Converter().toString( *this );
793  }
Converter base class.
Definition: Converter.h:24
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 518 of file Property.h.

519  {
520  return m_handlers.getUpdateHandler();
521  }
HandlersType m_handlers
Definition: Property.h:398
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 524 of file Property.h.

525  {
526  m_handlers.useUpdateHandler( *this );
527  return true;
528  }
HandlersType m_handlers
Definition: Property.h:398
template<class TYPE, class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
const ValueType& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::value ( ) const
inline

Backward compatibility (.

Deprecated:
will be removed)

Definition at line 587 of file Property.h.

587 { return *this; }
template<class TYPE, class VERIFIER = Details::Property::NullVerifier, class HANDLERS = Details::Property::UpdateHandler>
ValueType& Gaudi::Property< TYPE, VERIFIER, HANDLERS >::value ( )
inline

Definition at line 588 of file Property.h.

588 { return const_cast<ValueType&>( (const ValueType&)*this ); }
typename std::remove_reference< StorageType >::type ValueType
Definition: Property.h:389
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 581 of file Property.h.

581 { return m_verifier; }
VerifierType m_verifier
Definition: Property.h:397
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 583 of file Property.h.

583 { return m_verifier; }
VerifierType m_verifier
Definition: Property.h:397

Member Data Documentation

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

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

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


The documentation for this class was generated from the following file: