Public Member Functions | Public Attributes

BufferHolder Class Reference

I use this very simple class to pass buffers between libraries and the main program. More...

#include <BufferHolder.h>

List of all members.

Public Member Functions

 BufferHolder ()
 Default constructor.
 BufferHolder (const char *pstr, int str_size=0)
 Constructor - Just call Set.
void set (const char *pstr, int str_size=0)
 Set - initialize the Buffer Holder with a buffer or a "C" style string.
bool empty ()
 Returns True if BufferHoldr is empty.

Public Attributes

const char * pointer
 Pointer to the buffer we need to hold.
int size
 The size of the buffer.

Detailed Description

I use this very simple class to pass buffers between libraries and the main program.

it is just an easy way to transfer buffer that doesn't necessarily end with NULL. The recipient cannot (should not) change the buffer!!! Never!!! Everything is public here.

Note that this class may "point" to NULL, but you will never get a BufferHolder that holds NULL, from Beesnest!

This is the only "implemented" class I use in adapters/engines. Beesnest and the adapters/engines has to use exactly the same base class. However you can inherit from this class if you wish.

Definition at line 26 of file BufferHolder.h.


Constructor & Destructor Documentation

BufferHolder::BufferHolder (  ) [inline]

Default constructor.

Set an empty Buffer Holder.

Definition at line 38 of file BufferHolder.h.

BufferHolder::BufferHolder ( const char *  pstr,
int  str_size = 0 
) [inline]

Constructor - Just call Set.

Parameters:
pstrPointer to the buffer to hold.
str_sizeOptional, the buffer size. If missing, the size will be the size until the first NULL.

Definition at line 46 of file BufferHolder.h.


Member Function Documentation

bool BufferHolder::empty (  ) [inline]

Returns True if BufferHoldr is empty.

Definition at line 65 of file BufferHolder.h.

void BufferHolder::set ( const char *  pstr,
int  str_size = 0 
) [inline]

Set - initialize the Buffer Holder with a buffer or a "C" style string.

Parameters:
pstrPointer to the buffer to hold.
str_sizeOptional, the buffer size. If missing, the size will be the size until the first NULL.

Definition at line 56 of file BufferHolder.h.


Member Data Documentation

const char* BufferHolder::pointer

Pointer to the buffer we need to hold.

Definition at line 31 of file BufferHolder.h.

The size of the buffer.

Definition at line 33 of file BufferHolder.h.


The documentation for this class was generated from the following file: