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.
00001 // $Header: /cvsroot/libcwd/libcwd/include/libcwd/private_debug_stack.h,v 1.5 2005/12/19 16:02:25 libcw Exp $
00002 //
00003 // Copyright (C) 2000 - 2004, by
00004 // 
00005 // Carlo Wood, Run on IRC <carlo@alinoe.com>
00006 // RSA-1024 0x624ACAD5 1997-01-26                    Sign & Encrypt
00007 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6  F6 F6 55 DD 1C DC FF 61
00008 //
00009 // This file may be distributed under the terms of the Q Public License
00010 // version 1.0 as appearing in the file LICENSE.QPL included in the
00011 // packaging of this file.
00012 //
00013 
00018 #ifndef LIBCWD_PRIVATE_DEBUG_STACK_H
00019 #define LIBCWD_PRIVATE_DEBUG_STACK_H
00020 
00021 #ifndef LIBCWD_CONFIG_H
00022 #include <libcwd/config.h>
00023 #endif
00024 #ifndef LIBCW_CSTDDEF
00025 #define LIBCW_CSTDDEF
00026 #include <cstddef>              // Needed for size_t
00027 #endif
00028 
00029 namespace libcwd {
00030   namespace _private_ {
00031 
00032 // Stack implementation that doesn't have a constructor.
00033 // The size of 64 should be MORE then enough.
00034 
00035 template<typename T>            // T must be a builtin type.
00036   struct debug_stack_tst {
00037   private:
00038     T st[64];
00039     T* p;
00040     T* end;
00041   public:
00042     void init(void);
00043     void push(T ptr);
00044     void pop(void);
00045     T top(void) const;
00046     size_t size(void) const;
00047   };
00048 
00049   } // namespace _private_
00050 }  // namespace libcwd
00051 
00052 #endif // LIBCWD_PRIVATE_DEBUG_STACK_H
Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.