aja::AttributeItem Class Reference

basic class for Attributes More...

#include <AttributeItem.h>

Inheritance diagram for aja::AttributeItem:

aja::Item aja::AttributeData aja::AttributeNumber List of all members.

Public Member Functions

 AttributeItem (byte_t id, attributeType_t type)
 Constructor create attribute of current type and ID.
virtual ~AttributeItem ()
attributeType_t getAttrType ()
 Function return a type of Attribute.
byte_t getAttrId ()
 Function return attribute's ID.
void setAttrId (byte_t id)
 Function set ID of attribute.
virtual bool buildAja (OutputBuffer &out)
 Function build AJA binary form of Attrs/.
virtual number_t getItemSize ()
 Function return complete size of attribute item(size of attribute's header + data size).
virtual bool parseAttrData (buffer_t buffer, unsigned int size, unsigned int &pos)=0
 abstract function contain code for parsing data of attribute.
virtual void getValueStr (std::string &out)=0
 Abstract function put into string parameter his value in string form.

Static Public Member Functions

static AttributeItemparseAttribute (const buffer_t buffer, unsigned int size, unsigned int &pos)
 Parse data and create attribute instance by parsed data.

Protected Attributes

byte_t mAttrId
 ID of attribute.
attributeType_t mAttrType
 Attribute type.

Detailed Description

basic class for Attributes

This class is inherited from Item class.It is basic class for all ITM_ATTRIBUTE items.This class have abstract function parseAttrData() and into this funciton you add your won code for parsing data part of attribue


Constructor & Destructor Documentation

aja::AttributeItem::AttributeItem byte_t  id,
attributeType_t  type
 

Constructor create attribute of current type and ID.

Parameters:
id attribute's ID from range 1-255
type type of attribute(see attributeType_t)

aja::AttributeItem::~AttributeItem  )  [virtual]
 


Member Function Documentation

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

Function build AJA binary form of Attrs/.

In this function is implemented build process of every attribute item child like AttributeNumber, AttributeData, etc.

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

Implements aja::Item.

Reimplemented in aja::AttributeData, and aja::AttributeNumber.

byte_t aja::AttributeItem::getAttrId  ) 
 

Function return attribute's ID.

Returns:
ID of attribute

attributeType_t aja::AttributeItem::getAttrType  ) 
 

Function return a type of Attribute.

Returns:
attribute type

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

Function return complete size of attribute item(size of attribute's header + data size).

Returns:
size of attribute in bytes

Implements aja::Item.

Reimplemented in aja::AttributeData, and aja::AttributeNumber.

virtual void aja::AttributeItem::getValueStr std::string &  out  )  [pure 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.

Implemented in aja::AttributeData, and aja::AttributeNumber.

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

abstract function contain code for parsing data of attribute.

This function take pointer to data(buffer), size of data and reference to position in data buffer. Into this function put your own code for parsing data part of attribute.

Parameters:
buffer buffer containing data to parse
size size of buffer
pos This is in/out parameter.It is reference to position in buffer.Can be 0 at start, but in the end of function, this variable must contain size of parsed data + position at start
Returns:
TRUE if data are correctly parsed, FALSE when parsing occured error

Implemented in aja::AttributeData, and aja::AttributeNumber.

AttributeItem * aja::AttributeItem::parseAttribute const buffer_t  buffer,
unsigned int  size,
unsigned int &  pos
[static]
 

Parse data and create attribute instance by parsed data.

This is main process of parsing attributes contained checking of attribute, factoring current type and parsing data part of attribute.Result is new created instance of attribute on heap.Function after parsing set pos reference after parsed data.

Parameters:
buffer buffer contain data for parsing
size size of this buffer
pos position in buffer
Returns:
pointer to new created attribute instance, when some error was occured, then is returned NULL.

void aja::AttributeItem::setAttrId byte_t  id  ) 
 

Function set ID of attribute.

Parameters:
id this ID set to attribute


Member Data Documentation

byte_t aja::AttributeItem::mAttrId [protected]
 

ID of attribute.

attributeType_t aja::AttributeItem::mAttrType [protected]
 

Attribute type.


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