Main Page   Reference Manual   Namespace List   Compound List   Namespace Members   Compound Members   File Members  

private_debug_stack.h
Go to the documentation of this file.
1 // $Header$
2 //
3 // Copyright (C) 2000 - 2004, by
4 //
5 // Carlo Wood, Run on IRC <carlo@alinoe.com>
6 // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt
7 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61
8 //
9 // This file may be distributed under the terms of the Q Public License
10 // version 1.0 as appearing in the file LICENSE.QPL included in the
11 // packaging of this file.
12 //
13 
18 #ifndef LIBCWD_PRIVATE_DEBUG_STACK_H
19 #define LIBCWD_PRIVATE_DEBUG_STACK_H
20 
21 #ifndef LIBCWD_CONFIG_H
22 #include <libcwd/config.h>
23 #endif
24 #ifndef LIBCW_CSTDDEF
25 #define LIBCW_CSTDDEF
26 #include <cstddef> // Needed for size_t
27 #endif
28 
29 namespace libcwd {
30  namespace _private_ {
31 
32 // Stack implementation that doesn't have a constructor.
33 // The size of 64 should be MORE then enough.
34 
35 template<typename T> // T must be a builtin type.
36  struct debug_stack_tst {
37  private:
38  T st[64];
39  T* p;
40  T* end;
41  public:
42  void init(void);
43  void push(T ptr);
44  void pop(void);
45  T top(void) const;
46  size_t size(void) const;
47  };
48 
49  } // namespace _private_
50 } // namespace libcwd
51 
52 #endif // LIBCWD_PRIVATE_DEBUG_STACK_H
Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.