| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
StatusCodeSvc Class Reference

`#include <StatusCodeSvc.h>`

Inheritance diagram for StatusCodeSvc:
[legend]
Collaboration diagram for StatusCodeSvc:
[legend]

## Classes
struct | StatCodeDat

## Public Member Functions
virtual StatusCode | initialize ()
virtual StatusCode | reinitialize ()
virtual StatusCode | finalize ()
virtual void | regFnc (const std::string &func, const std::string &lib)
virtual void | list () const
virtual bool | suppressCheck () const
| StatusCodeSvc (const std::string &name, ISvcLocator *svc)
virtual | ~StatusCodeSvc ()
Public Member Functions inherited from extends1< Service, IStatusCodeSvc >
| extends1 (A1 a1, A2 a2, A3 a3)
| Templated constructor with 3 arguments.
| extends1 (A1 a1, A2 a2)
| Templated constructor with 2 arguments.
| extends1 (A1 a1)
| Templated constructor with 1 argument.
| extends1 ()
| Default constructor.
virtual void * | i_cast (const InterfaceID &tid) const
| Implementation of IInterface::i_cast.
virtual StatusCode | queryInterface (const InterfaceID &ti, void **pp)
| Implementation of IInterface::queryInterface.
virtual std::vector< std::string > | getInterfaceNames () const
| Implementation of IInterface::getInterfaceNames.
virtual | ~extends1 ()
| Virtual destructor.
Public Member Functions inherited from Service
virtual unsigned long | release ()
| Release Interface instance.
virtual const std::string & | name () const
| Retrieve name of the service.
virtual StatusCode | configure ()
virtual StatusCode | start ()
virtual StatusCode | stop ()
virtual StatusCode | terminate ()
virtual Gaudi::StateMachine::State | FSMState () const
virtual Gaudi::StateMachine::State | targetFSMState () const
virtual StatusCode | restart ()
virtual StatusCode | sysInitialize ()
| Initialize Service.
virtual StatusCode | sysStart ()
| Initialize Service.
virtual StatusCode | sysStop ()
| Initialize Service.
virtual StatusCode | sysFinalize ()
| Finalize Service.
virtual StatusCode | sysReinitialize ()
| Re-initialize the Service.
virtual StatusCode | sysRestart ()
| Re-initialize the Service.
virtual StatusCode | setProperty (const Property &p)
virtual StatusCode | setProperty (const std::string &s)
virtual StatusCode | setProperty (const std::string &n, const std::string &v)
virtual StatusCode | getProperty (Property *p) const
virtual const Property & | getProperty (const std::string &name) const
virtual StatusCode | getProperty (const std::string &n, std::string &v) const
virtual const std::vector < Property * > & | getProperties () const
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value
| Service (const std::string &name, ISvcLocator *svcloc)
| Standard Constructor.
SmartIF< ISvcLocator > & | serviceLocator () const
| Retrieve pointer to service locator.
StatusCode | setProperties ()
| Method for setting declared properties to the values specified for the job.
template<class T >
StatusCode | service (const std::string &name, const T *&psvc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist.
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist.
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property.
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
| Declare remote named properties.
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Public Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
| CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
| Templated constructor with 3 arguments.
| CommonMessaging (const A1 &a1, const A2 &a2)
| Templated constructor with 2 arguments.
| CommonMessaging (const A1 &a1)
| Templated constructor with 1 argument.
| CommonMessaging ()
| Default constructor.
virtual | ~CommonMessaging ()
| Virtual destructor.
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service.
MsgStream & | msgStream () const
| Return an uninitialized MsgStream.
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts.
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS)
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL)
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR)
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR)
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING)
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO)
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG)
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE)
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO)
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream
Public Member Functions inherited from extend_interfaces1< IStatusCodeSvc >
virtual | ~extend_interfaces1 ()
| Virtual destructor.
Public Member Functions inherited from IStatusCodeSvc
| DeclareInterfaceID (IStatusCodeSvc, 2, 0)
| InterfaceID.
virtual | ~IStatusCodeSvc ()
| virtual destructor
Public Member Functions inherited from IService
| DeclareInterfaceID (IService, 3, 0)
| InterfaceID.
virtual StatusCode | sysInitialize ()=0
| Initialize Service.
virtual StatusCode | sysStart ()=0
| Start Service.
virtual StatusCode | sysStop ()=0
| Stop Service.
virtual StatusCode | sysFinalize ()=0
| Finalize Service.
virtual StatusCode | sysReinitialize ()=0
| Re-initialize the Service.
virtual StatusCode | sysRestart ()=0
| Re-start the Service.
virtual StatusCode | configure ()=0
| Configuration (from OFFLINE to CONFIGURED).
virtual StatusCode | start ()=0
| Start (from INITIALIZED to RUNNING).
virtual StatusCode | stop ()=0
| Stop (from RUNNING to INITIALIZED).
virtual StatusCode | terminate ()=0
| Initialization (from CONFIGURED to OFFLINE).
virtual StatusCode | restart ()=0
| Initialization (from RUNNING to RUNNING, via INITIALIZED).
virtual Gaudi::StateMachine::State | FSMState () const =0
| Get the current state.
virtual Gaudi::StateMachine::State | targetFSMState () const =0
| When we are in the middle of a transition, get the state where the transition is leading us.
virtual | ~IService ()
| virtual destructor
Public Member Functions inherited from INamedInterface
| DeclareInterfaceID (INamedInterface, 1, 0)
| InterfaceID.
virtual const std::string & | name () const =0
| Retrieve the name of the instance.
virtual | ~INamedInterface ()
| Virtual destructor (always needed for abstract classes).
Public Member Functions inherited from IInterface
virtual unsigned long | addRef ()=0
| Increment the reference count of Interface instance.
virtual unsigned long | release ()=0
| Release Interface instance.
virtual unsigned long | refCount () const =0
| Current reference count.
virtual | ~IInterface ()
| Virtual destructor.

