| # Gaudi Framework, version v21r10p1 |

Home |  | Generated: 29 Jul 2010

# GaudiPython::AlgDecorator Class Reference

`#include <AlgDecorators.h>`

List of all members.

## Public Types
typedef std::vector< const StatEntity * > | Counters
| the actual type of vector of counters
typedef std::vector< IAlgTool * > | Tools
typedef std::vector< IService * > | Services
## Static Public Member Functions
static IAlgTool * | tool_ (const GaudiAlgorithm *alg, const std::string &type, const std::string &name, const IInterface *parent=0, const bool create=true)
| get the tool from GaudiAlgorithm
static IAlgTool * | tool_ (const GaudiAlgorithm *alg, const std::string &typeAndName, const IInterface *parent=0, const bool create=true)
| get the tool from GaudiAlgorithm
static IInterface * | svc_ (const GaudiAlgorithm *alg, const std::string &name, const bool create=false)
| get the service from GaudiAlgorithm
static size_t | _counters_a_ (const GaudiAlgorithm *alg, std::vector< std::string > &names, Counters &out)
static size_t | _counters_t_ (const GaudiTool *alg, std::vector< std::string > &names, Counters &out)
static size_t | _counters_a_ (const IAlgorithm *alg, std::vector< std::string > &names, Counters &out)
static size_t | _counters_t_ (const IAlgTool *alg, std::vector< std::string > &names, Counters &out)
static const StatEntity * | _counter_a_ (const GaudiAlgorithm *alg, const std::string &name)
static const StatEntity * | _counter_t_ (const GaudiTool *alg, const std::string &name)
static const StatEntity * | _counter_a_ (const IAlgorithm *alg, const std::string &name)
static const StatEntity * | _counter_t_ (const IAlgTool *alg, const std::string &name)
static size_t | _tools_a_ (const GaudiAlgorithm *, Tools &tools)
static size_t | _tools_t_ (const GaudiTool *, Tools &tools)
static size_t | _tools_a_ (const IAlgorithm *, Tools &tools)
static size_t | _tools_t_ (const IAlgTool *, Tools &tools)

## Detailed Description

Definition at line 46 of file AlgDecorators.h.

## Member Typedef Documentation

typedef std::vector<const StatEntity*> GaudiPython::AlgDecorator::Counters

the actual type of vector of counters

Definition at line 51 of file AlgDecorators.h.

typedef std::vector<IAlgTool*> GaudiPython::AlgDecorator::Tools

Definition at line 52 of file AlgDecorators.h.

typedef std::vector<IService*> GaudiPython::AlgDecorator::Services

Definition at line 53 of file AlgDecorators.h.

## Member Function Documentation

IAlgTool * GaudiPython::AlgDecorator::tool_ | ( | const GaudiAlgorithm * | alg,
|  | const std::string & | type,
|  | const std::string & | name,
|  | const IInterface * | parent = `0`,
|  | const bool | create = `true` |
| ) |  |  | `[static]`

get the tool from GaudiAlgorithm

Parameters:

  | alg | GaudiAlgorithm
  | type | tool type
  | name | tool name
  | parent | tool parent
  | create | flag to create

Returns:
  the tool

Definition at line 38 of file AlgDecorators.cpp.

    00043 {
    00044   if ( 0 == alg ) { return 0 ; }
    00045   return alg -> tool<IAlgTool> ( type , name , parent , create ) ;
    00046 }

IAlgTool * GaudiPython::AlgDecorator::tool_ | ( | const GaudiAlgorithm * | alg,
|  | const std::string & | typeAndName,
|  | const IInterface * | parent = `0`,
|  | const bool | create = `true` |
| ) |  |  | `[static]`

get the tool from GaudiAlgorithm

Parameters:

  | alg | GaudiAlgorithm
  | typeAndName | tool type/name
  | parent | tool parent
  | create | flag to create

Returns:
  the tool

Definition at line 57 of file AlgDecorators.cpp.

    00061 {
    00062   if ( 0 == alg ) { return 0 ; }
    00063   return alg->tool<IAlgTool>( typeAndName , parent , create ) ;
    00064 }

IInterface * GaudiPython::AlgDecorator::svc_ | ( | const GaudiAlgorithm * | alg,
|  | const std::string & | name,
|  | const bool | create = `false` |
| ) |  |  | `[static]`

get the service from GaudiAlgorithm

Parameters:

  | alg | GaudiAlgorithm
  | name | service name
  | create | flag to create

Returns:
  the tool

Definition at line 74 of file AlgDecorators.cpp.

    00077 {
    00078   if ( 0 == alg ) { return 0 ; }
    00079   return alg -> svc<IInterface> ( name , create ) ;
    00080 }

size_t GaudiPython::AlgDecorator::_counters_a_ | ( | const GaudiAlgorithm * | alg,
|  | std::vector< std::string > & | names,
|  | Counters & | out |
| ) |  |  | `[static]`

Definition at line 85 of file AlgDecorators.cpp.

    00088 {
    00089   typedef std::map<std::string,StatEntity> Stats ;
    00090   names.clear () ;
    00091   out.clear   () ;
    00092   if ( 0 == alg ) { return 0 ; }                                      // RETURN
    00093   //
    00094   const Stats& counters = alg->counters() ;
    00095   for ( Stats::const_iterator icnt = counters.begin() ;
    00096         counters.end() != icnt ; ++icnt )
    00097   {
    00098     names.push_back (   icnt->first )   ;
    00099     out  .push_back ( &(icnt->second) ) ;
    00100   }
    00101   return out.size() ;
    00102 }

