class Buffer

A class for storing buffered data. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Methods


Detailed Description

This class can be used to conveniently store data. Note: currently it has limited functionalities; more will be added in the future.

explicit  Buffer (size_t init_max_size)

Buffer

Constructor of a buffer of specified size.

Parameters:

init_max_sizethe maximum amount of data that can be stored in the buffer.
 ~Buffer ()

~Buffer

Destructor

void  reset ()

reset

Reset/remove the data in the buffer.

size_t  max_size ()

max_size

[const]

Returns: the maximum amount of data that can be stored in the buffer.

size_t  data_size ()

data_size

[const]

Returns: the amount of data in the buffer.

uint8_t  data (size_t offset)
throw (InvalidBufferOffset)

data

[const]

Get the data value of the octet at the specified offset.

Parameters:

offsetthe data offset from the beginning of the buffer.

Returns: the data value at offset.

uint8_t * data ()

data

Returns: a pointer to the data in the buffer.

int  add_data (uint8_t value)

add_data

Add a data octet to the buffer.

Parameters:

valuethe value of the data octet to add to the buffer.

Returns: XORP_OK on success, otherwise XORP_ERROR.

bool  is_full ()

is_full

[const]

Test if the buffer is full.

Returns: true if the buffer is full, otherwise false.


Generated by: pavlin on possum.icir.org on Wed Apr 13 21:52:49 2005, using kdoc $.