## Private Member Functions
void | parseFilter (const std::string &str, std::string &fnc, std::string &lib)
void | filterFnc (const std::string &)
void | filterLib (const std::string &)

## Private Attributes
StringArrayProperty | m_pFilter
BooleanProperty | m_abort
BooleanProperty | m_suppress
BooleanProperty | m_dict
std::map< std::string, StatCodeDat > | m_dat
std::set< std::string > | m_filterfnc
std::set< std::string > | m_filterlib

## Additional Inherited Members
Public Types inherited from extends1< Service, IStatusCodeSvc >
typedef extends1 | base_class
| Typedef to this class.
typedef extend_interfaces1 < IStatusCodeSvc > | extend_interfaces_base
| Typedef to the base of this class.
typedef extend_interfaces_base::ext_iids | interfaces
| MPL set of all the implemented interfaces.
Static Public Member Functions inherited from IInterface
static const InterfaceID & | interfaceID ()
| Return an instance of InterfaceID identifying the interface.
Protected Member Functions inherited from Service
virtual | ~Service ()
| Standard Destructor.
int | outputLevel () const
| get the `Service's` output level
Protected Member Functions inherited from IService
virtual void | setServiceManager (ISvcManager *)=0
Protected Attributes inherited from Service
IntegerProperty | m_outputLevel
| Service output level.
Gaudi::StateMachine::State | m_state
| Service state.
Gaudi::StateMachine::State | m_targetState
| Service state.

## Detailed Description

Definition at line 12 of file StatusCodeSvc.h.

## Constructor & Destructor Documentation

StatusCodeSvc::StatusCodeSvc | ( | const std::string & | name,
|  | ISvcLocator * | svc
| ) |  |

Definition at line 17 of file StatusCodeSvc.cpp.

: base_class( name, svc )
{
declareProperty("Filter",m_pFilter);
declareProperty("AbortOnError",m_abort=false);
declareProperty("SuppressCheck", m_suppress=false);
declareProperty("IgnoreDicts",m_dict=true);
}

StatusCodeSvc::~StatusCodeSvc | ( |  | ) |
| virtual

Definition at line 30 of file StatusCodeSvc.cpp.

{
}

## Member Function Documentation

void StatusCodeSvc::filterFnc | ( | const std::string & | str | ) |
| private

Definition at line 199 of file StatusCodeSvc.cpp.

{
std::map<std::string, StatCodeDat>::iterator itr;
for (itr = m_dat.begin(); itr != m_dat.end(); ++itr ) {
if (itr->second.fnc == str) {
m_dat.erase(itr);
return;
}
}
}

void StatusCodeSvc::filterLib | ( | const std::string & | str | ) |
| private

Definition at line 214 of file StatusCodeSvc.cpp.

{
std::map<std::string, StatCodeDat>::iterator itr;
for (itr = m_dat.begin(); itr != m_dat.end(); ++itr ) {
if (itr->second.lib == str) {
m_dat.erase(itr);
return;
}
}
}

StatusCode StatusCodeSvc::finalize | ( |  | ) |
| virtual

Reimplemented from Service.

Definition at line 83 of file StatusCodeSvc.cpp.

{
if (m_dat.size() > 0) {
MsgStream log( msgSvc(), name() );
log << MSG::INFO << "listing all unchecked return codes:" << endmsg;
list();
}
return StatusCode::SUCCESS;
}

StatusCode StatusCodeSvc::initialize | ( |  | ) |
| virtual

Reimplemented from Service.

Definition at line 38 of file StatusCodeSvc.cpp.

{
StatusCode sc = Service::initialize();
if (!sc.isSuccess()) return sc;
MsgStream log( msgSvc(), name() );
log << MSG::INFO << "initialize" << endmsg;
std::vector<std::string>::const_iterator itr;
for (itr = m_pFilter.value().begin(); itr != m_pFilter.value().end(); ++itr) {
// we need to do this if someone has gotten to regFnc before initialize
string fnc,lib;
parseFilter(*itr,fnc,lib);
if (fnc != "") {
filterFnc(fnc);
m_filterfnc.insert(fnc);
}
if (lib != "") {
filterLib(lib);
m_filterlib.insert(lib);
}
}
return StatusCode::SUCCESS;
}

