The Gaudi Framework  master (29688f1e)
Loading...
Searching...
No Matches
GaudiHandleArrayProperty Class Reference

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

Inheritance diagram for GaudiHandleArrayProperty:
Collaboration diagram for GaudiHandleArrayProperty:

Public Member Functions

 GaudiHandleArrayProperty (std::string name, GaudiHandleArrayBase &ref)
GaudiHandleArrayPropertyoperator= (const GaudiHandleArrayBase &value)
GaudiHandleArrayPropertyclone () const override
 clones the current property
bool load (PropertyBase &destination) const override
bool assign (const PropertyBase &source) override
std::string toString () const override
 value -> string
void toStream (std::ostream &out) const override
 value -> stream
StatusCode fromString (const std::string &s) override
 string -> value
const GaudiHandleArrayBasevalue () const
bool setValue (const GaudiHandleArrayBase &value)
Public Member Functions inherited from PropertyWithHandlers< Handler >
PropertyBasedeclareReadHandler (std::function< void(PropertyBase &)> fun) override
 set new callback for reading
PropertyBasedeclareUpdateHandler (std::function< void(PropertyBase &)> fun) override
 set new callback for update
const std::function< void(PropertyBase &)> readCallBack () const override
 get a reference to the readCallBack
const std::function< void(PropertyBase &)> updateCallBack () const override
 get a reference to the updateCallBack
void useReadHandler () const
 use the call-back function at reading, if available
bool useUpdateHandler () override
 use the call-back function at update, if available
Public Member Functions inherited from Gaudi::Details::PropertyBase
const std::string name () const
 property name
std::string documentation () const
 property documentation
std::string semantics () const
 property semantics
const std::type_info * type_info () const
 property type-info
std::string type () const
 property type
virtual bool load (PropertyBase &dest) const =0
 export the property value to the destination
virtual bool assign (const PropertyBase &source)=0
 import the property value form the source
virtual PropertyBasedeclareReadHandler (std::function< void(PropertyBase &)> fun)=0
 set new callback for reading
virtual PropertyBasedeclareUpdateHandler (std::function< void(PropertyBase &)> fun)=0
 set new callback for update
template<class HT>
PropertyBasedeclareReadHandler (void(HT::*MF)(PropertyBase &), HT *instance)
template<class HT>
PropertyBasedeclareUpdateHandler (void(HT::*MF)(PropertyBase &), HT *instance)
virtual ~PropertyBase ()
 virtual destructor
void setName (std::string value)
 set the new value for the property name
void setDocumentation (std::string value)
 set the documentation string
void setSemantics (std::string value)
 set the semantics string
virtual std::ostream & fillStream (std::ostream &) const
 the printout of the property value
void setOwnerType (const std::type_info &ownerType)
 set the type of the owner class (used for documentation)
template<class OWNER>
void setOwnerType ()
 set the type of the owner class (used for documentation)
const std::type_info * ownerType () const
 get the type of the owner class (used for documentation)
std::string ownerTypeName () const
 get the string for the type of the owner class (used for documentation)

Private Attributes

GaudiHandleArrayBasem_pValue
 Pointer to the real property.

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
 PropertyBase (std::string name, const std::type_info &type)
 constructor from the property name and the type
 PropertyBase (const PropertyBase &)=default
 copy constructor
PropertyBaseoperator= (const PropertyBase &)=default
 assignment operator

Detailed Description

Definition at line 658 of file Property.h.

Constructor & Destructor Documentation

◆ GaudiHandleArrayProperty()

GaudiHandleArrayProperty::GaudiHandleArrayProperty ( std::string name,
GaudiHandleArrayBase & ref )

Definition at line 128 of file Property.cpp.

129 : PropertyWithHandlers( std::move( name_ ), typeid( GaudiHandleArrayBase ) ), m_pValue( &ref ) {
130 m_pValue->setPropertyName( name() );
131}
const std::string name() const
property name
GaudiHandleArrayBase * m_pValue
Pointer to the real property.
Definition Property.h:689

Member Function Documentation

◆ assign()

bool GaudiHandleArrayProperty::assign ( const PropertyBase & source)
inlineoverride

