diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
commit | c44379cc7d9c7aa113989237ab0f56db12aa5219 (patch) | |
tree | 66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/ace/Obchunk.h | |
parent | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff) | |
download | ATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz |
Repo restructuring
Diffstat (limited to 'ACE/ace/Obchunk.h')
-rw-r--r-- | ACE/ace/Obchunk.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/ACE/ace/Obchunk.h b/ACE/ace/Obchunk.h new file mode 100644 index 00000000000..9690c39f9d1 --- /dev/null +++ b/ACE/ace/Obchunk.h @@ -0,0 +1,77 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Obchunk.h + * + * $Id$ + * + * @author Doug Schmidt + */ +//============================================================================= + + +#ifndef ACE_OBCHUNK_H +#define ACE_OBCHUNK_H +#include /**/ "ace/pre.h" + +#include "ace/Malloc.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +/** + * @class ACE_Obchunk + * + * @brief Defines the state that represents a "chunk" of memory. + * Evenything in this class is public because it is designed + * as an internal structure of Obstack_T and users are + * not supposed to use this class directly. + * @sa ACE_Obstack_T + */ +class ACE_Export ACE_Obchunk +{ +public: + /// Constructor. + ACE_Obchunk (size_t size); + + /// Dtor. + ~ACE_Obchunk (void); + + /// Dump the state of an object. + void dump (void) const; + + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + + /// Pointer to the end of the chunk. + char *end_; + + /// Pointer to the head of the current building block. + char *block_; + + /// Pointer to the current location in the chunk. + char *cur_; + + /// Next chunk in the chain. + ACE_Obchunk *next_; + + /** + * Pointer to the beginning contents of this chunk. This field is + * actually overlayed by the memory allocated by + * <ACE_Obstack::new_chunk>. Therefore, it *must* come last. + */ + char contents_[4]; +}; + +ACE_END_VERSIONED_NAMESPACE_DECL + +#if defined (__ACE_INLINE__) +#include "ace/Obchunk.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" +#endif /* ACE_OBCHUNK_H */ |