1 #ifndef GAUDIKERNEL_GAUDIHANDLE_H
2 #define GAUDIKERNEL_GAUDIHANDLE_H
24 GaudiHandleInfo(
const std::string& myComponentType,
const std::string& myParentName )
25 : m_componentType(myComponentType), m_parentName(myParentName)
34 return m_componentType;
39 return m_propertyName;
44 m_propertyName = propName;
55 virtual const std::string pythonPropertyClassName()
const = 0;
61 virtual const std::string pythonRepr()
const = 0;
96 GaudiHandleBase(
const std::string& myTypeAndName,
const std::string& myComponentType,
97 const std::string& myParentName )
100 setTypeAndName(myTypeAndName);
108 return m_typeAndName;
112 std::string
type()
const;
115 std::string name()
const;
119 return m_typeAndName.empty();
123 void setTypeAndName(
const std::string& myTypeAndName );
126 void setName(
const std::string& myName );
134 const std::string messageName()
const;
163 GaudiHandle(
const std::string& myTypeAndName,
const std::string& myComponentType,
164 const std::string& myParentName )
165 :
GaudiHandleBase(myTypeAndName, myComponentType, myParentName), m_pObject(0)
173 if ( m_pObject ) m_pObject->addRef();
178 GaudiHandleBase::operator=( other );
183 if ( m_pObject ) m_pObject->addRef();
190 if ( retrieve( m_pObject ).isFailure() ) {
209 operator bool()
const {
240 if ( defName.empty() ) defName = getDefaultType();
258 const std::string& myType = getDefaultType();
269 return m_pObject || retrieve().isSuccess();
275 if ( !getObject() ) {
304 bool setTypesAndNames(
const std::vector< std::string >& myTypesAndNamesList );
308 const std::vector< std::string > typesAndNames()
const;
311 const std::vector< std::string > types()
const;
314 const std::vector< std::string >
names()
const;
318 const std::vector< std::string > getBaseInfos( std::string (
GaudiHandleBase::*pMemFunc)()
const )
const;
333 virtual bool push_back(
const std::string& myHandleTypeAndName ) = 0;
336 virtual void clear() = 0;
339 virtual bool empty()
const = 0;
377 const std::string& myComponentType,
const std::string& myParentName )
403 for ( ; it != itEnd; ++it ) baseArray.push_back( &*it );
410 for ( ; it != itEnd; ++it ) baseArray.push_back( &*it );
418 return m_handleArray.begin();
422 return m_handleArray.end();
426 return m_handleArray.begin();
430 return m_handleArray.end();
434 return m_handleArray.rbegin();
438 return m_handleArray.rend();
442 return m_handleArray.size();
446 m_handleArray.clear();
450 return m_handleArray.empty();
454 return m_handleArray[index];
458 return m_handleArray[index];
464 for ( ; it != itEnd; ++it ) {
465 if ( it->name() == name )
return &*it;
474 for ( ; it != itEnd; ++it ) {
475 if ( it->name() == name )
return &*it;
485 m_handleArray.push_back( myHandle );
492 for ( ; it != itEnd; ++it ) {
493 if ( it->retrieve().isFailure() ) {
505 for ( ; it != itEnd; ++it ) {
506 if ( it->release().isFailure() ) {
525 #endif // ! GAUDIKERNEL_GAUDIHANDLE_H