ALBA
|
#include <albaTagArray.h>
Public Types | |
typedef std::map< std::string, albaTagItem > | mmuTagsMap |
Public Member Functions | |
albaTagArray () | |
~albaTagArray () | |
albaTypeMacro (albaTagArray, albaAttribute) void operator | |
bool | operator== (const albaTagArray &a) const |
albaTagItem * | GetTag (const char *name) |
bool | GetTag (const char *name, albaTagItem &item) |
bool | IsTagPresent (const char *name) |
void | SetTag (const albaTagItem &value) |
void | SetTag (const char *name, const char *value, int type=ALBA_MISSING_TAG) |
void | DeleteTag (const char *name) |
void | GetTagList (std::vector< std::string > &list) |
bool | Equals (const albaTagArray *array) const |
void | DeepCopy (const albaTagArray *a) |
void | DeepCopy (const albaAttribute *a) |
void | GetTagsByType (int type, std::vector< albaTagItem * > &array) |
int | GetNumberOfTags () const |
mmuTagsMap * | GetTagsContainer () |
virtual void | Print (std::ostream &os, const int tabs=0) const |
Public Member Functions inherited from albaAttribute | |
albaAbstractTypeMacro (albaAttribute, albaReferenceCounted) | |
void | operator= (const albaAttribute &a) |
bool | operator== (const albaAttribute &a) const |
virtual void | DeepCopy (const albaAttribute *a) |
albaAttribute * | MakeCopy () |
bool | Equals (const albaAttribute *a) const |
void | SetName (const char *name) |
const char * | GetName () const |
albaObject * | NewObjectInstance () const |
albaAttribute * | NewInstance () const |
virtual void | Print (std::ostream &os, const int tabs=0) const |
Public Member Functions inherited from albaReferenceCounted | |
albaReferenceCounted () | |
virtual | ~albaReferenceCounted () |
albaAbstractTypeMacro (albaReferenceCounted, albaObject) | |
virtual void | Delete () |
void | Register (void *obj) |
virtual void | UnRegister (void *obj) |
int | GetReferenceCount () |
void | SetReferenceCount (int) |
Public Member Functions inherited from albaObject | |
albaObject () | |
virtual | ~albaObject () |
virtual void | Delete () |
virtual const char * | GetTypeName () const |
virtual bool | IsA (const char *type_name) const |
virtual bool | IsA (const albaTypeID &type_id) const |
virtual albaObject * | NewObjectInstance () const =0 |
virtual const albaTypeID & | GetTypeId () const |
virtual void | Print (std::ostream &os, const int indent=0) const |
albaObject (const albaObject &c) | |
Public Member Functions inherited from albaStorable | |
albaStorable () | |
int | Store (albaStorageElement *element) |
int | Restore (albaStorageElement *element) |
albaObject * | CastToObject () |
bool | IsStorable () |
Protected Member Functions | |
virtual int | InternalStore (albaStorageElement *parent) |
virtual int | InternalRestore (albaStorageElement *node) |
virtual int | InternalStore (albaStorageElement *parent) |
virtual int | InternalRestore (albaStorageElement *node) |
virtual int | InternalStore (albaStorageElement *node)=0 |
virtual int | InternalRestore (albaStorageElement *node)=0 |
Protected Attributes | |
mmuTagsMap | m_Tags |
Protected Attributes inherited from albaAttribute | |
albaString | m_Name |
Protected Attributes inherited from albaReferenceCounted | |
int | m_ReferenceCount |
Protected Attributes inherited from albaObject | |
bool | m_HeapFlag |
Protected Attributes inherited from albaStorable | |
bool | m_Storable |
Additional Inherited Members | |
Static Public Member Functions inherited from albaObject | |
static const char * | GetStaticTypeName () |
static bool | IsStaticType (const char *type_name) |
static bool | IsStaticType (const albaTypeID &type_id) |
static const albaTypeID & | GetStaticTypeId () |
static albaObject * | SafeDownCast (albaObject *o) |
Static Public Member Functions inherited from albaStorable | |
static albaStorable * | SafeCastToObject (albaObject *o) |
An attribute used to store an associtive array of <key,value> pairs, where value is multi component.
albaTagArray is an attribute storing an associative array of <key,value> pairs (a map), where values are objects of type albaTagItem. A albaTagItem is a simple objet used to store an array of textual values.
Definition at line 36 of file albaTagArray.h.
typedef std::map<std::string,albaTagItem> albaTagArray::mmuTagsMap |
Definition at line 104 of file albaTagArray.h.
albaTagArray::albaTagArray | ( | ) |
albaTagArray::~albaTagArray | ( | ) |
albaTagArray::albaTypeMacro | ( | albaTagArray | , |
albaAttribute | |||
) |
attributes must define a copy rule
bool albaTagArray::operator== | ( | const albaTagArray & | a | ) | const |
albaTagItem * albaTagArray::GetTag | ( | const char * | name | ) |
provide access to vector items.
If idx is outside the result is invalid provide access to vector items. If idx is outside the result is invalid Get a particular tag item. The returned object is returned by reference.
Referenced by albaRestoreNumericFromTag(), and albaRestoreStringFromTag().
bool albaTagArray::GetTag | ( | const char * | name, |
albaTagItem & | item | ||
) |
Get a particular tag item.
The object value is copied in the given item argument.
bool albaTagArray::IsTagPresent | ( | const char * | name | ) |
return true if the give TAG exists.
void albaTagArray::SetTag | ( | const albaTagItem & | value | ) |
This function searches for an item with same Tag name of the given one and if it doesn't exist append a new one to the Array.
The given tag is copied and not referenced.
void albaTagArray::SetTag | ( | const char * | name, |
const char * | value, | ||
int | type = ALBA_MISSING_TAG |
||
) |
This function searches for an item with given name and if it doesn't exist append a new one to the Array, setting the value to the given value.
The given strings are copied and not referenced
void albaTagArray::DeleteTag | ( | const char * | name | ) |
Remove an item from the array.
void albaTagArray::GetTagList | ( | std::vector< std::string > & | list | ) |
Return the list of Tag names as an array of strings.
bool albaTagArray::Equals | ( | const albaTagArray * | array | ) | const |
Compare two tag arrays.
Order of items is significative for the comparison
void albaTagArray::DeepCopy | ( | const albaTagArray * | a | ) |
copy the content of another array
|
virtual |
copy the content of the given attribute.
Attributes must be type compatible
Reimplemented from albaAttribute.
void albaTagArray::GetTagsByType | ( | int | type, |
std::vector< albaTagItem * > & | array | ||
) |
Search the tag array for tags of a given type and put in the array pointers to them
int albaTagArray::GetNumberOfTags | ( | ) | const |
return the number of tags stored in this object
|
inline |
return the container of the tags stored in this attribute
Definition at line 107 of file albaTagArray.h.
|
virtual |
dump tags stored into this array
Reimplemented from albaAttribute.
|
protectedvirtual |
This is called by Store() and must be reimplemented by subclasses.
The node element where the object should store itself is passed as argument.
Reimplemented from albaAttribute.
|
protectedvirtual |
This is called by Restore() and must be reimplemented by subclasses The element from which the object should restore itself is passed as argument.
Reimplemented from albaAttribute.
|
protected |
Definition at line 118 of file albaTagArray.h.