/home/sn3d/devel/aja-ml/aja-lib/src/ElementItem.h

Go to the documentation of this file.
00001 /*******************************************************/
00009 #if !defined(_AJA_ELEMENTITEM_H_)
00010 #define _AJA_ELEMENTITEM_H_
00011 
00012 #include "aja.h"
00013 
00014 namespace aja
00015 {
00016         typedef std::map<byte_t, AttributeItem*> attributeArray_t; 
00017 
00018 
00019         /******************************************************/
00027         class ElementItem : public Item
00028         {
00029                 public:
00030                         ElementItem(number_t element_id, elementType_t type);
00031                         virtual ~ElementItem();
00032         
00034                 //        METHODS
00036                 public:
00037                         elementType_t       getElementType();
00038                         number_t            getElementId();
00039                         void                clearAttributes();
00040                         AttributeItem*      createStrAttribute(const byte_t attr_id, const char* attr_text);
00041                         AttributeItem*      createNumAttribute(const byte_t attr_id, number_t attr_num);
00042                         bool                addAttribute(AttributeItem* attr);
00043                         byte_t              getAttributesCount();
00044                         AttributeItem*      getAttribute(byte_t id);
00045                         std::string         getAttributeStr(byte_t id);
00046                         int                 getAttributeNum(byte_t id);
00047                         ElementItem*        getParent();
00048                         void                setParent(ElementItem* parent);
00049 
00050                         static ElementItem* parseElement(const buffer_t buffer, unsigned int size, unsigned int& pos); 
00051 
00052 
00054                 //        MEMBERS
00056                 protected:
00057                         elementType_t     mElementType;        
00058                         number_t          mElementId : 24;     
00059                         byte_t            mAttributesCount;    
00060                         attributeArray_t  mAttributes;         
00061                         ElementItem*      mParent;             
00062 
00063 
00065                 //       VIRTUAL FUNCTIONS
00067                 public:            
00068                         virtual bool         buildAja(OutputBuffer& out);
00069                         virtual number_t     getItemSize();
00070                         virtual number_t     getChildsCount();
00071                         virtual number_t     getChildsCount(number_t id);       
00072                         virtual ElementItem* getChild(unsigned int index);
00073                         virtual ElementItem* getChildByID(number_t id);                 
00074                 
00075                         
00076                         /*****************************************************/
00097                         virtual bool parseElmData(const buffer_t buffer, unsigned int size, unsigned int& pos) = 0;
00098 
00099                         
00100                         /****************************************************/
00109                         virtual std::string getElementContent() = 0;
00110 
00111         };
00112 }
00113 
00114 #endif

Generated on Sun Mar 4 00:30:36 2007 for LIBAJA by  doxygen 1.4.6