|
Gaudi Framework, version v23r2 |
| Home | Generated: Thu Jun 28 2012 |
#include <SvcCatalog.h>

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 PropertiesT * | getProperties (const std::string &client) const |
| std::vector< std::string > | getClients () const |
| std::ostream & | fillStream (std::ostream &o) const |
| dump the content of catalog to std::ostream | |
Private Member Functions | |
| PropertiesT * | findProperties (const std::string &client) const |
| bool | findProperty (PropertiesT *props, const std::string &name, PropertiesT::iterator &result) |
Private Attributes | |
| ObjectsT * | m_catalog |
Definition at line 28 of file SvcCatalog.h.
| typedef std::map<std::string, PropertiesT > SvcCatalog::ObjectsT |
Definition at line 32 of file SvcCatalog.h.
| typedef std::vector<const Property*> SvcCatalog::PropertiesT |
Definition at line 31 of file SvcCatalog.h.
| SvcCatalog::SvcCatalog | ( | ) |
Definition at line 20 of file SvcCatalog.cpp.
| SvcCatalog::~SvcCatalog | ( | ) | [virtual] |
Definition at line 23 of file SvcCatalog.cpp.
{
for (ObjectsT::const_iterator cur=m_catalog->begin();
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;
}
| 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);
m_catalog->insert(std::pair<std::string,PropertiesT>(client,toInsert));
}
return StatusCode::SUCCESS;
}
| 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:
for ( ObjectsT::const_iterator iclient = m_catalog->begin();
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.
{
ObjectsT::iterator result;
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.
| std::vector< std::string > SvcCatalog::getClients | ( | ) | const |
Definition at line 73 of file SvcCatalog.cpp.
{
std::vector<std::string> result;
for (ObjectsT::const_iterator cur = m_catalog->begin();
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)
{
PropertiesT::iterator toRemove;
if(findProperty(props,name,toRemove))
{
delete *toRemove;
props->erase(toRemove);
}
}
return StatusCode::SUCCESS;
}
ObjectsT* SvcCatalog::m_catalog [private] |
Definition at line 50 of file SvcCatalog.h.