Gaudi Framework, version v23r6

Home   Generated: Wed Jan 30 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
SvcCatalog Class Reference

#include <SvcCatalog.h>

Collaboration diagram for SvcCatalog:
Collaboration graph
[legend]

Public Types

typedef std::vector< const
Property * > 
PropertiesT
 
typedef std::map< std::string,
PropertiesT
ObjectsT
 

Public Member Functions

 SvcCatalog ()
 
virtual ~SvcCatalog ()
 
StatusCode addProperty (const std::string &client, const Property *property)
 
StatusCode removeProperty (const std::string &client, const std::string &name)
 
const PropertiesTgetProperties (const std::string &client) const
 
std::vector< std::stringgetClients () const
 
std::ostreamfillStream (std::ostream &o) const
 dump the content of catalog to std::ostream
 

Private Member Functions

PropertiesTfindProperties (const std::string &client) const
 
bool findProperty (PropertiesT *props, const std::string &name, PropertiesT::iterator &result)
 

Private Attributes

ObjectsTm_catalog
 

Detailed Description

Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-13

Definition at line 28 of file SvcCatalog.h.

Member Typedef Documentation

Definition at line 32 of file SvcCatalog.h.

Definition at line 31 of file SvcCatalog.h.

Constructor & Destructor Documentation

SvcCatalog::SvcCatalog ( )

Definition at line 20 of file SvcCatalog.cpp.

{ m_catalog = new ObjectsT(); }
SvcCatalog::~SvcCatalog ( )
virtual

Definition at line 23 of file SvcCatalog.cpp.

{
cur!=m_catalog->end();cur++)
{
for(PropertiesT::const_iterator prop=cur->second.begin();
prop!=cur->second.end(); prop++)
{ if(NULL != *prop){ delete *prop; } }
}
delete m_catalog;
}

Member Function Documentation

StatusCode SvcCatalog::addProperty ( const std::string client,
const Property property 
)

Definition at line 36 of file SvcCatalog.cpp.

{
PropertiesT* props = findProperties(client);
if ( props != 0 ){
removeProperty(client,property->name()).ignore();
props->push_back(property);
}else{
PropertiesT toInsert;
toInsert.push_back(property);
}
}
std::ostream & SvcCatalog::fillStream ( std::ostream o) const

dump the content of catalog to std::ostream

Definition at line 101 of file SvcCatalog.cpp.

{
// loop over the clients:
m_catalog->end() != iclient ; ++iclient )
{
const PropertiesT& props = iclient->second ;
o << "Client '" << iclient->first << "'" << std::endl ;
for ( PropertiesT::const_iterator ip = props.begin() ;
props.end() != ip ; ++ip )
{
const Property* p = *ip ;
if ( 0 == p ) { continue ; } // CONTINUE
o << "\t" << (*p) << std::endl ;
}
}
//
return o ; // RETURN
}
SvcCatalog::PropertiesT * SvcCatalog::findProperties ( const std::string client) const
private

Definition at line 82 of file SvcCatalog.cpp.

{
if((result = m_catalog->find(client)) == m_catalog->end()){ return 0; }
return &result->second;
}
bool SvcCatalog::findProperty ( SvcCatalog::PropertiesT props,
const std::string name,
PropertiesT::iterator result 
)
private

Definition at line 90 of file SvcCatalog.cpp.

{
for(result = props->begin();result!=props->end();result++){
if(boost::to_lower_copy((*result)->name()) == boost::to_lower_copy(name))
{ return true; }
}
return false;
}
std::vector< std::string > SvcCatalog::getClients ( ) const

Definition at line 73 of file SvcCatalog.cpp.

{
cur != m_catalog->end(); cur++) { result.push_back(cur->first); }
return result;
}
const SvcCatalog::PropertiesT * SvcCatalog::getProperties ( const std::string client) const

Definition at line 71 of file SvcCatalog.cpp.

{ return findProperties(client); }
StatusCode SvcCatalog::removeProperty ( const std::string client,
const std::string name 
)

Definition at line 53 of file SvcCatalog.cpp.

{
PropertiesT* props = findProperties(client);
if (props)
{
if(findProperty(props,name,toRemove))
{
delete *toRemove;
props->erase(toRemove);
}
}
}

Member Data Documentation

ObjectsT* SvcCatalog::m_catalog
private

Definition at line 50 of file SvcCatalog.h.


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

Generated at Wed Jan 30 2013 17:13:49 for Gaudi Framework, version v23r6 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004