ALBA
|
#include <albaTagItem.h>
Public Member Functions | |
albaTagItem () | |
~albaTagItem () | |
albaTagItem (const char *name, const char *value, int t=ALBA_STRING_TAG) | |
albaTagItem (const char *name, const char **values, int numcomp, int t=ALBA_STRING_TAG) | |
albaTagItem (const char *name, const std::vector< albaString > &values, int numcomp, int t=ALBA_STRING_TAG) | |
albaTagItem (const char *name, const double value) | |
albaTagItem (const char *name, const double *value, int numcomp) | |
albaTagItem (const char *name, const std::vector< double > &values, int numcomp) | |
albaTagItem (const albaTagItem &p) | |
void | operator= (const albaTagItem &p) |
bool | operator== (const albaTagItem &p) const |
bool | operator!= (const albaTagItem &p) const |
virtual void | Print (std::ostream &os, const int indent=0) const |
void | SetName (const char *name) |
const char * | GetName () const |
void | SetValue (const albaString value, int component=0) |
void | SetComponent (const albaString value, int component=0) |
void | SetValue (const double value, int component=0) |
void | SetComponent (const double value, int component=0) |
void | SetComponents (const char **values, int numcomp) |
void | SetComponents (const std::vector< albaString > components) |
void | SetValues (const std::vector< albaString > values) |
void | SetValues (const char **values, int numcomp) |
void | RemoveValue (int component) |
void | SetValues (const double *values, int numcomp) |
void | SetValues (const std::vector< double > values) |
void | SetComponents (const double *components, int numcomp) |
void | SetComponents (const std::vector< double > components) |
const char * | GetValue (int component=0) const |
const char * | GetComponent (int comp) const |
double | GetValueAsDouble (int component=0) const |
double | GetComponentAsDouble (int comp) const |
const std::vector< albaString > * | GetComponents () const |
std::vector< double > | GetComponentsAsDoubles () const |
void | GetValueAsSingleString (albaString &str) const |
void | GetValueAsSingleString (std::string &str) const |
void | SetType (int t) |
int | GetType () const |
void | GetTypeAsString (albaString &value) const |
void | GetTypeAsString (std::string &value) const |
void | SetNumberOfComponents (int n) |
int | GetNumberOfComponents () const |
bool | Equals (const albaTagItem *item) const |
void | DeepCopy (const albaTagItem *item) |
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) |
void | Initialize () |
virtual int | InternalStore (albaStorageElement *node)=0 |
virtual int | InternalRestore (albaStorageElement *node)=0 |
Protected Attributes | |
albaString | m_Name |
int | m_Type |
std::vector< albaString > | m_Components |
Protected Attributes inherited from albaStorable | |
bool | m_Storable |
Additional Inherited Members | |
Static Public Member Functions inherited from albaStorable | |
static albaStorable * | SafeCastToObject (albaObject *o) |
an utility class for storing <key-type-array of values> information.
an utility class for storing <key-type-array of values> information.
Definition at line 46 of file albaTagItem.h.
albaTagItem::albaTagItem | ( | ) |
albaTagItem::~albaTagItem | ( | ) |
albaTagItem::albaTagItem | ( | const char * | name, |
const char * | value, | ||
int | t = ALBA_STRING_TAG |
||
) |
Constructors for with implicit Tag type...
albaTagItem::albaTagItem | ( | const char * | name, |
const char ** | values, | ||
int | numcomp, | ||
int | t = ALBA_STRING_TAG |
||
) |
albaTagItem::albaTagItem | ( | const char * | name, |
const std::vector< albaString > & | values, | ||
int | numcomp, | ||
int | t = ALBA_STRING_TAG |
||
) |
albaTagItem::albaTagItem | ( | const char * | name, |
const double | value | ||
) |
albaTagItem::albaTagItem | ( | const char * | name, |
const double * | value, | ||
int | numcomp | ||
) |
albaTagItem::albaTagItem | ( | const char * | name, |
const std::vector< double > & | values, | ||
int | numcomp | ||
) |
albaTagItem::albaTagItem | ( | const albaTagItem & | p | ) |
void albaTagItem::operator= | ( | const albaTagItem & | p | ) |
bool albaTagItem::operator== | ( | const albaTagItem & | p | ) | const |
bool albaTagItem::operator!= | ( | const albaTagItem & | p | ) | const |
|
virtual |
void albaTagItem::SetName | ( | const char * | name | ) |
Set/Get the name of this Tag.
const char * albaTagItem::GetName | ( | ) | const |
void albaTagItem::SetValue | ( | const albaString | value, |
int | component = 0 |
||
) |
Set the Value of this Tag.
In case the component is specified the function operates on that component, otherwise it works on component 0.
void albaTagItem::SetComponent | ( | const albaString | value, |
int | component = 0 |
||
) |
same as SetValue()
void albaTagItem::SetValue | ( | const double | value, |
int | component = 0 |
||
) |
Set Tag value converting automatically to string and setting the type to NUMERIC.
void albaTagItem::SetComponent | ( | const double | value, |
int | component = 0 |
||
) |
Set Tag value converting automatically to string and setting the type to NUMERIC.
void albaTagItem::SetComponents | ( | const char ** | values, |
int | numcomp | ||
) |
Set array of components at a once.
void albaTagItem::SetComponents | ( | const std::vector< albaString > | components | ) |
Set array of components at a once.
void albaTagItem::SetValues | ( | const std::vector< albaString > | values | ) |
same as SetComponents()
void albaTagItem::SetValues | ( | const char ** | values, |
int | numcomp | ||
) |
same as SetComponents()
void albaTagItem::RemoveValue | ( | int | component | ) |
Remove a value
void albaTagItem::SetValues | ( | const double * | values, |
int | numcomp | ||
) |
Set array of components at a once, specifying an array of numeric values.
void albaTagItem::SetValues | ( | const std::vector< double > | values | ) |
Set array of components at a once, specifying an array of numeric values.
void albaTagItem::SetComponents | ( | const double * | components, |
int | numcomp | ||
) |
Set array of components at a once, specifying an array of numeric values.
void albaTagItem::SetComponents | ( | const std::vector< double > | components | ) |
Set array of components at a once, specifying an array of numeric values.
const char * albaTagItem::GetValue | ( | int | component = 0 | ) | const |
return the value stored in this item.
By default the function work on the first component, but specifying the component number it's possible to retain the specific component.
const char * albaTagItem::GetComponent | ( | int | comp | ) | const |
same as GetValue()
double albaTagItem::GetValueAsDouble | ( | int | component = 0 | ) | const |
return the value stored in this item converting to a double.
double albaTagItem::GetComponentAsDouble | ( | int | comp | ) | const |
|
inline |
return all the array of values
Definition at line 122 of file albaTagItem.h.
std::vector< double > albaTagItem::GetComponentsAsDoubles | ( | ) | const |
return vector of values as doubles
void albaTagItem::GetValueAsSingleString | ( | albaString & | str | ) | const |
return the array of values as a single string, representing the array of components as a tuple of the form: "( <component1>, <component2>,...)"
void albaTagItem::GetValueAsSingleString | ( | std::string & | str | ) | const |
|
inline |
Set the type of this Tag.
Default available types are ALBA_MISSING_TAG=0, , ALBA_NUMERIC_TAG=1, ALBA_STRING_TAG=2 where the first one means a NULL value (no component) is present. Custom ids can be defined by applications.
Definition at line 140 of file albaTagItem.h.
|
inline |
return the type of this tag.
Default available types are ALBA_MISSING_TAG=0, ALBA_NUMERIC_TAG=1, ALBA_STRING_TAG=2 where the first one means a NULL value (no component) is present. Custom ids can be defined by applications.
Definition at line 146 of file albaTagItem.h.
void albaTagItem::GetTypeAsString | ( | albaString & | value | ) | const |
return the type of this tag item as a string.
Default available types are "MIS", "NUM", "STR" where the first means a NULL value (no component) is present. Custom ids can be defined by applications and a reported by this functions as numerical strings.
void albaTagItem::GetTypeAsString | ( | std::string & | value | ) | const |
void albaTagItem::SetNumberOfComponents | ( | int | n | ) |
Set the NumberOfComponents of the value corresponding to this Tag.
When a new NumberOfComponents is specified, where possible old value are preserved.
int albaTagItem::GetNumberOfComponents | ( | ) | const |
bool albaTagItem::Equals | ( | const albaTagItem * | item | ) | const |
Compare two Tag items.
void albaTagItem::DeepCopy | ( | const albaTagItem * | item | ) |
copy contents of the given tag item
|
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.
Implements albaStorable.
|
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.
Implements albaStorable.
|
protected |
|
protected |
Definition at line 175 of file albaTagItem.h.
|
protected |
Definition at line 176 of file albaTagItem.h.
|
protected |
Definition at line 177 of file albaTagItem.h.