void StatusCodeSvc::list | ( |  | ) | const
| virtual

Implements IStatusCodeSvc.

Definition at line 153 of file StatusCodeSvc.cpp.

{
MsgStream log( msgSvc(), name() );
log << MSG::INFO << endl;
map<string,StatCodeDat>::const_iterator itr;
#if defined (__GNUC__) && ( __GNUC__ <= 2 )
std::ostrstream os;
#else
std::ostringstream os;
#endif
os << "Num | Function | Source Library" << endl;
os << "----+--------------------------------+-------------------"
<< "-----------------------" << endl;
for(itr = m_dat.begin(); itr != m_dat.end(); ++itr ) {
StatCodeDat dat = itr->second;
os.width(3);
os.setf(ios_base::right,ios_base::adjustfield);
os << dat.count;
os << " | ";
os.width(30);
os.setf(ios_base::left,ios_base::adjustfield);
os << dat.fnc;
os << " | ";
os.setf(ios_base::left,ios_base::adjustfield);
os << dat.lib;
os << endl;
}
log << os.str() << endmsg;
}

void StatusCodeSvc::parseFilter | ( | const std::string & | str,
|  | std::string & | fnc,
|  | std::string & | lib
| ) |  |
| private

Definition at line 230 of file StatusCodeSvc.cpp.

{
string::size_type loc = str.find("=");
if (loc == std::string::npos) {
fnc = str;
lib = "";
} else {
string key,val;
key = str.substr(0,loc);
val = str.substr(loc+1,str.length()-loc-1);
toupper(key);
if (key == "FCN" || key == "FNC") {
fnc = val;
lib = "";
} else if (key == "LIB") {
fnc = "";
lib = val;
} else {
fnc = "";
lib = "";
MsgStream log( msgSvc(), name() );
log << MSG::WARNING << "ignoring unknown token in Filter: " << str
<< endmsg;
}
}
}

void StatusCodeSvc::regFnc | ( | const std::string & | func,
|  | const std::string & | lib
| ) |  |
| virtual

Implements IStatusCodeSvc.

Definition at line 103 of file StatusCodeSvc.cpp.

{
if (m_state == Gaudi::StateMachine::OFFLINE ||
m_state == Gaudi::StateMachine::CONFIGURED) {
return;
}
if (m_dict && lib.rfind("Dict.so") == (lib.length()-7) ) {
return;
}
{
const string rlib = lib.substr(lib.rfind("/") + 1);
if (m_filterfnc.find(fnc) != m_filterfnc.end() ||
m_filterlib.find(rlib) != m_filterlib.end() ) {
return;
}
}
if (m_abort) {
MsgStream log( msgSvc(), name() );
log << MSG::FATAL << "Unchecked StatusCode in " << fnc << " from lib "
<< lib << endmsg;
abort();
}
string key = fnc + lib;
map<string,StatCodeDat>::iterator itr = m_dat.find(key);
if (itr != m_dat.end()) {
itr->second.count += 1;
} else {
const string rlib = lib.substr(lib.rfind("/") + 1);
StatCodeDat dat;
dat.fnc = fnc;
dat.lib = rlib;
dat.count = 1;
m_dat[key] = dat;
}
}

StatusCode StatusCodeSvc::reinitialize | ( |  | ) |
| virtual

Reimplemented from Service.

Definition at line 72 of file StatusCodeSvc.cpp.

{
MsgStream log( msgSvc(), name() );
log << MSG::INFO << "reinitialize" << endmsg;
return StatusCode::SUCCESS;
}

virtual bool StatusCodeSvc::suppressCheck | ( |  | ) | const
| inline virtual

Implements IStatusCodeSvc.

Definition at line 22 of file StatusCodeSvc.h.

{ return m_suppress.value() ; }

## Member Data Documentation

BooleanProperty StatusCodeSvc::m_abort
| private

Definition at line 42 of file StatusCodeSvc.h.

std::map<std::string,StatCodeDat> StatusCodeSvc::m_dat
| private

Definition at line 44 of file StatusCodeSvc.h.

BooleanProperty StatusCodeSvc::m_dict
| private

Definition at line 42 of file StatusCodeSvc.h.

std::set<std::string> StatusCodeSvc::m_filterfnc
| private

Definition at line 45 of file StatusCodeSvc.h.

std::set<std::string> StatusCodeSvc::m_filterlib
| private

Definition at line 45 of file StatusCodeSvc.h.

StringArrayProperty StatusCodeSvc::m_pFilter
| private

Definition at line 41 of file StatusCodeSvc.h.

BooleanProperty StatusCodeSvc::m_suppress
| private

Definition at line 42 of file StatusCodeSvc.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiCommonSvc/src/StatusCodeSvc.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiCommonSvc/src/StatusCodeSvc.cpp