aja::AttributeData Class Reference

Class representing DATA-ATTRIBUTE items. More...

#include <AttributeData.h>

Inheritance diagram for aja::AttributeData:

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

Public Member Functions

 AttributeData (byte_t id, const void *buffer, unsigned int size)
 AttributeData (byte_t id)
 construct a data attribute
virtual ~AttributeData ()
 destruct a data item.This destructor dont free allocated data space.For this operation you must call clearData().
buffer_t getData ()
 Function return pointer to data buffer.
dbyte_t getDataSize ()
 Function return size of data buffer.
void clearData ()
 Function clear stored data.
bool copyData (buffer_t buffer, unsigned int size)
 Fuction copy data into inner buffer.
bool copyData (const char *buffer, unsigned int size)
 Fuction copy char[] data into inner buffer.
bool setData (buffer_t buffer, unsigned int size)
 Function set data as inner store buffer.
number_t getItemSize ()
 Function return complete size of data attribute in bytes.
bool parseAttrData (buffer_t buffer, unsigned int size, unsigned int &pos)
 Function parse data for data attribute.
void getValueStr (std::string &out)
 Abstract function put into string parameter his value in string form.
bool buildAja (OutputBuffer &out)
 Function build AJA binary form of Data Attribute.

Protected Attributes

dbyte_t mDataSize
buffer_t mData

Detailed Description

Class representing DATA-ATTRIBUTE items.

Data attribute store a data like a array of bytes. Class contain pointer to this array 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).

See also:
aja::Item aja::AttributeItem


Constructor & Destructor Documentation

aja::AttributeData::AttributeData byte_t  id,
const void *  buffer,
unsigned int  size
 

aja::AttributeData::AttributeData byte_t  id  ) 
 

construct a data attribute

Parameters:
id attribute's ID from range 1-255 </pr>

aja::AttributeData::~AttributeData  )  [virtual]
 

destruct a data item.This destructor dont free allocated data space.For this operation you must call clearData().


Member Function Documentation

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

Function build AJA binary form of Data Attribute.

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::AttributeItem.

void aja::AttributeData::clearData  ) 
 

Function clear stored data.

This class store data at buffer created in heap.This function clear data and dealocate memory block of buffer.

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

Fuction copy char[] data into inner buffer.

Function first dealocate old data buffer,then allocate new space for new buffer and copy data into new inner buffer.Size of copied data can be maximal 16bit(0xFFFF) long.

Parameters:
buffer pointer to char[] array containing data
size size of char[] array
Returns:
TRUE when data are copyed ok, FALSE when error was occured

bool aja::AttributeData::copyData buffer_t  buffer,
unsigned int  size
 

Fuction copy data into inner buffer.

Function first dealocate old data buffer,then allocate new space for new buffer and copy data into new inner buffer.Size of copied data can be maximal 16bit(0xFFFF) long.

Parameters:
buffer source buffer containing data
size size of data in source buffer for copy
Returns:
TRUE when data are copyed ok, FALSE when error was occured

buffer_t aja::AttributeData::getData  ) 
 

Function return pointer to data buffer.

Returns:
pointer to data buffer

dbyte_t aja::AttributeData::getDataSize  ) 
 

Function return size of data buffer.

Returns:
size of data buffer

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

Function return complete size of data attribute in bytes.

Returns:
size of data attribute

Reimplemented from aja::AttributeItem.

void aja::AttributeData::getValueStr std::string &  out  )  [virtual]
 

Abstract function put into string parameter his value in string form.

In this overriden function is code for every child attribute type who convert his value to string form.

Parameters:
[out] this is reference to string where function put string value.

Implements aja::AttributeItem.

bool aja::AttributeData::parseAttrData buffer_t  buffer,
unsigned int  size,
unsigned int &  pos
[virtual]
 

Function parse data for data attribute.

This function is overriden and is called when is needed parse data for DATA ATTRIBUTE.Function dont copied parsed data, only set inner pointer to parsed data.When parsed data are deallocated, attribute lost your data.

See also:
aja::AttributeItem::parseAttrData

Implements aja::AttributeItem.

bool aja::AttributeData::setData buffer_t  buffer,
unsigned int  size
 

Function set data as inner store buffer.

Function only set inner pointers to this set buffer. Size of copied data can be maximal 16bit(0xFFFF)

Parameters:
buffer this buffer is set like inner buffer
size size of buffer
Returns:
TRUE when data are set OK, false when is error occurred (probably size is bigger like 16bits)


Member Data Documentation

buffer_t aja::AttributeData::mData [protected]
 

dbyte_t aja::AttributeData::mDataSize [protected]
 


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