1 /* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef STACK_TRACE_H 6 #define STACK_TRACE_H 7 8 #include <ObjectList.h> 9 10 #include "StackFrame.h" 11 12 13 class StackTrace : public BReferenceable { 14 public: 15 StackTrace(); 16 virtual ~StackTrace(); 17 18 bool AddFrame(StackFrame* frame); 19 // takes over reference (also on error) 20 21 int32 CountFrames() const; 22 StackFrame* FrameAt(int32 index) const; 23 24 private: 25 typedef BObjectList<StackFrame> StackFrameList; 26 27 private: 28 StackFrameList fStackFrames; 29 }; 30 31 32 #endif // STACK_TRACE_H 33