aja::ElementData Class Reference

class representing DATA-ELEMENT items More...

#include <ElementData.h>

Inheritance diagram for aja::ElementData:

aja::ElementItem aja::Item List of all members.

Public Member Functions

 ElementData (number_t id, const void *buffer, unsigned int size)
 construct empty data element with current id
 ElementData (number_t id)
 construct empty data element with current id
virtual ~ElementData ()
 destroy element. Before destroying is necessary call clearData() when data buffer was allocated by this class(copyData for example)
buffer_t getData ()
 Function return pointer to data buffer.
number_t getDataSize ()
 Function return size of data.
void clearData ()
 Function erase-free data of element.
bool copyData (buffer_t buffer, number_t size)
 Function copy data into element.
bool copyData (const char *buffer, unsigned int size)
 Function copy char[] into element.
bool setData (buffer_t buffer, number_t size)
 Function set data for element.
bool setData (const char *buffer, unsigned int size)
 Function set data for element.
bool buildAja (OutputBuffer &out)
 Function build AJA binary form of DATA ELEMENT.
bool parseElmData (buffer_t buffer, unsigned int size, unsigned int &pos)
 Function parse data in element.
std::string getElementContent ()
 Function return content of data element like string.
number_t getItemSize ()
 Function return complete size of element data.

Protected Attributes

buffer_t mData
 pointer to buffer containing data od element
number_t mSize
 size of data buffer

Detailed Description

class representing DATA-ELEMENT items

class representing data element for storing, parsing and manipulating with any data in element.

This class contain inner pointer to data buffer and his size.Before you destroy this class, you must clear data because class dont deallocate inner buffer. It is needed because element can contain pointer to data allocated by someone other(AML document for example).


Constructor & Destructor Documentation

aja::ElementData::ElementData number_t  id,
const void *  buffer,
unsigned int  size
 

construct empty data element with current id

Data are referenced, not copied.Be carrefull when you free these data.Then this element dont work good.

Parameters:
id id of elemen
buffer pointer to buffer
size buffer size

aja::ElementData::ElementData number_t  id  ) 
 

construct empty data element with current id

Parameters:
id id of element

aja::ElementData::~ElementData  )  [virtual]
 

destroy element. Before destroying is necessary call clearData() when data buffer was allocated by this class(copyData for example)


Member Function Documentation

bool aja::ElementData::buildAja OutputBuffer out  )  [virtual]
 

Function build AJA binary form of DATA ELEMENT.

Parameters:
out Into this class is written AJA binary result of building process.
Returns:
true id ok, false when error was occurred

Reimplemented from aja::ElementItem.

void aja::ElementData::clearData  ) 
 

Function erase-free data of element.

Function free allocated space for element data buffer.

bool aja::ElementData::copyData const char *  buffer,
unsigned int  size
 

Function copy char[] into element.

This function first erase element data when exist.Then allocate needed memory space and copy data form source buffer into this space.

Parameters:
buffer source buffer
size size of copied data from buffer
Returns:
true = ok, false = error occured

bool aja::ElementData::copyData buffer_t  buffer,
number_t  size
 

Function copy data into element.

This function first erase element data when exist.Then allocate needed memory space and copy data form source buffer into this space.

Parameters:
buffer source buffer
size size of copied data from buffer
Returns:
true = ok, false = error occured

buffer_t aja::ElementData::getData  ) 
 

Function return pointer to data buffer.

Returns:
pointer to data

number_t aja::ElementData::getDataSize  ) 
 

Function return size of data.

Returns:
size of data buffer array

string aja::ElementData::getElementContent  )  [virtual]
 

Function return content of data element like string.

Returns:
content of element like string

Implements aja::ElementItem.

number_t aja::ElementData::getItemSize  )  [virtual]
 

Function return complete size of element data.

Returns:
size of element data in bytes

Reimplemented from aja::ElementItem.

bool aja::ElementData::parseElmData buffer_t  buffer,
unsigned int  size,
unsigned int &  pos
[virtual]
 

Function parse data in element.

Function dont allocate new memory-space. Function only set pointer to data.Be carefull, when parsed data are deallocated, element lost his data.

Parameters:
buffer buffer contain data
size size of buffer
pos this is input and output parameter. It is actual position in buffer.
Returns:
true=ok, false=data are not parsed

Implements aja::ElementItem.

bool aja::ElementData::setData const char *  buffer,
unsigned int  size
 

Function set data for element.

This function first erase old data.Be carrefull, function dont create new space for data, only set element's inner members for using current data pointer and size

Parameters:
buffer pointer to data buffer can be set
size size of buffer can be set
Returns:
true=ok, false=error occured

bool aja::ElementData::setData buffer_t  buffer,
number_t  size
 

Function set data for element.

This function first erase old data.Be carrefull, function dont create new space for data, only set element's inner members for using current data pointer and size

Parameters:
buffer pointer to data buffer can be set
size size of buffer can be set
Returns:
true=ok, false=error occured


Member Data Documentation

buffer_t aja::ElementData::mData [protected]
 

pointer to buffer containing data od element

number_t aja::ElementData::mSize [protected]
 

size of data buffer


The documentation for this class was generated from the following files:
Generated on Sun Mar 4 00:30:37 2007 for LIBAJA by  doxygen 1.4.6