StatusCodeSvc Class Reference

#include <src/StatusCodeSvc.h>

Inheritance diagram for StatusCodeSvc:
Collaboration diagram for StatusCodeSvc:

Classes

struct  StatCodeDat
 

Public Member Functions

virtual StatusCode initialize ()
 Initialization (from CONFIGURED to INITIALIZED). More...
 
virtual StatusCode reinitialize ()
 Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED). More...
 
virtual StatusCode finalize ()
 Finalize (from INITIALIZED to CONFIGURED). More...
 
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. More...
 
 extends1 (A1 a1, A2 a2)
 Templated constructor with 2 arguments. More...
 
 extends1 (A1 a1)
 Templated constructor with 1 argument. More...
 
 extends1 ()
 Default constructor. More...
 
 extends1 (A1 a1, A2 a2, A3 a3)
 Templated constructor with 3 arguments. More...
 
 extends1 (A1 a1, A2 a2)
 Templated constructor with 2 arguments. More...
 
 extends1 (A1 a1)
 Templated constructor with 1 argument. More...
 
 extends1 ()
 Default constructor. More...
 
virtual void * i_cast (const InterfaceID &tid) const
 Implementation of IInterface::i_cast. More...
 
virtual void * i_cast (const InterfaceID &tid) const
 Implementation of IInterface::i_cast. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)
 Implementation of IInterface::queryInterface. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)
 Implementation of IInterface::queryInterface. More...
 
virtual std::vector< std::string > getInterfaceNames () const
 Implementation of IInterface::getInterfaceNames. More...
 
virtual std::vector< std::string > getInterfaceNames () const
 Implementation of IInterface::getInterfaceNames. More...
 
virtual ~extends1 ()
 Virtual destructor. More...
 
virtual ~extends1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from Service
virtual unsigned long release ()
 Release Interface instance. More...
 
virtual const std::string & name () const
 Retrieve name of the service. More...
 
virtual StatusCode configure ()
 Configuration (from OFFLINE to CONFIGURED). More...
 
virtual StatusCode start ()
 Start (from INITIALIZED to RUNNING). More...
 
virtual StatusCode stop ()
 Stop (from RUNNING to INITIALIZED). More...
 
virtual StatusCode terminate ()
 Initialization (from CONFIGURED to OFFLINE). More...
 
virtual Gaudi::StateMachine::State FSMState () const
 Get the current state. More...
 
virtual Gaudi::StateMachine::State targetFSMState () const
 When we are in the middle of a transition, get the state where the transition is leading us. More...
 
virtual StatusCode restart ()
 Initialization (from RUNNING to RUNNING, via INITIALIZED). More...
 
virtual StatusCode sysInitialize ()
 Initialize Service. More...
 
virtual StatusCode sysStart ()
 Initialize Service. More...
 
virtual StatusCode sysStop ()
 Initialize Service. More...
 
virtual StatusCode sysFinalize ()
 Finalize Service. More...
 
virtual StatusCode sysReinitialize ()
 Re-initialize the Service. More...
 
virtual StatusCode sysRestart ()
 Re-initialize the Service. More...
 
virtual StatusCode setProperty (const Property &p)
 Set the property by property. More...
 
virtual StatusCode setProperty (const std::string &s)
 Set the property by string. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Set the property by std::string. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the property by property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Get the property by std::string. More...
 
virtual const std::vector< Property * > & getProperties () const
 Get list of properties. More...
 
virtual bool hasProperty (const std::string &name) const
 Return true if we have a property with the given name. More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
 Service (const std::string &name, ISvcLocator *svcloc)
 Standard Constructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 Retrieve pointer to service locator. More...
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified for the job. More...
 
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. More...
 
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. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
virtual unsigned long release ()
 Release Interface instance. More...
 
virtual const std::string & name () const
 Retrieve name of the service. More...
 
virtual StatusCode configure ()
 Configuration (from OFFLINE to CONFIGURED). More...
 
virtual StatusCode start ()
 Start (from INITIALIZED to RUNNING). More...
 
virtual StatusCode stop ()
 Stop (from RUNNING to INITIALIZED). More...
 
