aja::ElementParent Class Reference

class representing Element who contain other child elements. More...

#include <ElementParent.h>

Inheritance diagram for aja::ElementParent:

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

Public Member Functions

 ElementParent (number_t id)
 Construct empty parent element with current ID.
 ~ElementParent ()
 destroy parent element and his child elements.
void clearChilds ()
 Function destroy all child elements.
number_t getChildsCount ()
 Function get count of all child elements.
number_t getChildsCount (number_t id)
 Function get count of all child elements where occurences ID.
ElementItemgetChild (unsigned int index)
 Function return child element at current position in array.
ElementItemgetChildByID (number_t id)
 Function return first child element of current ID.
bool addChild (ElementItem *element)
 Function insert new child element.
number_t getDataSize ()
 Function return size of data in parent element.
bool buildAja (OutputBuffer &out)
 Function build ElementItem AJA binary form.
bool parseElmData (buffer_t buffer, unsigned int size, unsigned int &pos)
 function is called when is needed parse data part of parent element.
std::string getElementContent ()
 Function return content of element like a string.
number_t getItemSize ()
 function return complete size of element item(size of header + size of atributes + data size)

Protected Attributes

elementArray_t mChildElements
 array of child elements

Detailed Description

class representing Element who contain other child elements.

Class contain functions for manipulating with childs, for parsing etc... Class contain inner special array who contain child elements.


Constructor & Destructor Documentation

aja::ElementParent::ElementParent number_t  id  ) 
 

Construct empty parent element with current ID.

Parameters:
id ID of element

aja::ElementParent::~ElementParent  ) 
 

destroy parent element and his child elements.


Member Function Documentation

bool aja::ElementParent::addChild ElementItem element  ) 
 

Function insert new child element.

Parameters:
element pointer to added element
Returns:
true=element added, false=error occured

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

Function build ElementItem AJA binary form.

In this function is implemented build process of every ElementItem child like ElementNumber, ElementParent etc.

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::ElementParent::clearChilds  ) 
 

Function destroy all child elements.

ElementItem * aja::ElementParent::getChild unsigned int  index  )  [virtual]
 

Function return child element at current position in array.

When dont exist or array is smaller like index, is returned NULL.

Parameters:
index index in array.
Returns:
pointer to child element, NULL when error occured.

Reimplemented from aja::ElementItem.

ElementItem * aja::ElementParent::getChildByID number_t  id  )  [virtual]
 

Function return first child element of current ID.

Parameters:
id id of element item
Returns:
pointer to child element with ID, NULL when dont exist child with this ID.

Reimplemented from aja::ElementItem.

number_t aja::ElementParent::getChildsCount number_t  id  )  [virtual]
 

Function get count of all child elements where occurences ID.

Parameters:
id element ID for counting
Returns:
count of child elements

Reimplemented from aja::ElementItem.

number_t aja::ElementParent::getChildsCount  )  [virtual]
 

Function get count of all child elements.

Returns:
count of child elements

Reimplemented from aja::ElementItem.

number_t aja::ElementParent::getDataSize  ) 
 

Function return size of data in parent element.

Function go throught all element's child items and calculate size.

Returns:
size of data in parent element

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

Function return content of element like a string.

Returns:
return string content

Implements aja::ElementItem.

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

function return complete size of element item(size of header + size of atributes + data size)

Returns:
size of element in bytes

Reimplemented from aja::ElementItem.

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

function is called when is needed parse data part of parent element.

This function parse all childs elements in parent element and add it into inner array of parent element. Size of data part is limited.Sum of all childs data must be maximal 32bit unsigned int(0xFFFFFFFF)

Parameters:
buffer buffer contain data to parse
size size of buffer
pos position in buffer
Returns:
true=when data part is parsed correctly, false=when some parsing-error occured

Implements aja::ElementItem.


Member Data Documentation

elementArray_t aja::ElementParent::mChildElements [protected]
 

array of child elements


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