! 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
| 122 | involving no allocation from the heap, just a linked list of stack objects containing |
| 123 | pointers to static ASCIIZ strings (or possibly additional but simple data if derived). */ |
| 124 | class CallStack |
| 125 | { |
| 126 | public: |
| 127 | CallStack(char const* i, CallStack const* p) : m_info(i), m_prev(p) {} |
| 128 | CallStack const* Prev() const { return m_prev; } |
| 129 | virtual std::string Format() const; |
| 130 | |
| 131 | protected: |
| 132 | char const* m_info; |
| 133 | CallStack const* m_prev; |
| 134 | }; |
| 135 | |
| 136 | /*! An extended CallStack entry type with an additional numeric parameter. */ |
| 137 | class CallStackWithNr : public CallStack |
no outgoing calls