strusBase  0.17
Public Member Functions | List of all members
strus::DebugTraceInterface Class Referenceabstract

Managing interface for reporting debug trace messages in a uniform way. More...

#include <debugTraceInterface.hpp>

Public Member Functions

virtual ~DebugTraceInterface ()
 Destructor. More...
 
virtual bool setMaxNofThreads (unsigned int maxNofThreads)=0
 Redefine the maximum number of threads using the debug trace. More...
 
virtual bool enable (const std::string &component)=0
 Enable debugging for a component adressed by name. More...
 
virtual void disable (const std::string &component)=0
 Disable debugging for a component adressed by name if enabled before. More...
 
virtual
DebugTraceContextInterface
createTraceContext (const char *component) const =0
 Get the context for a component addressed by name if enabled for the current thread. More...
 
virtual void allocContext ()=0
 Allocate context for current thread. More...
 
virtual void releaseContext ()=0
 Dellocate context for current thread. More...
 
virtual bool hasError () const =0
 Test if an error occurred in the trace. More...
 
virtual std::vector
< DebugTraceMessage
fetchMessages () const =0
 Get and clear all messages of the current thread an clears the error flag. More...
 

Detailed Description

Managing interface for reporting debug trace messages in a uniform way.

Constructor & Destructor Documentation

virtual strus::DebugTraceInterface::~DebugTraceInterface ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual void strus::DebugTraceInterface::allocContext ( )
pure virtual

Allocate context for current thread.

Remarks
allocContext & releaseContext have only to be called if assignement of thread ids is not fix
virtual DebugTraceContextInterface* strus::DebugTraceInterface::createTraceContext ( const char *  component) const
pure virtual

Get the context for a component addressed by name if enabled for the current thread.

Parameters
[in]componentname of component queried
Returns
the debug trace context for a component or NULL if not enabled
Remarks
must not throw
virtual void strus::DebugTraceInterface::disable ( const std::string &  component)
pure virtual

Disable debugging for a component adressed by name if enabled before.

Parameters
[in]componentname of component to disable debugging for
virtual bool strus::DebugTraceInterface::enable ( const std::string &  component)
pure virtual

Enable debugging for a component adressed by name.

Parameters
[in]componentname of component to enable debugging for
Returns
true on success, false if an occurred (memory or resource allocation error)
Remarks
must not throw
virtual std::vector<DebugTraceMessage> strus::DebugTraceInterface::fetchMessages ( ) const
pure virtual

Get and clear all messages of the current thread an clears the error flag.

virtual bool strus::DebugTraceInterface::hasError ( ) const
pure virtual

Test if an error occurred in the trace.

virtual void strus::DebugTraceInterface::releaseContext ( )
pure virtual

Dellocate context for current thread.

Remarks
allocContext & releaseContext have only to be called if assignement of thread ids is not fix
virtual bool strus::DebugTraceInterface::setMaxNofThreads ( unsigned int  maxNofThreads)
pure virtual

Redefine the maximum number of threads using the debug trace.

Parameters
[in]maxNofThreadsnumber of threads
Remarks
not thread safe, may invalidate all objects dependent on this, assumed not to be called outside the main process initialization phase

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