Definition at line 671 of file Property.h.

671{ return fromString( source.toString() ).isSuccess(); }
StatusCode fromString(const std::string &s) override
string -> value
Definition Property.cpp:150
virtual std::string toString() const =0
value -> string
bool isSuccess() const
Definition StatusCode.h:302

◆ clone()

GaudiHandleArrayProperty * GaudiHandleArrayProperty::clone ( ) const
inlineoverridevirtual

clones the current property

Implements Gaudi::Details::PropertyBase.

Definition at line 667 of file Property.h.

667{ return new GaudiHandleArrayProperty( *this ); }
GaudiHandleArrayProperty(std::string name, GaudiHandleArrayBase &ref)
Definition Property.cpp:128

◆ fromString()

StatusCode GaudiHandleArrayProperty::fromString ( const std::string & value)
overridevirtual

string -> value

Implements Gaudi::Details::PropertyBase.

Definition at line 150 of file Property.cpp.

150 {
151 // treat as if a Gaudi::Property<std::vector<std::string>>
152 std::vector<std::string> tmp;
153 StatusCode sc = Gaudi::Parsers::parse( tmp, source );
154 if ( sc.isFailure() ) return sc;
155 if ( !m_pValue->setTypesAndNames( std::move( tmp ) ) ) return StatusCode::FAILURE;
157 return StatusCode::SUCCESS;
158}
bool useUpdateHandler() override
use the call-back function at update, if available
Definition Property.h:608
bool isFailure() const
Definition StatusCode.h:118
constexpr static const auto SUCCESS
Definition StatusCode.h:99
constexpr static const auto FAILURE
Definition StatusCode.h:100
StatusCode parse(GaudiUtils::HashMap< K, V > &result, std::string_view input)
Basic parser for the types of HashMap used in DODBasicMapper.

◆ load()

bool GaudiHandleArrayProperty::load ( PropertyBase & destination) const
inlineoverride

Definition at line 669 of file Property.h.

669{ return destination.assign( *this ); }
virtual bool assign(const PropertyBase &source)=0
import the property value form the source

◆ operator=()

GaudiHandleArrayProperty & GaudiHandleArrayProperty::operator= ( const GaudiHandleArrayBase & value)
inline

Definition at line 662 of file Property.h.

662 {
663 setValue( value );
664 return *this;
665 }
bool setValue(const GaudiHandleArrayBase &value)
Definition Property.cpp:133
const GaudiHandleArrayBase & value() const
Definition Property.h:679

◆ setValue()

bool GaudiHandleArrayProperty::setValue ( const GaudiHandleArrayBase & value)

Definition at line 133 of file Property.cpp.

133 {
134 m_pValue->setTypesAndNames( value.typesAndNames() );
135 return useUpdateHandler();
136}

◆ toStream()

void GaudiHandleArrayProperty::toStream ( std::ostream & out) const
overridevirtual

value -> stream

Implements Gaudi::Details::PropertyBase.

Definition at line 144 of file Property.cpp.

144 {
145 // treat as if a Gaudi::Property<std::vector<std::string>>
147 Gaudi::Utils::toStream( m_pValue->typesAndNames(), out );
148}
void useReadHandler() const
use the call-back function at reading, if available
Definition Property.h:605
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:307

◆ toString()

std::string GaudiHandleArrayProperty::toString ( ) const
overridevirtual

value -> string

Implements Gaudi::Details::PropertyBase.

Definition at line 138 of file Property.cpp.

138 {
139 // treat as if a Gaudi::Property<std::vector<std::string>>
141 return Gaudi::Utils::toString( m_pValue->typesAndNames() );
142}
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition ToStream.h:329

◆ value()

const GaudiHandleArrayBase & GaudiHandleArrayProperty::value ( ) const
inline

Definition at line 679 of file Property.h.

679 {
681 return *m_pValue;
682 }

Member Data Documentation

◆ m_pValue

GaudiHandleArrayBase* GaudiHandleArrayProperty::m_pValue
private

Pointer to the real property.

Reference would be better, but ROOT does not support references yet

Definition at line 689 of file Property.h.


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