| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Private Attributes | List of all members
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS > Class Template Reference

`#include <GaudiKernel/CArrayAsProperty.h>`

Inheritance diagram for Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >:
[legend]
Collaboration diagram for Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >:
[legend]

## Public Types
using | StorageType = TYPE(&)[N]
| Hosted type. More...
using | ValueType = typename std::remove_reference< StorageType >::type
using | VerifierType = VERIFIER
using | HandlersType = HANDLERS

## Public Member Functions
| Property (std::string name, StorageType value, std::string doc="")
| the constructor with property name, value and documentation. More...
PropertyBase & | declareReadHandler (std::function< void(PropertyBase &)> fun) override
| set new callback for reading More...
PropertyBase & | declareUpdateHandler (std::function< void(PropertyBase &)> fun) override
| set new callback for update More...
const std::function< void(PropertyBase &)> | readCallBack () const override
| get a reference to the readCallBack More...
const std::function< void(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...
Property & | operator= (const ValueType &v)
| Assignment from value. More...
const VerifierType & | verifier () const
| Copy constructor. More...
VerifierType & | verifier ()
| Accessor to verifier. More...
bool | assign (const PropertyBase &source) override
| get the value from another property More...
bool | load (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 ValueType & | value () const
| Backward compatibility. More...
ValueType & | value ()
bool | setValue (const ValueType &v)
bool | set (const ValueType &v)
PropertyBase * | clone () 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.
size_t | size () const
bool | empty () const
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_info * | type_info () const
| property type-info More...
std::string | type () const
| property type More...
virtual bool | load (PropertyBase &dest) const =0
| export the property value to the destination More...
virtual bool | assign (const PropertyBase &source)=0
| import the property value form the source More...
virtual PropertyBase & | declareReadHandler (std::function< void(PropertyBase &)> fun)=0
| set new callback for reading More...
virtual PropertyBase & | declareUpdateHandler (std::function< void(PropertyBase &)> fun)=0
| set new callback for update More...
template<class HT >
PropertyBase & | declareReadHandler (void(HT::*MF)(PropertyBase &), HT *instance)
template<class HT >
PropertyBase & | declareUpdateHandler (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::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...

## Private Types
template<class T >
using | is_this_type = std::is_same< Property, typename std::remove_reference< T >::type >
| helper typedefs for SFINAE More...
template<class T >
using | not_copying = std::enable_if<!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...
PropertyBase & | operator= (const PropertyBase &)=default
| assignment operator More...

## Detailed Description

### template<class TYPE, size_t N, class VERIFIER, class HANDLERS>
class Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >

Definition at line 11 of file CArrayAsProperty.h.

## Member Typedef Documentation

template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

using Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::HandlersType = HANDLERS

Definition at line 19 of file CArrayAsProperty.h.

template<class TYPE , size_t N, class VERIFIER , class HANDLERS >
template<class T >

using Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::is_this_type = std::is_same<Property, typename std::remove_reference<T>::type>
| private

helper typedefs for SFINAE

Definition at line 29 of file CArrayAsProperty.h.

template<class TYPE , size_t N, class VERIFIER , class HANDLERS >
template<class T >

using Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::not_copying = std::enable_if<!is_this_type<T>::value>
| private

Definition at line 31 of file CArrayAsProperty.h.

template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

using Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::StorageType = TYPE ( & )[N]

Hosted type.

Definition at line 16 of file CArrayAsProperty.h.

template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

using Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::ValueType = typename std::remove_reference<StorageType>::type

Definition at line 17 of file CArrayAsProperty.h.

template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

using Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::VerifierType = VERIFIER

Definition at line 18 of file CArrayAsProperty.h.

## Constructor & Destructor Documentation

template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::Property | ( | std::string | name,
|  | StorageType | value,
|  | std::string | doc = `""`
| ) |  |
| inline

the constructor with property name, value and documentation.

Definition at line 36 of file CArrayAsProperty.h.

37 : PropertyBase( typeid( ValueType ), std::move( name ), std::move( doc ) ), m_value( value )
38 {
39 m_verifier( m_value );
40 }
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_value
StorageType m_value
Storage.
Definition: CArrayAsProperty.h:23
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::ValueType
typename std::remove_reference< StorageType >::type ValueType
Definition: CArrayAsProperty.h:17
Gaudi::Details::PropertyBase::PropertyBase
PropertyBase()=delete
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::value
const ValueType & value() const
Backward compatibility.
Definition: CArrayAsProperty.h:104
std::move
T move(T...args)
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_verifier
VerifierType m_verifier
Definition: CArrayAsProperty.h:24

## Member Function Documentation

template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

bool Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::assign | ( | const PropertyBase & | source | ) |
| inline override

get the value from another property

Definition at line 138 of file CArrayAsProperty.h.

139 {
140 // Is the property of "the same" type?
141 const Property* p = dynamic_cast<const Property*>( &source );
142 if ( p ) {
143 *this = p->value();
144 } else {
145 this->fromString( source.toString() ).ignore();
146 }
147 return true;
148 }
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::fromString
StatusCode fromString(const std::string &source) override
string -> value
Definition: CArrayAsProperty.h:156
Property
Gaudi::Details::PropertyBase Property
backward compatibility hack for old Property base class
Definition: PropertyFwd.h:28
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

PropertyBase* Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::clone | ( |  | ) | const
| inline override virtual

clones the current property

Implements Gaudi::Details::PropertyBase.

Definition at line 116 of file CArrayAsProperty.h.

116 { return new Property( *this ); }
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::Property
Property(std::string name, StorageType value, std::string doc="")
the constructor with property name, value and documentation.
Definition: CArrayAsProperty.h:36
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

PropertyBase& Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::declareReadHandler | ( | std::function< void(PropertyBase &)> | fun | ) |
| inline override

set new callback for reading

Definition at line 46 of file CArrayAsProperty.h.

47 {
48 m_handlers.setReadHandler( std::move( fun ) );
49 return *this;
50 }
std::move
T move(T...args)
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_handlers
HandlersType m_handlers
Definition: CArrayAsProperty.h:25
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

PropertyBase& Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::declareUpdateHandler | ( | std::function< void(PropertyBase &)> | fun | ) |
| inline override

set new callback for update

Definition at line 52 of file CArrayAsProperty.h.

53 {
54 m_handlers.setUpdateHandler( std::move( fun ) );
55 return *this;
56 }
std::move
T move(T...args)
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_handlers
HandlersType m_handlers
Definition: CArrayAsProperty.h:25
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

bool Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::empty | ( |  | ) | const
| inline

Definition at line 123 of file CArrayAsProperty.h.

123 { return false; }
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

StatusCode Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::fromString | ( | const std::string & | source | ) |
| inline override virtual

string -> value

Implements Gaudi::Details::PropertyBase.

Definition at line 156 of file CArrayAsProperty.h.

157 {
158 ValueType tmp;
159 if ( Parsers::parse( tmp, source ).isSuccess() ) {
160 *this = tmp;
161 } else {
162 throw std::invalid_argument( "cannot parse '" + source + "' to " + this->type() );
163 }
164 return StatusCode::SUCCESS;
165 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:11
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::ValueType
typename std::remove_reference< StorageType >::type ValueType
Definition: CArrayAsProperty.h:17
Gaudi::Details::PropertyBase::type
std::string type() const
property type
Definition: Property.h:46
std::invalid_argument
STL class.
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

bool Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::load | ( | PropertyBase & | dest | ) | const
| inline override

set value to another property

Definition at line 150 of file CArrayAsProperty.h.

151 {
152 // delegate to the 'opposite' method
153 return dest.assign( *this );
154 }
gaudirun.dest
dest
Definition: gaudirun.py:162
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::operator const ValueType & | ( |  | ) | const
| inline

Automatic conversion to value (const reference).

Definition at line 71 of file CArrayAsProperty.h.

72 {
73 m_handlers.useReadHandler( *this );
74 return m_value;
75 }
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_value
StorageType m_value
Storage.
Definition: CArrayAsProperty.h:23
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_handlers
HandlersType m_handlers
Definition: CArrayAsProperty.h:25
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

Property& Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::operator= | ( | const ValueType & | v | ) |
| inline

Assignment from value.

Definition at line 83 of file CArrayAsProperty.h.

84 {
85 m_verifier( v );
86 for ( size_t i = 0; i != N; ++i ) {
87 m_value[i] = v[i];
88 }
89 m_handlers.useUpdateHandler( *this );
90 return *this;
91 }
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_value
StorageType m_value
Storage.
Definition: CArrayAsProperty.h:23
IOTest.N
int N
Definition: IOTest.py:90
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_handlers
HandlersType m_handlers
Definition: CArrayAsProperty.h:25
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_verifier
VerifierType m_verifier
Definition: CArrayAsProperty.h:24
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

const std::function<void( PropertyBase& )> Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::readCallBack | ( |  | ) | const
| inline override virtual

get a reference to the readCallBack

Implements Gaudi::Details::PropertyBase.

Definition at line 59 of file CArrayAsProperty.h.

59 { return m_handlers.getReadHandler(); }
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_handlers
HandlersType m_handlers
Definition: CArrayAsProperty.h:25
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

bool Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::set | ( | const ValueType & | v | ) |
| inline

Definition at line 111 of file CArrayAsProperty.h.

112 {
113 *this = v;
114 return true;
115 }
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

bool Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::setValue | ( | const ValueType & | v | ) |
| inline

Definition at line 106 of file CArrayAsProperty.h.

107 {
108 *this = v;
109 return true;
110 }
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

size_t Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::size | ( |  | ) | const
| inline

Definition at line 122 of file CArrayAsProperty.h.

122 { return N; }
IOTest.N
int N
Definition: IOTest.py:90
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

void Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::toStream | ( | std::ostream & | out | ) | const
| inline override virtual

value -> stream

Implements Gaudi::Details::PropertyBase.

Definition at line 173 of file CArrayAsProperty.h.

174 {
175 m_handlers.useReadHandler( *this );
176 Utils::toStream( m_value, out );
177 }
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:315
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_value
StorageType m_value
Storage.
Definition: CArrayAsProperty.h:23
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_handlers
HandlersType m_handlers
Definition: CArrayAsProperty.h:25
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

std::string Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::toString | ( |  | ) | const
| inline override virtual

value -> string

Implements Gaudi::Details::PropertyBase.

Definition at line 167 of file CArrayAsProperty.h.

168 {
169 m_handlers.useReadHandler( *this );
170 return Utils::toString( m_value );
171 }
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_value
StorageType m_value
Storage.
Definition: CArrayAsProperty.h:23
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:367
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_handlers
HandlersType m_handlers
Definition: CArrayAsProperty.h:25
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

const std::function<void( PropertyBase& )> Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::updateCallBack | ( |  | ) | const
| inline override virtual

get a reference to the updateCallBack

Implements Gaudi::Details::PropertyBase.

Definition at line 61 of file CArrayAsProperty.h.

61 { return m_handlers.getUpdateHandler(); }
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_handlers
HandlersType m_handlers
Definition: CArrayAsProperty.h:25
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

bool Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::useUpdateHandler | ( |  | ) |
| inline override virtual

manual trigger for callback for update

Implements Gaudi::Details::PropertyBase.

Definition at line 64 of file CArrayAsProperty.h.

65 {
66 m_handlers.useUpdateHandler( *this );
67 return true;
68 }
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_handlers
HandlersType m_handlers
Definition: CArrayAsProperty.h:25
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

const ValueType& Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::value | ( |  | ) | const
| inline

Backward compatibility.

Deprecated:
  will be removed in v29r0

Definition at line 104 of file CArrayAsProperty.h.

104 { return *this; }
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

ValueType& Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::value | ( |  | ) |
| inline

Definition at line 105 of file CArrayAsProperty.h.

105 { return const_cast<ValueType&>( (const ValueType&)*this ); }
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::ValueType
typename std::remove_reference< StorageType >::type ValueType
Definition: CArrayAsProperty.h:17
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

const VerifierType& Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::verifier | ( |  | ) | const
| inline

Copy constructor.

Accessor to verifier.

Definition at line 98 of file CArrayAsProperty.h.

98 { return m_verifier; }
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_verifier
VerifierType m_verifier
Definition: CArrayAsProperty.h:24
template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

VerifierType& Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::verifier | ( |  | ) |
| inline

Accessor to verifier.

Definition at line 100 of file CArrayAsProperty.h.

100 { return m_verifier; }
Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_verifier
VerifierType m_verifier
Definition: CArrayAsProperty.h:24

## Member Data Documentation

template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

HandlersType Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_handlers
| private

Definition at line 25 of file CArrayAsProperty.h.

template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

StorageType Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_value
| private

Storage.

Definition at line 23 of file CArrayAsProperty.h.

template<class TYPE , size_t N, class VERIFIER , class HANDLERS >

VerifierType Gaudi::Property< TYPE[N], VERIFIER, HANDLERS >::m_verifier
| private

Definition at line 24 of file CArrayAsProperty.h.

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

- GaudiKernel/GaudiKernel/CArrayAsProperty.h