size_t GaudiPython::AlgDecorator::_counters_t_ | ( | const GaudiTool * | alg,
|  | std::vector< std::string > & | names,
|  | Counters & | out |
| ) |  |  | `[static]`

Definition at line 107 of file AlgDecorators.cpp.

    00110 {
    00111   typedef std::map<std::string,StatEntity> Stats ;
    00112   names.clear () ;
    00113   out.clear   () ;
    00114   if ( 0 == alg ) { return 0 ; }                                      // RETURN
    00115   //
    00116   const Stats& counters = alg->counters() ;
    00117   for ( Stats::const_iterator icnt = counters.begin() ;
    00118         counters.end() != icnt ; ++icnt )
    00119   {
    00120     names.push_back (   icnt->first )   ;
    00121     out  .push_back ( &(icnt->second) ) ;
    00122   }
    00123   return out.size() ;
    00124 }

size_t GaudiPython::AlgDecorator::_counters_a_ | ( | const IAlgorithm * | alg,
|  | std::vector< std::string > & | names,
|  | Counters & | out |
| ) |  |  | `[static]`

Definition at line 129 of file AlgDecorators.cpp.

    00132 {
    00133   names.clear () ;
    00134   out.clear   () ;
    00135   if ( 0 == alg ) { return 0 ; }                                      // RETURN
    00136   //
    00137   return _counters_a_ ( dynamic_cast<const GaudiAlgorithm*>( alg ) , names , out ) ;
    00138 }

size_t GaudiPython::AlgDecorator::_counters_t_ | ( | const IAlgTool * | alg,
|  | std::vector< std::string > & | names,
|  | Counters & | out |
| ) |  |  | `[static]`

Definition at line 143 of file AlgDecorators.cpp.

    00146 {
    00147   names.clear () ;
    00148   out.clear   () ;
    00149   if ( 0 == alg ) { return 0 ; }                                      // RETURN
    00150   //
    00151   return _counters_t_ ( dynamic_cast<const GaudiTool*>( alg ) , names , out ) ;
    00152 }

const StatEntity * GaudiPython::AlgDecorator::_counter_a_ | ( | const GaudiAlgorithm * | alg,
|  | const std::string & | name |
| ) |  |  | `[static]`

Definition at line 157 of file AlgDecorators.cpp.

    00158 {
    00159   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
    00160   return &( cmp -> counter ( name ) ) ;                               // RETURN
    00161 }

const StatEntity * GaudiPython::AlgDecorator::_counter_t_ | ( | const GaudiTool * | alg,
|  | const std::string & | name |
| ) |  |  | `[static]`

Definition at line 166 of file AlgDecorators.cpp.

    00167 {
    00168   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
    00169   return &( cmp -> counter ( name ) ) ;                               // RETURN
    00170 }

const StatEntity * GaudiPython::AlgDecorator::_counter_a_ | ( | const IAlgorithm * | alg,
|  | const std::string & | name |
| ) |  |  | `[static]`

Definition at line 175 of file AlgDecorators.cpp.

    00176 {
    00177   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
    00178   return _counter_a_ ( dynamic_cast<const GaudiAlgorithm*>( cmp ) , name ) ;
    00179 }

const StatEntity * GaudiPython::AlgDecorator::_counter_t_ | ( | const IAlgTool * | alg,
|  | const std::string & | name |
| ) |  |  | `[static]`

Definition at line 184 of file AlgDecorators.cpp.

    00185 {
    00186   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
    00187   return _counter_t_ ( dynamic_cast<const GaudiTool*>( cmp ) , name ) ;
    00188 }

size_t GaudiPython::AlgDecorator::_tools_a_ | ( | const GaudiAlgorithm * | cmp,
|  | Tools & | tools |
| ) |  |  | `[static]`

Definition at line 193 of file AlgDecorators.cpp.

    00194 {
    00195   tools.clear() ;
    00196   if ( 0 == cmp ) { return 0 ; }                                      // REUTRN
    00197   tools = cmp->tools() ;
    00198   return tools.size() ;                                               // RETURN
    00199 }

size_t GaudiPython::AlgDecorator::_tools_t_ | ( | const GaudiTool * | cmp,
|  | Tools & | tools |
| ) |  |  | `[static]`

Definition at line 204 of file AlgDecorators.cpp.

    00205 {
    00206   tools.clear() ;
    00207   if ( 0 == cmp ) { return 0 ; }                                      // REUTRN
    00208   tools = cmp->tools() ;
    00209   return tools.size() ;                                               // RETURN
    00210 }

size_t GaudiPython::AlgDecorator::_tools_a_ | ( | const IAlgorithm * | cmp,
|  | Tools & | tools |
| ) |  |  | `[static]`

Definition at line 215 of file AlgDecorators.cpp.

    00216 {
    00217   tools.clear() ;
    00218   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
    00219   return _tools_a_ ( dynamic_cast<const GaudiAlgorithm*> ( cmp ) , tools ) ;
    00220 }

size_t GaudiPython::AlgDecorator::_tools_t_ | ( | const IAlgTool * | cmp,
|  | Tools & | tools |
| ) |  |  | `[static]`

Definition at line 225 of file AlgDecorators.cpp.

    00226 {
    00227   tools.clear() ;
    00228   if ( 0 == cmp ) { return 0 ; }                                      // RETURN
    00229   return _tools_t_ ( dynamic_cast<const GaudiTool*> ( cmp ) , tools ) ;
    00230 }

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r10p1/GaudiPython/GaudiPython/AlgDecorators.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r10p1/GaudiPython/src/Lib/AlgDecorators.cpp