Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

DynamicBuffer.h

00001 #ifndef _STR_DynamicBuffer_H_  // -*-c++-*-
00002 
00003 /*
00004  * Copyright 1991-2002 Eric M. Hopper <hopper@omnifarious.org>
00005  * 
00006  *     This program is free software; you can redistribute it and/or modify it
00007  *     under the terms of the GNU Lesser General Public License as published
00008  *     by the Free Software Foundation; either version 2 of the License, or
00009  *     (at your option) any later version.
00010  * 
00011  *     This program is distributed in the hope that it will be useful, but
00012  *     WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *     Lesser General Public License for more details.
00015  * 
00016  *     You should have received a copy of the GNU Lesser General Public
00017  *     License along with this program; if not, write to the Free Software
00018  *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 #ifdef __GNUG__
00022 #  pragma interface
00023 #endif
00024 
00025 /* $Header: /home/hopper/src/cvs/C++/StrMod/StrMod/DynamicBuffer.h,v 1.8 2002/08/29 00:58:04 hopper Exp $ */
00026 
00027 // For a log, see ../ChangeLog
00028 
00029 #include <StrMod/BufferChunk.h>
00030 
00031 #define _STR_DynamicBuffer_H_
00032 
00033 namespace strmod {
00034 namespace strmod {
00035 
00036 /** \class DynamicBuffer DynamicBuffer.h StrMod/DynamicBuffer.h
00037  * \brief A completely dyamically allocated bag of bytes.
00038  */
00039 class DynamicBuffer : public BufferChunk
00040 {
00041  public:
00042    static const STR_ClassIdent identifier;
00043 
00044    DynamicBuffer()                                      { }
00045    DynamicBuffer(unsigned int len) throw(std::bad_alloc);
00046    DynamicBuffer(const void *data, unsigned int len) throw(std::bad_alloc);
00047    virtual ~DynamicBuffer();
00048 
00049    inline virtual int AreYouA(const lcore::ClassIdent &cid) const;
00050 
00051    virtual void resize(unsigned int newsize) throw(std::bad_alloc);
00052 
00053  protected:
00054    virtual const lcore::ClassIdent *i_GetIdent() const  { return &identifier; }
00055 };
00056 
00057 //-----------------------------inline functions--------------------------------
00058 
00059 inline int DynamicBuffer::AreYouA(const lcore::ClassIdent &cid) const
00060 {
00061    return((identifier == cid) || BufferChunk::AreYouA(cid));
00062 }
00063 
00064 }  // namespace strmod
00065 }  // namespace strmod
00066 
00067 #endif

Generated on Wed Jan 29 00:32:43 2003 for libNet by doxygen1.3-rc1