virtual StatusCode terminate ()
 Initialization (from CONFIGURED to OFFLINE). More...
 
virtual Gaudi::StateMachine::State FSMState () const
 Get the current state. More...
 
virtual Gaudi::StateMachine::State targetFSMState () const
 When we are in the middle of a transition, get the state where the transition is leading us. More...
 
virtual StatusCode restart ()
 Initialization (from RUNNING to RUNNING, via INITIALIZED). More...
 
virtual StatusCode sysInitialize ()
 Initialize Service. More...
 
virtual StatusCode sysStart ()
 Initialize Service. More...
 
virtual StatusCode sysStop ()
 Initialize Service. More...
 
virtual StatusCode sysFinalize ()
 Finalize Service. More...
 
virtual StatusCode sysReinitialize ()
 Re-initialize the Service. More...
 
virtual StatusCode sysRestart ()
 Re-initialize the Service. More...
 
virtual StatusCode setProperty (const Property &p)
 Set the property by property. More...
 
virtual StatusCode setProperty (const std::string &s)
 Set the property by string. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Set the property by std::string. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the property by property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Get the property by std::string. More...
 
virtual const std::vector< Property * > & getProperties () const
 Get list of properties. More...
 
virtual bool hasProperty (const std::string &name) const
 Return true if we have a property with the given name. More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
 Service (const std::string &name, ISvcLocator *svcloc)
 Standard Constructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 Retrieve pointer to service locator. More...
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified for the job. More...
 
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. More...
 
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. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
- 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. More...
 
 CommonMessaging (const A1 &a1, const A2 &a2)
 Templated constructor with 2 arguments. More...
 
 CommonMessaging (const A1 &a1)
 Templated constructor with 1 argument. More...
 
 CommonMessaging ()
 Default constructor. More...
 
 CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
 Templated constructor with 3 arguments. More...
 
 CommonMessaging (const A1 &a1, const A2 &a2)
 Templated constructor with 2 arguments. More...
 
 CommonMessaging (const A1 &a1)
 Templated constructor with 1 argument. More...
 
 CommonMessaging ()
 Default constructor. More...
 
virtual ~CommonMessaging ()
 Virtual destructor. More...
 
virtual ~CommonMessaging ()
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from extend_interfaces3< IService, IProperty, IStateful >
virtual ~extend_interfaces3 ()
 Virtual destructor. More...
 
virtual ~extend_interfaces3 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IService
 DeclareInterfaceID (IService, 3, 0)
 InterfaceID. More...
 
virtual ~IService ()
 virtual destructor More...
 
 DeclareInterfaceID (IService, 3, 0)
 InterfaceID. More...
 
virtual ~IService ()
 virtual destructor More...
 
- Public Member Functions inherited from INamedInterface
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
- Public Member Functions inherited from IInterface
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IProperty
 DeclareInterfaceID (IProperty, 2, 1)
 InterfaceID. More...
 
 DeclareInterfaceID (IProperty, 2, 1)
 InterfaceID. More...
 
- Public Member Functions inherited from IStateful
 DeclareInterfaceID (IStateful, 1, 0)
 InterfaceID. More...
 
virtual ~IStateful ()
 
 DeclareInterfaceID (IStateful, 1, 0)
 InterfaceID. More...
 
virtual ~IStateful ()
 
- Public Member Functions inherited from extend_interfaces1< IStatusCodeSvc >
virtual ~extend_interfaces1 ()
 Virtual destructor. More...
 
virtual ~extend_interfaces1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IStatusCodeSvc
 DeclareInterfaceID (IStatusCodeSvc, 2, 0)
 InterfaceID. More...
 
virtual ~IStatusCodeSvc ()
 virtual destructor More...
 
 DeclareInterfaceID (IStatusCodeSvc, 2, 0)
 InterfaceID. More...
 
virtual ~IStatusCodeSvc ()
 virtual destructor More...
 

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, StatCodeDatm_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. More...
 
typedef extends1 base_class
 Typedef to this class. More...
 
