24 struct Nocase :
public std::binary_function<std::string,std::string,bool>
26 inline bool operator() (
const std::string& v1 ,
27 const std::string& v2 )
const
29 std::string::const_iterator i1 = v1.begin() ;
30 std::string::const_iterator i2 = v2.begin() ;
31 for ( ; v1.end() != i1 && v2.end() != i2 ; ++i1 , ++i2 )
33 return v1.size() == v2.size() ;
38 struct PropByName :
public std::unary_function<const Property*,bool>
40 PropByName (
const std::string& name ) : m_name ( name ) {} ;
41 inline bool operator() (
const Property* p )
const
42 {
return ( 0 == p ) ?
false : m_cmp ( p->
name() , m_name ) ; }
54 , m_remoteProperties ()
68 , m_properties ( right.m_properties )
69 , m_remoteProperties ( right.m_remoteProperties )
70 , m_todelete ( right.m_todelete )
71 , m_pOuter ( right.m_pOuter )
84 for ( Properties::iterator ip =
m_todelete.begin() ;
85 m_todelete.end() != ip ; ++ip ) {
delete *ip ; }
92 if ( &right ==
this ) {
return *this ; }
94 for ( Properties::iterator ip =
m_todelete.begin() ;
95 m_todelete.end() != ip ; ++ip ) {
delete *ip ; }
112 (
const std::string& name ,
114 const std::string& rname )
116 if ( 0 == rsvc ) {
return 0 ; }
117 const std::string& nam = rname.empty() ? name : rname ;
119 m_remoteProperties.push_back (
RemProperty ( name , std::make_pair ( rsvc , nam ) ) ) ;
126 (
const std::string& name ,
127 const std::vector<Property*>& props )
const
129 Properties::const_iterator it =
130 std::find_if ( props.begin() , props.end() , PropByName( name ) ) ;
131 if ( props.end() != it ) {
return *it ; }
138 (
const std::string& name )
const
141 Property* lp = property ( name , m_properties ) ;
142 if ( 0 != lp ) {
return lp ; }
145 for ( RemoteProperties::const_iterator it = m_remoteProperties.begin() ;
146 m_remoteProperties.end() != it ; ++it )
148 if ( !cmp(it->first,name) ) { continue ; }
150 if ( 0 == p ) { continue ; }
222 if ( 0 != p ) {
return *p ; }
224 throw std::out_of_range(
"Property "+name+
" not found." );
232 (
const std::string&
n ,
233 std::string& v )
const
246 const std::vector<Property*>&
253 StatusCode sc= base_class::queryInterface(iid, pinterface);
StatusCode setProperty(const Property &p)
set the property form another property
IInterface * m_pOuter
Interface hub reference (ApplicationMgr)
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.
virtual std::string toString() const =0
value -> string
const std::string & name() const
property name
bool isSuccess() const
Test for a status code of SUCCESS.
Properties m_todelete
Properties to be deleted.
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
virtual bool load(Property &dest) const =0
export the property value to the destination
Property manager helper class.
bool isFailure() const
Test for a status code of FAILURE.
PropertyMgr(IInterface *iface=0)
constructor from the interface
StatusCode queryInterface(const InterfaceID &iid, void **pinterface)
Set the void** to the pointer to the requested interface of the instance.
Gaudi::InterfaceId< IInterface, 0, 0 > iid
Interface ID.
Base class used to implement the interfaces.
Properties m_properties
Collection of all declared properties.
RemoteProperties m_remoteProperties
Collection of all declared remote properties.
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
virtual ~PropertyMgr()
virtual destructor
std::pair< std::string, std::pair< IProperty *, std::string > > RemProperty
PropertyMgr & operator=(const PropertyMgr &)
StatusCode getProperty(Property *p) const
get the property
const std::vector< Property * > & getProperties() const
get all properties
Property base class allowing Property* collections to be "homogeneous".
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
Property * declareRemoteProperty(const std::string &name, IProperty *rsvc, const std::string &rname="")
Declare a remote property.
The IProperty is the basic interface for all components which have properties that can be set or get...
virtual Property * clone() const =0
clone: "virtual constructor"
void toupper(std::string &s)
Property * property(const std::string &name) const
virtual StatusCode queryInterface(const InterfaceID &ti, void **pp)=0
Set the void** to the pointer to the requested interface of the instance.
virtual StatusCode fromString(const std::string &value)=0
string -> value