Crypto++
|
#include <wait.h>
Public Member Functions | |
CallStack (char const *i, CallStack const *p) | |
CallStack const * | Prev () const |
virtual std::string | Format () const |
Protected Attributes | |
char const * | m_info |
CallStack const * | m_prev |
A simple unidirectional linked list with m_prev == 0 to indicate the final entry. The aim of this implementation is to provide a very lightweight and practical tracing mechanism with a low performance impact. Functions and methods supporting this call-stack mechanism would take a parameter of the form "CallStack const& callStack", and would pass this parameter to subsequent functions they call using the construct:
SubFunc(arg1, arg2, CallStack("my func at place such and such", &callStack));
The advantage of this approach is that it is easy to use and should be very efficient, involving no allocation from the heap, just a linked list of stack objects containing pointers to static ASCIIZ strings (or possibly additional but simple data if derived).