gusimplewhiteboard
WBMsg Class Reference

Old WB class for storing shared data. More...

#include <WBMsg.h>

Collaboration diagram for WBMsg:

Public Types

enum  wb_type {
  TypeBool , TypeInt , TypeFloat , TypeString ,
  TypeArray , TypeBinary , TypeEmpty
}
 Message internal Datatype Enum. More...
 
typedef enum WBMsg::wb_type WBType
 Message internal Datatype Enum. More...
 

Public Member Functions

 WBMsg (const WBMsg &orig)
 WBMsg - copy constructor. More...
 
 WBMsg ()
 WBMsg - empty constructor. More...
 
 WBMsg (bool val)
 WBMsg - Boolean constructor. More...
 
 WBMsg (int val)
 WBMsg - Integer constructor. More...
 
 WBMsg (float val)
 WBMsg - Float constructor. More...
 
 WBMsg (const std::string &val)
 WBMsg - String constructor. More...
 
 WBMsg (const char *val)
 WBMsg - String constructor. More...
 
 WBMsg (const void *data, int nBytes, bool needsFree=false)
 WBMsg - Binary data constructor. More...
 
 WBMsg (const std::vector< int > *val, bool needsFree=false)
 WBMsg - Vector<int> pointer constructor. More...
 
 WBMsg (const std::vector< int > &val, bool needsFree=false)
 WBMsg - Vector<int> constructor. More...
 
WBType getType () const
 getType. More...
 
void setTypeName (const std::string &t)
 setTypeName More...
 
const std::string & getTypeName () const
 getTypeName More...
 
int getLifeSpan () const
 getLifeSpan More...
 
void setLifeSpan (int life)
 setLifeSpan More...
 
bool boolValue () const
 boolValue. More...
 
int intValue () const
 intValue. More...
 
int floatValue () const
 floatValue. More...
 
const std::string stringValue () const
 stringValue. More...
 
bool getBoolValue () const
 getBoolValue. More...
 
int getIntValue () const
 getIntValue. More...
 
float getFloatValue () const
 getFloatValue. More...
 
const std::string & getStringValue () const
 getStringValue. More...
 
const void * getBinaryValue () const
 getBinaryValue. More...
 
const std::vector< int > & getArrayValue () const
 getArrayValue. More...
 
int getSizeInBytes () const
 getSizeInBytes. More...
 
 ~WBMsg ()
 default destructor More...
 

Detailed Description

Old WB class for storing shared data.

Definition at line 85 of file WBMsg.h.

Member Typedef Documentation

◆ WBType

Message internal Datatype Enum.

Allows the user to test the datatype of the message

Member Enumeration Documentation

◆ wb_type

Message internal Datatype Enum.

Allows the user to test the datatype of the message

Enumerator
TypeBool 
TypeInt 
TypeFloat 
TypeString 
TypeArray 
TypeBinary 
TypeEmpty 

Definition at line 92 of file WBMsg.h.

Constructor & Destructor Documentation

◆ WBMsg() [1/10]

WBMsg::WBMsg ( const WBMsg orig)
inline

WBMsg - copy constructor.

Initialises a WBMsg with copied data.

Parameters
origoritinal data to copy

Definition at line 123 of file WBMsg.h.

◆ WBMsg() [2/10]

WBMsg::WBMsg ( )
inline

WBMsg - empty constructor.

Initialises a WBMsg with no attached data.

Definition at line 129 of file WBMsg.h.

◆ WBMsg() [3/10]

WBMsg::WBMsg ( bool  val)
inline

WBMsg - Boolean constructor.

Initialises a WBMsg with a given boolean value.

Parameters
valBoolean value to store in the Whiteboard message.

Definition at line 136 of file WBMsg.h.

◆ WBMsg() [4/10]

WBMsg::WBMsg ( int  val)
inline

WBMsg - Integer constructor.

Initialises a WBMsg with a given int value.

Parameters
valInt value to store in the Whiteboard message.

Definition at line 144 of file WBMsg.h.

