Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
20 #include <unordered_set>
35 #include <boost/algorithm/string/compare.hpp>
54 return **( all_strings.insert( std::make_unique<std::string>(
std::move( str ) ) ).first );
136 if (
s.size() > 1 && (
s.front() ==
'\'' ||
s.front() ==
'\"' ) &&
s.front() ==
s.back() ) {
182 template <
typename C1,
typename C2,
typename BinaryPredicate>
183 bool equal_(
const C1&
c1,
const C2&
c2, BinaryPredicate&& p ) {
188 template <
typename String>
191 return p && equal_(
name, p->name(), boost::algorithm::is_iequal{} );
216 if ( !p ) {
return nullptr; }
221 return ifound !=
props.end() ? *ifound :
nullptr;
244 if ( !p ) {
return nullptr; }
247 if ( !_i ) {
return nullptr; }
304 if ( !p ) {
return nullptr; }
306 return p->
end() != ifound ? *ifound :
nullptr;
346 if ( !doc.
empty() ) {
510 return m_property ? ( ( m_property->type_info() == &
typeid(
std::string ) ) ?
toString( m_property->toString() )
511 : m_property->toString() )
517 #ifndef GAUDI_PROPERTY_PARSING_ERROR_DEFAULT_POLICY
518 # define GAUDI_PROPERTY_PARSING_ERROR_DEFAULT_POLICY Exception
524 auto tmp = g_parsingErrorPolicy;
525 g_parsingErrorPolicy = p;
531 struct InitParsingErrorPolicy {
532 InitParsingErrorPolicy() {
536 if (
System::getEnv(
"GAUDI_PROPERTY_PARSING_ERROR_DEFAULT_POLICY", policy ) ) {
537 switch ( policy[0] ) {
555 } initParsingErrorPolicy;
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
std::string toString() const override
value -> string
const std::string name() const
property name
#define GAUDI_PROPERTY_PARSING_ERROR_DEFAULT_POLICY
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
GaudiHandleBase * m_pValue
Pointer to the real property.
GaudiHandleProperty(std::string name, GaudiHandleBase &ref)
const GaudiHandleArrayBase & value() const
bool setValue(const GaudiHandleArrayBase &value)
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
std::string toString() const override
value -> string
bool setValue(const GaudiHandleBase &value)
void setDocumentation(std::string value)
set the documentation string
virtual std::ostream & fillStream(std::ostream &) const
the printout of the property value
GaudiHandleArrayProperty(std::string name, GaudiHandleArrayBase &ref)
double * begin(CLHEP::HepVector &v)
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
GAUDI_API Gaudi::Details::PropertyBase * getProperty(const IProperty *p, std::string_view name)
simple function which gets the property with given name from the component
virtual bool hasProperty(std::string_view name) const =0
Return true if we have a property with the given name.
std::string typeAndName() const
The full type and name: "type/name".
void toStream(std::ostream &out) const override
value -> stream
const GaudiHandleBase & value() const
ParsingErrorPolicy parsingErrorPolicy()
virtual bool assign(const PropertyBase &source)=0
import the property value form the source
Base class of array's of various gaudihandles.
ParsingErrorPolicy setParsingErrorPolicy(ParsingErrorPolicy p)
StatusCode fromString(const std::string &s) override
string -> value
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
bool setTypesAndNames(const std::vector< std::string > &myTypesAndNamesList)
Set the array of handles from list of "type/name" strings in <myTypesAndNamesList>.
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Helper class to simplify the migration old properties deriving directly from PropertyBase.
constexpr static const auto SUCCESS
virtual const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const =0
Get list of properties.
virtual std::string toString() const =0
value -> string
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
bool useUpdateHandler() override
use the call-back function at update, if available
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
StatusCode fromString(const std::string &s) override
string -> value
const std::vector< std::string > typesAndNames() const
Return a vector with "type/name" strings of all handles in the array.
constexpr static const auto FAILURE
const char *PyHelper() getProperty(IInterface *p, char *name)
void setPropertyName(std::string propName)
set name as used in declareProperty(name,gaudiHandle).
GaudiHandleArrayBase * m_pValue
Pointer to the real property.
void useReadHandler() const
use the call-back function at reading, if available
void toStream(std::ostream &out) const override
value -> stream
GAUDI_API bool hasProperty(const IProperty *p, std::string_view name)
simple function which check the existence of the property with the given name.
virtual StatusCode setPropertyRepr(const std::string &n, const std::string &r)=0
Set the property by name and value representation.
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.