The Gaudi Framework  v29r0 (ff2e7097)
DataObjIDProperty Class Reference

DataObjIDProperty.h GaudiKernel/DataObjProperty.h. More...

#include <GaudiKernel/DataObjIDProperty.h>

Inheritance diagram for DataObjIDProperty:
Collaboration diagram for DataObjIDProperty:

Public Member Functions

 DataObjIDProperty (const std::string &name, DataObjID &ref)
 
DataObjIDPropertyoperator= (const DataObjID &value)
 
 ~DataObjIDProperty () override
 
DataObjIDPropertyclone () const override
 clones the current property More...
 
bool load (Property &destination) const override
 
bool assign (const Property &source) override
 
std::string toString () const override
 value -> string More...
 
void toStream (std::ostream &out) const override
 value -> stream More...
 
StatusCode fromString (const std::string &s) override
 string -> value More...
 
const DataObjIDvalue () const
 
bool setValue (const DataObjID &value)
 
- Public Member Functions inherited from PropertyWithHandlers<>
PropertyBasedeclareReadHandler (std::function< void(PropertyBase &)> fun) override
 set new callback for reading More...
 
PropertyBasedeclareUpdateHandler (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...
 
void useReadHandler () const
 use the call-back function at reading, if available More...
 
bool useUpdateHandler () override
 use the call-back function at update, if available More...
 
- 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...
 
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 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 ()=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 Attributes

DataObjIDm_pValue
 Pointer to the real property. More...
 

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

DataObjIDProperty.h GaudiKernel/DataObjProperty.h.

Helper class to manage DataObjIDs and DataObjIDColls as properties

TODO: DataObjIDCollProperty implementation

Author
Charles Leggett
Date
2015-09-01

Definition at line 26 of file DataObjIDProperty.h.

Constructor & Destructor Documentation

DataObjIDProperty::DataObjIDProperty ( const std::string name,
DataObjID ref 
)

Definition at line 173 of file DataObjIDProperty.cpp.

174  : PropertyWithHandlers( name, typeid( DataObjID ) ), m_pValue( &ref )
175 {
176 }
Helper class to simplify the migration old properties deriving directly from PropertyBase.
Definition: Property.h:786
DataObjID * m_pValue
Pointer to the real property.
DataObjIDProperty::~DataObjIDProperty ( )
override

Definition at line 180 of file DataObjIDProperty.cpp.

180 {}

Member Function Documentation

bool DataObjIDProperty::assign ( const Property source)
inlineoverride

Definition at line 75 of file DataObjIDProperty.h.

76 {
77  return fromString( source.toString() ).isSuccess();
78 }
StatusCode fromString(const std::string &s) override
string -> value
DataObjIDProperty * DataObjIDProperty::clone ( ) const
inlineoverridevirtual

clones the current property

Implements Gaudi::Details::PropertyBase.

Definition at line 68 of file DataObjIDProperty.h.

68 { return new DataObjIDProperty( *this ); }
DataObjIDProperty(const std::string &name, DataObjID &ref)
StatusCode DataObjIDProperty::fromString ( const std::string value)
overridevirtual

string -> value

Implements Gaudi::Details::PropertyBase.

Definition at line 184 of file DataObjIDProperty.cpp.

185 {
186  if ( !Gaudi::Parsers::parse( *m_pValue, s ).isSuccess() ) {
187  return StatusCode::FAILURE;
188  }
190 }
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
DataObjID * m_pValue
Pointer to the real property.
bool useUpdateHandler() override
use the call-back function at update, if available
Definition: Property.h:815
string s
Definition: gaudirun.py:253
bool DataObjIDProperty::load ( Property destination) const
inlineoverride

Definition at line 70 of file DataObjIDProperty.h.

71 {
72  return destination.assign( *this );
73 }
DataObjIDProperty & DataObjIDProperty::operator= ( const DataObjID value)
inline

Definition at line 62 of file DataObjIDProperty.h.

63 {
64  setValue( value );
65  return *this;
66 }
bool setValue(const DataObjID &value)
bool DataObjIDProperty::setValue ( const DataObjID value)

Definition at line 194 of file DataObjIDProperty.cpp.

195 {
196  m_pValue->operator=( value );
197  return useUpdateHandler();
198 }
DataObjID * m_pValue
Pointer to the real property.
const DataObjID & value() const
bool useUpdateHandler() override
use the call-back function at update, if available
Definition: Property.h:815
void DataObjIDProperty::toStream ( std::ostream out) const
overridevirtual

value -> stream

Implements Gaudi::Details::PropertyBase.

Definition at line 211 of file DataObjIDProperty.cpp.

212 {
213  useReadHandler();
214  out << this->toString();
215 }
std::string toString() const override
value -> string
void useReadHandler() const
use the call-back function at reading, if available
Definition: Property.h:812
std::string DataObjIDProperty::toString ( ) const
overridevirtual

value -> string

Implements Gaudi::Details::PropertyBase.

Definition at line 202 of file DataObjIDProperty.cpp.

203 {
204  useReadHandler();
207  return o.str();
208 }
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:293
DataObjID * m_pValue
Pointer to the real property.
void useReadHandler() const
use the call-back function at reading, if available
Definition: Property.h:812
const DataObjID & DataObjIDProperty::value ( ) const
inline

Definition at line 80 of file DataObjIDProperty.h.

81 {
83  return *m_pValue;
84 }
DataObjID * m_pValue
Pointer to the real property.
void useReadHandler() const
use the call-back function at reading, if available
Definition: Property.h:812

Member Data Documentation

DataObjID* DataObjIDProperty::m_pValue
private

Pointer to the real property.

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

Definition at line 46 of file DataObjIDProperty.h.


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