All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Static Public Member Functions
GpCoreTools::Trace Class Reference

Brief description of class still missing. More...

#include <Trace.h>

List of all members.

Public Member Functions

 Trace (const TraceStamp *stamp)
 ~Trace ()

Static Public Member Functions

static std::string backTrace (const std::vector< const TraceStamp * > *stack)
static std::vector< const
TraceStamp * > * 
mainStack ()

Detailed Description

Brief description of class still missing.

To get a debug trace of all functions, you can define in an implementation files (.cpp):

Precondition:
#ifdef TRACE # undef TRACE #endif #define TRACE printf("%s\n",__PRETTY_FUNCTION__);

Constructor & Destructor Documentation

Description of constructor still missing

References GpCoreTools::PThread::currentThread(), and GpCoreTools::PThread::stack().

{
  PThread * t=PThread::currentThread();
  if(t) {
    _myStack=t->stack();
    _myStack->push_back(s);
  } else {
    _myStack=&_mainStack;
    _myStack->push_back(s);
  }
  //printf("[TRACE] %s\n",s->toString().toAscii().data());
  //fflush(stdout);
}

Description of destructor still missing

{
  if(_myStack) {
    _myStack->pop_back();
  }
}

Member Function Documentation

std::string GpCoreTools::Trace::backTrace ( const std::vector< const TraceStamp * > *  stack) [static]

Referenced by GpCoreTools::CoreApplication::osSignal().

{
  std::string list;

  for(std::vector<const TraceStamp *>::const_iterator it=stack->begin();it!=stack->end();it++) {
    list += (*it)->toString();
    list += "\n";
  }
  return list;
}
static std::vector<const TraceStamp *>* GpCoreTools::Trace::mainStack ( ) [inline, static]

Referenced by GpCoreTools::PThread::stacks().

{return &_mainStack;}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines