| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Public Types | Public Member Functions | Private Member Functions | Private Attributes

# JobOptionsCatalogue Class Reference

`#include <JobOptionsCatalogue.h>`

Collaboration diagram for JobOptionsCatalogue:
[legend]

List of all members.

## 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

## Detailed Description

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-13

Definition at line 28 of file JobOptionsCatalogue.h.

## Member Typedef Documentation

typedef std::map<std::string, PropertiesT > JobOptionsCatalogue::ObjectsT

Definition at line 32 of file JobOptionsCatalogue.h.

typedef std::vector<const Property*> JobOptionsCatalogue::PropertiesT

Definition at line 31 of file JobOptionsCatalogue.h.

## Constructor & Destructor Documentation

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;
    }

## Member Function Documentation

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.

    {
      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 > 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;
    }

## Member Data Documentation

ObjectsT* JobOptionsCatalogue::m_catalogue`[private]`

Definition at line 50 of file JobOptionsCatalogue.h.

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

- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r2/GaudiSvc/src/JobOptionsSvc/JobOptionsCatalogue.h
- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r2/GaudiSvc/src/JobOptionsSvc/JobOptionsCatalogue.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines