Obchunk.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Obchunk.h
00006  *
00007  *  Obchunk.h,v 4.4 2005/11/22 09:23:55 ossama Exp
00008  *
00009  *  @author Doug Schmidt
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_OBCHUNK_H
00015 #define ACE_OBCHUNK_H
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "ace/Malloc.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00025 
00026 /**
00027  * @class ACE_Obchunk
00028  *
00029  * @brief Defines the state that represents a "chunk" of memory.
00030  *        Evenything in this class is public because it is designed
00031  *        as an internal structure of Obstack_T and users are
00032  *        not supposed to use this class directly.
00033  * @sa ACE_Obstack_T
00034  */
00035 class ACE_Export ACE_Obchunk
00036 {
00037 public:
00038   /// Constructor.
00039   ACE_Obchunk (size_t size);
00040 
00041   /// Dtor.
00042   ~ACE_Obchunk (void);
00043 
00044   /// Dump the state of an object.
00045   void dump (void) const;
00046 
00047   /// Declare the dynamic allocation hooks.
00048   ACE_ALLOC_HOOK_DECLARE;
00049 
00050   /// Pointer to the end of the chunk.
00051   char *end_;
00052 
00053   /// Pointer to the head of the current building block.
00054   char *block_;
00055 
00056   /// Pointer to the current location in the chunk.
00057   char *cur_;
00058 
00059   /// Next chunk in the chain.
00060   ACE_Obchunk *next_;
00061 
00062   /**
00063    * Pointer to the beginning contents of this chunk.  This field is
00064    * actually overlayed by the memory allocated by
00065    * <ACE_Obstack::new_chunk>.  Therefore, it *must* come last.
00066    */
00067   char contents_[4];
00068 };
00069 
00070 ACE_END_VERSIONED_NAMESPACE_DECL
00071 
00072 #if defined (__ACE_INLINE__)
00073 #include "ace/Obchunk.inl"
00074 #endif /* __ACE_INLINE__ */
00075 
00076 #include /**/ "ace/post.h"
00077 #endif /* ACE_OBCHUNK_H */

Generated on Thu Nov 9 09:41:57 2006 for ACE by doxygen 1.3.6