typedef extend_interfaces1< IStatusCodeSvcextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces1< IStatusCodeSvcextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from Service
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > Factory
 
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > Factory
 
- Public Types inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
typedef CommonMessaging base_class
 
typedef CommonMessaging base_class
 
- Public Types inherited from implements3< IService, IProperty, IStateful >
typedef implements3 base_class
 Typedef to this class. More...
 
typedef implements3 base_class
 Typedef to this class. More...
 
typedef extend_interfaces3< IService, IProperty, IStatefulextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces3< IService, IProperty, IStatefulextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces3< IService, IProperty, IStateful >
typedef mpl::fold< typename IService::iid::iids::type, typename mpl::fold< typename IProperty::iid::iids::type, typename IStateful::iid::iids::type, mpl::insert< mpl::_1, mpl::_2 > >::type, mpl::insert< mpl::_1, mpl::_2 > >::type ext_iids
 MPL set of interfaces extended by this one. More...
 
typedef mpl::fold< typename IService::iid::iids::type, typename mpl::fold< typename IProperty::iid::iids::type, typename IStateful::iid::iids::type, mpl::insert< mpl::_1, mpl::_2 > >::type, mpl::insert< mpl::_1, mpl::_2 > >::type ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IInterface
enum  Status {
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR,
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR
}
 Return status. More...
 
enum  Status {
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR,
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR
}
 Return status. More...
 
typedef Gaudi::InterfaceId< IInterface, 0, 0 > iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
typedef Gaudi::InterfaceId< IInterface, 0, 0 > iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
- Public Types inherited from extend_interfaces1< IStatusCodeSvc >
typedef IStatusCodeSvc::iid::iids::type ext_iids
 MPL set of interfaces extended by this one. More...
 
typedef IStatusCodeSvc::iid::iids::type ext_iids
 MPL set of interfaces extended by this one. More...
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 
- Protected Member Functions inherited from Service
virtual ~Service ()
 Standard Destructor. More...
 
int outputLevel () const
 get the Service's output level More...
 
virtual ~Service ()
 Standard Destructor. More...
 
int outputLevel () const
 get the Service's output level More...
 
- Protected Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 
- Protected Attributes inherited from Service
IntegerProperty m_outputLevel
 Service output level. More...
 
Gaudi::StateMachine::State m_state
 Service state. More...
 
Gaudi::StateMachine::State m_targetState
 Service state. More...
 
- Protected Attributes inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
SmartIF< IMessageSvcm_msgsvc
 Pointer to the message service;. More...
 
std::auto_ptr< MsgStreamm_msgStream
 The predefined message stream. More...
 
bool m_streamWithService
 Flag to create a new MsgStream if it was created without the message service. More...
 

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.

18  : base_class( name, svc )
19 {
20 
21  declareProperty("Filter",m_pFilter);
22  declareProperty("AbortOnError",m_abort=false);
23  declareProperty("SuppressCheck", m_suppress=false);
24  declareProperty("IgnoreDicts",m_dict=true);
25 
26 }
BooleanProperty m_abort
Definition: StatusCodeSvc.h:42
BooleanProperty m_dict
Definition: StatusCodeSvc.h:42
BooleanProperty m_suppress
Definition: StatusCodeSvc.h:42
extends1 base_class
Typedef to this class.
Definition: extends.h:12
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:329
StringArrayProperty m_pFilter
Definition: StatusCodeSvc.h:41
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:212
StatusCodeSvc::~StatusCodeSvc ( )
virtual

Definition at line 30 of file StatusCodeSvc.cpp.

30  {
31 
32 }

Member Function Documentation

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

Definition at line 211 of file StatusCodeSvc.cpp.

211  {
212 
213  std::map<std::string, StatCodeDat>::iterator itr;
214  for (itr = m_dat.begin(); itr != m_dat.end(); ++itr ) {
215  if (itr->second.fnc == str) {
216  m_dat.erase(itr);
217  return;
218  }
219 
220  }
221 
222 }
std::map< std::string, StatCodeDat > m_dat
Definition: StatusCodeSvc.h:44
void StatusCodeSvc::filterLib ( const std::string &  str)
private

