BIE::TypedBuffer Class Reference

For holding a value that has a basic type. More...

#include <TypedBuffer.h>

Inheritance diagram for BIE::TypedBuffer:
Collaboration diagram for BIE::TypedBuffer:

List of all members.

Methods for getting a buffer value.

These methods return the value of a buffer.

The exception NoValueException is thrown if the buffer has no value. The exception TypeException is thrown if the buffer does not have a type that matches the method called.

BasicTypetb_type
 The type of the thing contained in the buffer.
bool tb_hasvalue
 True once the buffer holds a value.
class boost::serialization::access
virtual string getStringValue ()
 Returns the value from a buffer with type string.
virtual int getIntValue ()
 Returns the value from a buffer with type integer.
virtual double getRealValue ()
 Returns the value from a buffer with type real.
virtual bool getBoolValue ()
 Returns the value from a buffer with type bool.
virtual vector< int > getIntArrayValue ()
 Returns the integer array in an STL container.
virtual int getIntArrayValue (int offset)
 Returns the integer value in the array with given offset.
virtual vector< double > getRealArrayValue ()
 Returns the double array in an STL container.
virtual double getRealArrayValue (int offset)
 Returns the double value in the array with given offset.
virtual vector< bool > getBoolArrayValue ()
 Returns the bool array in an STL container.
virtual bool getBoolArrayValue (int offset)
 Returns the bool value in the array with given offset.
BasicTypegetType ()
 Returns the type descriptor for the buffer.
bool hasValue ()
 Returns true if the buffer contains a value.
void reset ()
 Erases any value the buffer has, such that hasValue() will return false.
virtual string toString ()=0
 Returns a string representation of the typed buffer.

Public Member Functions

 TypedBuffer ()
 Default constructor.
virtual ~TypedBuffer ()
 Frees memory used by the typed buffers. Implemented by subclasses.
virtual void setStringValue (string)
 Sets the value of a string buffer.
virtual void setIntValue (int)
 Sets the value of an integer string buffer.
virtual void setRealValue (double)
 Sets the value of a real buffer.
virtual void setBoolValue (bool)
 Sets the value of a bool buffer.
virtual void setIntArrayValue (vector< int >)
 Sets the values of an integer array.
virtual void setIntArrayValue (int iv)
 Add a single integer value to the array.
virtual void setIntArrayValue (int offset, int iv)
 Add a single integer value to the array with a particular offset.
virtual void setRealArrayValue (vector< double >)
 Sets the values of an real (double) array.
virtual void setRealArrayValue (double)
 Add a single double value to the array.
virtual void setRealArrayValue (int offset, double dv)
 Add a single double value to the array with a particular offset.
virtual void setBoolArrayValue (vector< bool >)
 Sets the values of an integer array.
virtual void setBoolArrayValue (bool bv)
 Add a single double value to the array.
virtual void setBoolArrayValue (int offset, bool bv)
 Add a single bool value to the array with a particular offset.

Static Public Member Functions

static TypedBuffercreateNew (BasicType *)
 Creates a new TypedBuffer object with the given basic type.


Detailed Description

For holding a value that has a basic type.

Operations for setting and retreiving the value in the buffer. This is an abstract class, and the implementation of each of the basic types is left to subclasses.

The default set and get methods throw a TypeException - subclasses only need to implement the methods relating to its own type, meaning that where types do not match an exception is thrown.


Member Function Documentation

static TypedBuffer* BIE::TypedBuffer::createNew ( BasicType  )  [static]

Creates a new TypedBuffer object with the given basic type.

The object will contain no value until one is set using one of the value setting functions.

virtual void BIE::TypedBuffer::setStringValue ( string   )  [virtual]

Sets the value of a string buffer.

Will throw an exception if the buffer's type is not string.

Reimplemented in BIE::TypedBuffer_String.

virtual void BIE::TypedBuffer::setIntValue ( int   )  [virtual]

Sets the value of an integer string buffer.

Will throw an exception if the buffer's type is not integer.

Reimplemented in BIE::TypedBuffer_Int.

virtual void BIE::TypedBuffer::setRealValue ( double   )  [virtual]

Sets the value of a real buffer.

Will throw an exception if the buffer's type is not real.

Reimplemented in BIE::TypedBuffer_Real.

virtual void BIE::TypedBuffer::setBoolValue ( bool   )  [virtual]

Sets the value of a bool buffer.

Will throw an exception if the buffer's type is not bool.

Reimplemented in BIE::TypedBuffer_Bool.

virtual void BIE::TypedBuffer::setIntArrayValue ( vector< int >   )  [virtual]

Sets the values of an integer array.

Will throw an exception if the type is wrong. STL vector input

Reimplemented in BIE::TypedBuffer_IntArray.

virtual void BIE::TypedBuffer::setRealArrayValue ( vector< double >   )  [virtual]

Sets the values of an real (double) array.

STL vector input

Reimplemented in BIE::TypedBuffer_RealArray.

virtual void BIE::TypedBuffer::setBoolArrayValue ( vector< bool >   )  [virtual]

Sets the values of an integer array.

STL vector input

Reimplemented in BIE::TypedBuffer_BoolArray.

virtual string BIE::TypedBuffer::getStringValue (  )  [virtual]

Returns the value from a buffer with type string.

The buffer must contain a value.

Reimplemented in BIE::TypedBuffer_String.

virtual int BIE::TypedBuffer::getIntValue (  )  [virtual]

Returns the value from a buffer with type integer.

The buffer must contain a value.

Reimplemented in BIE::TypedBuffer_Int.

virtual double BIE::TypedBuffer::getRealValue (  )  [virtual]

Returns the value from a buffer with type real.

The buffer must contain a value.

Reimplemented in BIE::TypedBuffer_Real.

virtual bool BIE::TypedBuffer::getBoolValue (  )  [virtual]

Returns the value from a buffer with type bool.

The buffer must contain a value.

Reimplemented in BIE::TypedBuffer_Bool.

void BIE::TypedBuffer::reset (  )  [inline]

Erases any value the buffer has, such that hasValue() will return false.

until a set___Value method is called.


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

Send suggestions, questions, and feedback to WEINBERG at ASTRO dot UMASS dot EDU.
Documentation generated at Fri Mar 26 00:35:13 2010 by doxygen