SizeBuffer Class Reference

Contains a buffer, its maximum length and current length. More...

#include <SizeBuffer.h>

List of all members.

Public Member Functions

 SizeBuffer (uint capacity, uint length=0)
 ~SizeBuffer ()
void length (uint length)
uint length () const
uint capacity () const
PBuffer buffer () const

Protected Attributes

boost::scoped_array< fennel::FixedBufferbuf
uint cap
uint len


Detailed Description

Contains a buffer, its maximum length and current length.

Author:
John Kalucki
Since:
Aug 01, 2005
Version:
Id
//open/dev/fennel/common/SizeBuffer.h#7

Definition at line 39 of file SizeBuffer.h.


Constructor & Destructor Documentation

SizeBuffer::SizeBuffer ( uint  capacity,
uint  length = 0 
) [explicit]

Definition at line 29 of file SizeBuffer.cpp.

References buf, and FixedBuffer.

00030     : cap(capacity),
00031       len(length)
00032 {
00033     assert(length <= capacity);
00034     buf.reset(new fennel::FixedBuffer[capacity]);
00035 }

SizeBuffer::~SizeBuffer (  )  [inline]

Definition at line 43 of file SizeBuffer.h.

00044     {
00045     }


Member Function Documentation

void SizeBuffer::length ( uint  length  ) 

Definition at line 38 of file SizeBuffer.cpp.

References cap, and len.

00039 {
00040     assert(length <= cap);
00041     len = length;
00042 }

uint SizeBuffer::length (  )  const

Definition at line 44 of file SizeBuffer.cpp.

References len.

00045 {
00046     return len;
00047 }

uint SizeBuffer::capacity (  )  const

Definition at line 49 of file SizeBuffer.cpp.

References cap.

00050 {
00051     return cap;
00052 }

PBuffer SizeBuffer::buffer (  )  const

Definition at line 54 of file SizeBuffer.cpp.

References buf.

00055 {
00056     return buf.get();
00057 }


Member Data Documentation

boost::scoped_array<fennel::FixedBuffer> SizeBuffer::buf [protected]

Definition at line 58 of file SizeBuffer.h.

Referenced by buffer(), and SizeBuffer().

uint SizeBuffer::cap [protected]

Definition at line 59 of file SizeBuffer.h.

Referenced by capacity(), and length().

uint SizeBuffer::len [protected]

Definition at line 60 of file SizeBuffer.h.

Referenced by length().


The documentation for this class was generated from the following files:
Generated on Mon Jun 22 04:00:46 2009 for Fennel by  doxygen 1.5.1