◆ WBMsg() [5/10]

WBMsg::WBMsg ( float  val)
inline

WBMsg - Float constructor.

Initialises a WBMsg with a given float value.

Parameters
valFloat value to store in the Whiteboard message.

Definition at line 151 of file WBMsg.h.

◆ WBMsg() [6/10]

WBMsg::WBMsg ( const std::string &  val)
inline

WBMsg - String constructor.

Initialises a WBMsg with a standard C++ string value.

Parameters
valString to store in the Whiteboard message.

Definition at line 158 of file WBMsg.h.

◆ WBMsg() [7/10]

WBMsg::WBMsg ( const char *  val)
inline

WBMsg - String constructor.

Initialises a WBMsg with a standard C string value.

Parameters
valString to store in the Whiteboard message.

Definition at line 165 of file WBMsg.h.

◆ WBMsg() [8/10]

WBMsg::WBMsg ( const void *  data,
int  nBytes,
bool  needsFree = false 
)
inline

WBMsg - Binary data constructor.

Initialises a WBMsg with some binary data.

Parameters
dataPointer to a data constrct to store in the Whiteboard message.
nBytesSize of the data in bytes.
needsFreeIf this is non-zero, will free the contents of the data buffer when this WBMsg is deleted.

Definition at line 176 of file WBMsg.h.

◆ WBMsg() [9/10]

WBMsg::WBMsg ( const std::vector< int > *  val,
bool  needsFree = false 
)
inline

WBMsg - Vector<int> pointer constructor.

Initialises a WBMsg with a standard C++ string value.

Parameters
valString to store in the Whiteboard message.
needsFreeIf this is non-zero, will free the contents of the data buffer when this WBMsg is deleted.

Definition at line 185 of file WBMsg.h.

◆ WBMsg() [10/10]

WBMsg::WBMsg ( const std::vector< int > &  val,
bool  needsFree = false 
)
inline

WBMsg - Vector<int> constructor.

Initialises a WBMsg with a standard C++ string value.

Parameters
valString to store in the Whiteboard message.
needsFreedestroys the original vector immediately if true

Definition at line 193 of file WBMsg.h.

◆ ~WBMsg()

WBMsg::~WBMsg ( )
inline

default destructor

Definition at line 405 of file WBMsg.h.

References arrayVal, binaryVal, TypeArray, and TypeBinary.

Member Function Documentation

◆ boolValue()

bool WBMsg::boolValue ( ) const
inline

boolValue.

Returns
The value of this message "intelligently" interpreted as a boolean

Definition at line 233 of file WBMsg.h.

References arrayVal, boolVal, floatVal, intVal, TypeArray, TypeBool, TypeFloat, TypeInt, and TypeString.

◆ floatValue()

int WBMsg::floatValue ( ) const
inline

floatValue.

Returns
Message value "intelligently" interpreted as float

Definition at line 283 of file WBMsg.h.

References arrayVal, boolVal, floatVal, intVal, TypeArray, TypeBool, TypeFloat, TypeInt, and TypeString.

◆ getArrayValue()

const std::vector< int > & WBMsg::getArrayValue ( ) const
inline

getArrayValue.

Returns
The array<int> value of this WBMsg if it is storing an array. undefined otherwise.

Definition at line 393 of file WBMsg.h.

References arrayVal.

Referenced by guWhiteboard::Whiteboard::addMessage().

◆ getBinaryValue()

const void * WBMsg::getBinaryValue ( ) const
inline

getBinaryValue.

Returns
The data buffer of this WBMsg if it is storing binary data. Returns NULL otherwise.

Definition at line 386 of file WBMsg.h.

References binaryVal.

Referenced by guWhiteboard::Whiteboard::addMessage().

◆ getBoolValue()

bool WBMsg::getBoolValue ( ) const
inline

getBoolValue.

Returns
The boolean value of this WBMsg if it is storing a boolean. Returns NULL otherwise.

Definition at line 358 of file WBMsg.h.

References boolVal.

Referenced by guWhiteboard::Whiteboard::addMessage().

