|
Gaudi Framework, version v22r2 |
| Home | Generated: Tue May 10 2011 |
#include <JobOptionsCatalogue.h>

Public Types | |
| typedef std::vector< const Property * > | PropertiesT |
| typedef std::map< std::string, PropertiesT > | ObjectsT |
Public Member Functions | |
| JobOptionsCatalogue () | |
| virtual | ~JobOptionsCatalogue () |
| 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 catalogue 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_catalogue |
Definition at line 28 of file JobOptionsCatalogue.h.
Definition at line 32 of file JobOptionsCatalogue.h.
| typedef std::vector<const Property*> JobOptionsCatalogue::PropertiesT |
Definition at line 31 of file JobOptionsCatalogue.h.
| JobOptionsCatalogue::JobOptionsCatalogue | ( | ) |
Definition at line 21 of file JobOptionsCatalogue.cpp.
{ m_catalogue = new ObjectsT(); }
| JobOptionsCatalogue::~JobOptionsCatalogue | ( | ) | [virtual] |
Definition at line 24 of file JobOptionsCatalogue.cpp.
{
for (ObjectsT::const_iterator cur=m_catalogue->begin();
cur!=m_catalogue->end();cur++)
{
for(PropertiesT::const_iterator prop=cur->second.begin();
prop!=cur->second.end(); prop++)
{ if(NULL != *prop){ delete *prop; } }
}
delete m_catalogue;
}
| StatusCode JobOptionsCatalogue::addProperty | ( | const std::string & | client, |
| const Property * | property | ||
| ) |
Definition at line 37 of file JobOptionsCatalogue.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_catalogue->insert(std::pair<std::string,PropertiesT>(client,toInsert));
}
return StatusCode::SUCCESS;
}
| std::ostream & JobOptionsCatalogue::fillStream | ( | std::ostream & | o ) | const |
dump the content of catalogue to std::ostream
Definition at line 102 of file JobOptionsCatalogue.cpp.
{
// loop over the clients:
for ( ObjectsT::const_iterator iclient = m_catalogue->begin();
m_catalogue->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
}
| JobOptionsCatalogue::PropertiesT * JobOptionsCatalogue::findProperties | ( | const std::string & | client ) | const [private] |
Definition at line 83 of file JobOptionsCatalogue.cpp.
{
ObjectsT::iterator result;
if((result = m_catalogue->find(client))==m_catalogue->end()){ return 0; }
return &result->second;
}
| bool JobOptionsCatalogue::findProperty | ( | JobOptionsCatalogue::PropertiesT * | props, |
| const std::string & | name, | ||
| PropertiesT::iterator & | result | ||
| ) | [private] |
Definition at line 91 of file JobOptionsCatalogue.cpp.
| std::vector< std::string > JobOptionsCatalogue::getClients | ( | ) | const |
Definition at line 74 of file JobOptionsCatalogue.cpp.
{
std::vector<std::string> result;
for (ObjectsT::const_iterator cur = m_catalogue->begin();
cur != m_catalogue->end(); cur++) { result.push_back(cur->first); }
return result;
}
| const JobOptionsCatalogue::PropertiesT * JobOptionsCatalogue::getProperties | ( | const std::string & | client ) | const |
Definition at line 72 of file JobOptionsCatalogue.cpp.
{ return findProperties(client); }
| StatusCode JobOptionsCatalogue::removeProperty | ( | const std::string & | client, |
| const std::string & | name | ||
| ) |
Definition at line 54 of file JobOptionsCatalogue.cpp.
{
PropertiesT* props = findProperties(client);
if (props)
{
PropertiesT::iterator toRemove;
if(findProperty(props,name,toRemove))
{
delete *toRemove;
props->erase(toRemove);
}
}
return StatusCode::SUCCESS;
}
ObjectsT* JobOptionsCatalogue::m_catalogue [private] |
Definition at line 50 of file JobOptionsCatalogue.h.