22 #include "boost/algorithm/string/compare.hpp"
45 , m_documentation ( m_name )
46 , m_typeinfo ( &type )
58 , m_documentation ( m_name )
59 , m_typeinfo ( &type )
86 theCallBack( const_cast<Property&>(*
this) ) ;
100 theCallBack( *
this ) ;
112 {
return stream <<
" '" <<
name() <<
"':" <<
toString() ; }
173 m_pValue->setPropertyName(
name() );
237 template <
typename C,
typename BinaryPredicate>
238 bool equal_(
const C&
c1,
const C&
c2, BinaryPredicate&& p) {
239 return c1.size() == c2.size() &&
241 std::forward<BinaryPredicate>(p) );
248 is_iByName (
const std::string& name ) : m_name ( name ) {}
250 bool operator () (
const Property* p )
const
252 return p && equal_(m_name,p->
name(),boost::algorithm::is_iequal{});
282 if ( !p ) {
return nullptr ; }
286 auto ifound =
std::find_if ( props.begin(), props.end(), is_iByName{ name } );
287 return ifound != props.end() ? *ifound :
nullptr;
312 if ( !p ) {
return nullptr ; }
315 if ( !_i ) {
return nullptr ; }
317 return property ?
getProperty ( property , name ) :
nullptr;
379 if ( !p ) {
return nullptr ; }
381 return p->
end() != ifound ? *ifound : nullptr ;
432 if ( p ) { p -> setDocumentation ( doc ) ; }
500 {
return setProperty ( component , name , &property , doc ) ; }
523 return property ?
setProperty ( property , name , value , doc )
580 return setProperty ( prop , name , property , doc ) ;
610 {
return setProperty ( component , name , &property , doc ) ; }
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
virtual void useReadHandler() const
use the call-back function at reading
bool setValue(const GaudiHandleArrayBase &value)
virtual bool assign(const Property &source)=0
import the property value form the source
virtual const std::vector< Property * > & getProperties() const =0
Get list of properties.
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.
virtual std::string toString() const =0
value -> string
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
const std::string & name() const
property name
StatusCode fromString(const std::string &s) override
string -> value
GAUDI_API bool hasProperty(const IProperty *p, const std::string &name)
simple function which check the existence of the property with the given name.
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
void setDocumentation(std::string documentation)
set the documentation string
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
GAUDI_API Property * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
const char *PyHelper() getProperty(IInterface *p, char *name)
bool isFailure() const
Test for a status code of FAILURE.
virtual std::ostream & fillStream(std::ostream &) const
the printout of the property value
void toStream(std::ostream &out) const override
value -> stream
virtual Property & declareReadHandler(std::function< void(Property &)> fun)
set new callback for reading
GaudiHandleBase * m_pValue
Pointer to the real property.
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
GaudiHandleProperty(std::string name, GaudiHandleBase &ref)
bool setTypesAndNames(const std::vector< std::string > &myTypesAndNamesList)
Set the array of handles from list of "type/name" strings in .
virtual bool useUpdateHandler()
use the call-back function at update
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
GaudiHandleArrayProperty(std::string name, GaudiHandleArrayBase &ref)
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
std::string toString() const override
value -> string
std::function< void(Property &)> m_readCallBack
StatusCode fromString(const std::string &s) override
string -> value
Base class of array's of various gaudihandles.
Property base class allowing Property* collections to be "homogeneous".
void toStream(std::ostream &out) const override
value -> stream
void setPropertyName(std::string propName)
set name as used in declareProperty(name,gaudiHandle).
GaudiHandleArrayBase * m_pValue
Pointer to the real property.
double fun(const std::vector< double > &x)
std::function< void(Property &)> m_updateCallBack
std::ostream & operator<<(std::ostream &stream, const Property &prop)
The output operator for friendly printout.
const std::vector< std::string > typesAndNames() const
Return a vector with "type/name" strings of all handles in the array.
Base class to handles to be used in lieu of naked pointers to various Gaudi components.
std::string toString() const override
value -> string
std::string typeAndName() const
The full type and name: "type/name".
The IProperty is the basic interface for all components which have properties that can be set or get...
bool setValue(const GaudiHandleBase &value)