◆ getFloatValue()

float WBMsg::getFloatValue ( ) const
inline

getFloatValue.

Returns
The float value of this WBMsg if it is storing a float. Returns NULL otherwise.

Definition at line 372 of file WBMsg.h.

References floatVal.

Referenced by guWhiteboard::Whiteboard::addMessage().

◆ getIntValue()

int WBMsg::getIntValue ( ) const
inline

getIntValue.

Returns
The int value of this WBMsg if it is storing an int. Returns NULL otherwise.

Definition at line 365 of file WBMsg.h.

References intVal.

Referenced by guWhiteboard::Whiteboard::addMessage().

◆ getLifeSpan()

int WBMsg::getLifeSpan ( ) const
inline

getLifeSpan

Returns
The original message lifespan

Definition at line 216 of file WBMsg.h.

References GU_SIMPLE_WHITEBOARD_GENERATIONS.

◆ getSizeInBytes()

int WBMsg::getSizeInBytes ( ) const
inline

getSizeInBytes.

Returns
The size in bytes of the data buffer of this WBMsg if it is storing binary data. Returns NULL otherwise.

Definition at line 400 of file WBMsg.h.

Referenced by guWhiteboard::Whiteboard::addMessage().

◆ getStringValue()

const std::string & WBMsg::getStringValue ( ) const
inline

getStringValue.

Returns
The string value of this WBMsg if it is storing a string. Returns an empty string otherwise.

Definition at line 379 of file WBMsg.h.

Referenced by guWhiteboard::Whiteboard::addMessage().

◆ getType()

WBType WBMsg::getType ( ) const
inline

getType.

Returns
The data type this WBMsg represents as a WBType.

Definition at line 199 of file WBMsg.h.

Referenced by guWhiteboard::Whiteboard::addMessage().

◆ getTypeName()

const std::string & WBMsg::getTypeName ( ) const
inline

getTypeName

Returns
The message type string

Definition at line 210 of file WBMsg.h.

◆ intValue()

int WBMsg::intValue ( ) const
inline

intValue.

Returns
Message value "intelligently" interpreted as integer

Definition at line 260 of file WBMsg.h.

References arrayVal, boolVal, floatVal, intVal, TypeArray, TypeBool, TypeFloat, TypeInt, and TypeString.

◆ setLifeSpan()

void WBMsg::setLifeSpan ( int  life)
inline

setLifeSpan

Definition at line 221 of file WBMsg.h.

◆ setTypeName()

void WBMsg::setTypeName ( const std::string &  t)
inline

setTypeName

Definition at line 204 of file WBMsg.h.

◆ stringValue()

const std::string WBMsg::stringValue ( ) const
inline

stringValue.

Returns
The value of this message "intelligently" interpreted as a string

Definition at line 306 of file WBMsg.h.

References arrayVal, binaryVal, boolVal, floatVal, intVal, TypeArray, TypeBinary, TypeBool, TypeFloat, TypeInt, and TypeString.

Member Data Documentation

◆ arrayVal

const std::vector<int>* WBMsg::arrayVal

Definition at line 109 of file WBMsg.h.

Referenced by ~WBMsg(), boolValue(), floatValue(), getArrayValue(), intValue(), and stringValue().

◆ binaryVal

const void* WBMsg::binaryVal

Definition at line 108 of file WBMsg.h.

Referenced by ~WBMsg(), getBinaryValue(), and stringValue().

◆ boolVal

bool WBMsg::boolVal

Definition at line 105 of file WBMsg.h.

Referenced by boolValue(), floatValue(), getBoolValue(), intValue(), and stringValue().

◆ floatVal

float WBMsg::floatVal

Definition at line 107 of file WBMsg.h.

Referenced by boolValue(), floatValue(), getFloatValue(), intValue(), and stringValue().

◆ intVal

int WBMsg::intVal

Definition at line 106 of file WBMsg.h.

Referenced by boolValue(), floatValue(), getIntValue(), intValue(), and stringValue().


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