class Buffer

A class for storing buffered data. More...

Definition#include <buffer.hh>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

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 Mon Mar 10 19:34:43 2003, using kdoc 2.0a54+XORP.