ALBA
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
albaTagArray Class Reference

#include <albaTagArray.h>

Inheritance diagram for albaTagArray:
Inheritance graph
[legend]
Collaboration diagram for albaTagArray:
Collaboration graph
[legend]

Public Types

typedef std::map< std::string, albaTagItemmmuTagsMap
 

Public Member Functions

 albaTagArray ()
 
 ~albaTagArray ()
 
 albaTypeMacro (albaTagArray, albaAttribute) void operator
 
bool operator== (const albaTagArray &a) const
 
albaTagItemGetTag (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
 
mmuTagsMapGetTagsContainer ()
 
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)
 
albaAttributeMakeCopy ()
 
bool Equals (const albaAttribute *a) const
 
void SetName (const char *name)
 
const char * GetName () const
 
albaObjectNewObjectInstance () const
 
albaAttributeNewInstance () 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 albaObjectNewObjectInstance () const =0
 
virtual const albaTypeIDGetTypeId () 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)
 
albaObjectCastToObject ()
 
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 albaTypeIDGetStaticTypeId ()
 
static albaObjectSafeDownCast (albaObject *o)
 
- Static Public Member Functions inherited from albaStorable
static albaStorableSafeCastToObject (albaObject *o)
 

Detailed Description

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.

See also
albaAttribute albaTagItem

Definition at line 36 of file albaTagArray.h.

Member Typedef Documentation

◆ mmuTagsMap

typedef std::map<std::string,albaTagItem> albaTagArray::mmuTagsMap

Definition at line 104 of file albaTagArray.h.

Constructor & Destructor Documentation

◆ albaTagArray()

albaTagArray::albaTagArray ( )

◆ ~albaTagArray()

albaTagArray::~albaTagArray ( )

Member Function Documentation

◆ albaTypeMacro()

albaTagArray::albaTypeMacro ( albaTagArray  ,
albaAttribute   
)

attributes must define a copy rule

◆ operator==()

bool albaTagArray::operator== ( const albaTagArray a) const

◆ GetTag() [1/2]

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().

◆ GetTag() [2/2]

bool albaTagArray::GetTag ( const char *  name,
albaTagItem item 
)

Get a particular tag item.

The object value is copied in the given item argument.

◆ IsTagPresent()

bool albaTagArray::IsTagPresent ( const char *  name)

return true if the give TAG exists.

◆ SetTag() [1/2]

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.

◆ SetTag() [2/2]

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

◆ DeleteTag()

void albaTagArray::DeleteTag ( const char *  name)

Remove an item from the array.

◆ GetTagList()

void albaTagArray::GetTagList ( std::vector< std::string > &  list)

Return the list of Tag names as an array of strings.

◆ Equals()

bool albaTagArray::Equals ( const albaTagArray array) const

Compare two tag arrays.

Order of items is significative for the comparison

◆ DeepCopy() [1/2]

void albaTagArray::DeepCopy ( const albaTagArray a)

copy the content of another array

◆ DeepCopy() [2/2]

void albaTagArray::DeepCopy ( const albaAttribute a)
virtual

copy the content of the given attribute.

Attributes must be type compatible

Reimplemented from albaAttribute.

◆ GetTagsByType()

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

◆ GetNumberOfTags()

int albaTagArray::GetNumberOfTags ( ) const

return the number of tags stored in this object

◆ GetTagsContainer()

mmuTagsMap * albaTagArray::GetTagsContainer ( )
inline

return the container of the tags stored in this attribute

Definition at line 107 of file albaTagArray.h.

◆ Print()

virtual void albaTagArray::Print ( std::ostream &  os,
const int  tabs = 0 
) const
virtual

dump tags stored into this array

Reimplemented from albaAttribute.

◆ InternalStore()

virtual int albaTagArray::InternalStore ( albaStorageElement node)
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.

◆ InternalRestore()

virtual int albaTagArray::InternalRestore ( albaStorageElement node)
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.

Member Data Documentation

◆ m_Tags

mmuTagsMap albaTagArray::m_Tags
protected

Definition at line 118 of file albaTagArray.h.


The documentation for this class was generated from the following file: