#include <ElementItem.h>
Inheritance diagram for aja::ElementItem:
Public Member Functions | |
ElementItem (number_t element_id, elementType_t type) | |
construct basic element | |
virtual | ~ElementItem () |
destructor free all allocated memory like added attributes, data etc.. | |
elementType_t | getElementType () |
Function return type of element(PARENT, STRING etc.. | |
number_t | getElementId () |
Function return element's ID. | |
void | clearAttributes () |
function clear all attributes in element | |
AttributeItem * | createStrAttribute (const byte_t attr_id, const char *attr_text) |
Function create string attribute in element. | |
AttributeItem * | createNumAttribute (const byte_t attr_id, number_t attr_num) |
Function create NUMBER attribute in element. | |
bool | addAttribute (AttributeItem *attr) |
function add attribute into element | |
byte_t | getAttributesCount () |
function retun count of attributes in element | |
AttributeItem * | getAttribute (byte_t id) |
Function return pointer to attribute of current id. | |
std::string | getAttributeStr (byte_t id) |
Function return text value of attribute in element. | |
int | getAttributeNum (byte_t id) |
Function return number of attribute like int. | |
ElementItem * | getParent () |
Function return pointer to parent element. | |
void | setParent (ElementItem *parent) |
Function set parent of this element. | |
virtual bool | buildAja (OutputBuffer &out) |
Function build ElementItem AJA binary form. | |
virtual number_t | getItemSize () |
function return complete size of element item(size of header + size of atributes + data size) | |
virtual number_t | getChildsCount () |
Function return count of child elements under this element. | |
virtual number_t | getChildsCount (number_t id) |
Function return count of child elements with current ID under this element. | |
virtual ElementItem * | getChild (unsigned int index) |
Function return child element at index position. | |
virtual ElementItem * | getChildByID (number_t id) |
Function return child element with current ID. | |
virtual bool | parseElmData (const buffer_t buffer, unsigned int size, unsigned int &pos)=0 |
Function is called when is needed parsed data part of element. | |
virtual std::string | getElementContent ()=0 |
Function return element content like a string. | |
Static Public Member Functions | |
static ElementItem * | parseElement (const buffer_t buffer, unsigned int size, unsigned int &pos) |
this is main element-parsing process. | |
Protected Attributes | |
elementType_t | mElementType |
element type (can be DATA, STRING, NUMBER etc) | |
number_t | mElementId: 24 |
24bit number representing element ID | |
byte_t | mAttributesCount |
count of attributes in element | |
attributeArray_t | mAttributes |
attributes associative array | |
ElementItem * | mParent |
pointer to parent element |
This class contain methods for manipulating with attributes, parsing attributes, lement ID etc and abstract function parseElmData.Child classes have code for parsing data part in this function.
|
construct basic element
|
|
destructor free all allocated memory like added attributes, data etc..
|
|
function add attribute into element Function add attribute pointer to array of attributes in class.
|
|
Function build ElementItem AJA binary form. In this function is implemented build process of every ElementItem child like ElementNumber, ElementParent etc.
Implements aja::Item. Reimplemented in aja::ElementData, aja::ElementNumber, aja::ElementParent, and aja::ElementString. |
|
function clear all attributes in element Function free all attributes from memory heap. |
|
Function create NUMBER attribute in element. This function create AttributeNumber element with current id and value.When is attribute correctly created, then is added into Element.
|
|
Function create string attribute in element. This function create AttributeData element with current id and value.When is attribute correctly created, then is added into Element.
|
|
Function return pointer to attribute of current id.
|
|
Function return number of attribute like int. This function check when exist attribute with id and convert his value to number when is possible.When attribute is not number, then is returned 0.
|
|
function retun count of attributes in element
|
|
Function return text value of attribute in element. This function check when exist attribute with id in element and then call his getValueStr().This function fill into res variable string form of attribute's data.
|
|
Function return child element at index position.
Reimplemented in aja::ElementParent. |
|
Function return child element with current ID.
Reimplemented in aja::ElementParent. |
|
Function return count of child elements with current ID under this element.
Reimplemented in aja::ElementParent. |
|
Function return count of child elements under this element.
Reimplemented in aja::ElementParent. |
|
Function return element content like a string. Into this function is necessary puting code who return string form of content.
Implemented in aja::ElementData, aja::ElementNumber, aja::ElementParent, and aja::ElementString. |
|
Function return element's ID.
|
|
Function return type of element(PARENT, STRING etc..
|
|
function return complete size of element item(size of header + size of atributes + data size)
Implements aja::Item. Reimplemented in aja::ElementData, aja::ElementNumber, aja::ElementParent, and aja::ElementString. |
|
Function return pointer to parent element.
Reimplemented from aja::Item. |
|
this is main element-parsing process. Function take a data, check it when is valid, parse it and create element(using Factory) instance by data.Function parse element's attributes too.After parsing function set into pos position in buffer after parsed data.
|
|
Function is called when is needed parsed data part of element. Into this function put your own code for parsing data part of element. This function take pointer to data(buffer contain data to parse), size of data and reference to position in data buffer.Where parsing is finish into pos reference parameter function put position after parsing.
Implemented in aja::ElementData, aja::ElementNumber, aja::ElementParent, and aja::ElementString. |
|
Function set parent of this element.
|
|
attributes associative array
|
|
count of attributes in element
|
|
24bit number representing element ID
|
|
element type (can be DATA, STRING, NUMBER etc)
|
|
pointer to parent element
Reimplemented from aja::Item. |