Definition at line 226 of file StatusCodeSvc.cpp.

226  {
227 
228  std::map<std::string, StatCodeDat>::iterator itr;
229  for (itr = m_dat.begin(); itr != m_dat.end(); ++itr ) {
230  if (itr->second.lib == str) {
231  m_dat.erase(itr);
232  return;
233  }
234 
235  }
236 
237 }
std::map< std::string, StatCodeDat > m_dat
Definition: StatusCodeSvc.h:44
StatusCode StatusCodeSvc::finalize ( )
virtual

Finalize (from INITIALIZED to CONFIGURED).

Reimplemented from Service.

Definition at line 83 of file StatusCodeSvc.cpp.

83  {
84  MsgStream log( msgSvc(), name() );
85 
86  if (m_dat.size() > 0) {
87 
88  log << MSG::INFO << "listing all unchecked return codes:" << endmsg;
89 
90  list();
91 
92  } else {
93 
94  if (msgLevel(MSG::DEBUG))
95  log << MSG::DEBUG << "all StatusCode instances where checked" << endmsg;
96 
97  }
98 
99  return StatusCode::SUCCESS;
100 
101 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
virtual void list() const
std::map< std::string, StatCodeDat > m_dat
Definition: StatusCodeSvc.h:44
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:329
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
StatusCode StatusCodeSvc::initialize ( )
virtual

Initialization (from CONFIGURED to INITIALIZED).

Reimplemented from Service.

Definition at line 38 of file StatusCodeSvc.cpp.

38  {
39 
41  if (!sc.isSuccess()) return sc;
42 
43  MsgStream log( msgSvc(), name() );
44  log << MSG::INFO << "initialize" << endmsg;
45 
46  std::vector<std::string>::const_iterator itr;
47  for (itr = m_pFilter.value().begin(); itr != m_pFilter.value().end(); ++itr) {
48  // we need to do this if someone has gotten to regFnc before initialize
49 
50  string fnc,lib;
51  parseFilter(*itr,fnc,lib);
52 
53  if (fnc != "") {
54  filterFnc(fnc);
55  m_filterfnc.insert(fnc);
56  }
57 
58  if (lib != "") {
59  filterLib(lib);
60  m_filterlib.insert(lib);
61  }
62 
63  }
64 
65  return StatusCode::SUCCESS;
66 
67 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
void parseFilter(const std::string &str, std::string &fnc, std::string &lib)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
std::set< std::string > m_filterfnc
Definition: StatusCodeSvc.h:45
const TYPE & value() const
explicit conversion
Definition: Property.h:355
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:329
StringArrayProperty m_pFilter
Definition: StatusCodeSvc.h:41
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Definition: Service.cpp:72
void filterLib(const std::string &)
void filterFnc(const std::string &)
std::set< std::string > m_filterlib
Definition: StatusCodeSvc.h:45
void StatusCodeSvc::list ( ) const
virtual

Implements IStatusCodeSvc.

Definition at line 165 of file StatusCodeSvc.cpp.

165  {
166 
167  MsgStream log( msgSvc(), name() );
168  log << MSG::INFO << endl;
169 
170  map<string,StatCodeDat>::const_iterator itr;
171 
172 #if defined (__GNUC__) && ( __GNUC__ <= 2 )
173  std::ostrstream os;
174 #else
175  std::ostringstream os;
176 #endif
177 
178  os << "Num | Function | Source Library" << endl;
179  os << "----+--------------------------------+-------------------"
180  << "-----------------------" << endl;
181 
182 
183  for(itr = m_dat.begin(); itr != m_dat.end(); ++itr ) {
184  StatCodeDat dat = itr->second;
185 
186  os.width(3);
187  os.setf(ios_base::right,ios_base::adjustfield);
188  os << dat.count;
189 
190  os << " | ";
191  os.width(30);
192  os.setf(ios_base::left,ios_base::adjustfield);
193  os << dat.fnc;
194 
195  os << " | ";
196  os.setf(ios_base::left,ios_base::adjustfield);
197  os << dat.lib;
198 
199  os << endl;
200 
201  }
202 
203 
204  log << os.str() << endmsg;
205 
206 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
std::map< std::string, StatCodeDat > m_dat
Definition: StatusCodeSvc.h:44
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:329
void StatusCodeSvc::parseFilter ( const std::string &  str,
std::string &  fnc,
std::string &  lib 
)
private

Definition at line 242 of file StatusCodeSvc.cpp.

242  {
243 
244 
245  string::size_type loc = str.find("=");
246  if (loc == std::string::npos) {
247  fnc = str;
248  lib = "";
249  } else {
250  string key,val;
251  key = str.substr(0,loc);
252  val = str.substr(loc+1,str.length()-loc-1);
253 
254  toupper(key);
255 
256  if (key == "FCN" || key == "FNC") {
257  fnc = val;
258  lib = "";
259  } else if (key == "LIB") {
260  fnc = "";
261  lib = val;
262  } else {
263  fnc = "";
264  lib = "";
265 
266  MsgStream log( msgSvc(), name() );
267  log << MSG::WARNING << "ignoring unknown token in Filter: " << str
268  << endmsg;
269  }
270  }
271 
272 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:329
void toupper(std::string &s)
void StatusCodeSvc::regFnc ( const std::string &  func,
const std::string &  lib 
)
virtual

Implements IStatusCodeSvc.

Definition at line 108 of file StatusCodeSvc.cpp.

108  {
109 
112  return;
113  }
114 
115  if (m_dict &&
116  (lib.compare(lib.length()-7, 7, "Dict.so") == 0 ||
117  lib.compare(lib.length()-8, 8, "Cling.so") == 0)) {
118  return;
119  }
120  // this appears only with gcc 4.9...
121  if (fnc == "_PyObject_GC_Malloc") return;
122  // GAUDI-1036
123  if (fnc == "PyThread_get_thread_ident") return;
124  if (fnc == "local") return;
125 
126  {
127  const string rlib = lib.substr(lib.rfind("/") + 1);
128 
129  if (m_filterfnc.find(fnc) != m_filterfnc.end() ||
130  m_filterlib.find(rlib) != m_filterlib.end() ) {
131  return;
132  }
133  }
134 
135  if (m_abort) {
136  MsgStream log( msgSvc(), name() );
137  log << MSG::FATAL << "Unchecked StatusCode in " << fnc << " from lib "
138  << lib << endmsg;
139  abort();
140  }
141 
142  string key = fnc + lib;
143 
144  map<string,StatCodeDat>::iterator itr = m_dat.find(key);
145 
146  if (itr != m_dat.end()) {
147  itr->second.count += 1;
148  } else {
149 
150  const string rlib = lib.substr(lib.rfind("/") + 1);
151 
152  StatCodeDat dat;
153  dat.fnc = fnc;
154  dat.lib = rlib;
155  dat.count = 1;
156 
157  m_dat[key] = dat;
158  }
159 
160 }
BooleanProperty m_abort
Definition: StatusCodeSvc.h:42
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:246
BooleanProperty m_dict
Definition: StatusCodeSvc.h:42
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
std::map< std::string, StatCodeDat > m_dat
Definition: StatusCodeSvc.h:44
std::set< std::string > m_filterfnc
Definition: StatusCodeSvc.h:45
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:329
std::set< std::string > m_filterlib
Definition: StatusCodeSvc.h:45
StatusCode StatusCodeSvc::reinitialize ( )
virtual

Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).

Reimplemented from Service.

Definition at line 72 of file StatusCodeSvc.cpp.

72  {
73 
74  MsgStream log( msgSvc(), name() );
75  log << MSG::INFO << "reinitialize" << endmsg;
76 
77  return StatusCode::SUCCESS;
78 
79 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:329
virtual bool StatusCodeSvc::suppressCheck ( ) const
inlinevirtual

Implements IStatusCodeSvc.

Definition at line 22 of file StatusCodeSvc.h.

22 { return m_suppress.value() ; }
BooleanProperty m_suppress
Definition: StatusCodeSvc.h:42
const TYPE & value() const
explicit conversion
Definition: Property.h:355

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: