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

#include <albaTagItem.h>

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

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)
 
albaObjectCastToObject ()
 
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< albaStringm_Components
 
- Protected Attributes inherited from albaStorable
bool m_Storable
 

Additional Inherited Members

- Static Public Member Functions inherited from albaStorable
static albaStorableSafeCastToObject (albaObject *o)
 

Detailed Description

an utility class for storing <key-type-array of values> information.

an utility class for storing <key-type-array of values> information.

See also
albaTagArray

Definition at line 46 of file albaTagItem.h.

Constructor & Destructor Documentation

◆ albaTagItem() [1/8]

albaTagItem::albaTagItem ( )

◆ ~albaTagItem()

albaTagItem::~albaTagItem ( )

◆ albaTagItem() [2/8]

albaTagItem::albaTagItem ( const char *  name,
const char *  value,
int  t = ALBA_STRING_TAG 
)

Constructors for with implicit Tag type...

◆ albaTagItem() [3/8]

albaTagItem::albaTagItem ( const char *  name,
const char **  values,
int  numcomp,
int  t = ALBA_STRING_TAG 
)

◆ albaTagItem() [4/8]

albaTagItem::albaTagItem ( const char *  name,
const std::vector< albaString > &  values,
int  numcomp,
int  t = ALBA_STRING_TAG 
)

◆ albaTagItem() [5/8]

albaTagItem::albaTagItem ( const char *  name,
const double  value 
)

◆ albaTagItem() [6/8]

albaTagItem::albaTagItem ( const char *  name,
const double *  value,
int  numcomp 
)

◆ albaTagItem() [7/8]

albaTagItem::albaTagItem ( const char *  name,
const std::vector< double > &  values,
int  numcomp 
)

◆ albaTagItem() [8/8]

albaTagItem::albaTagItem ( const albaTagItem p)

Member Function Documentation

◆ operator=()

void albaTagItem::operator= ( const albaTagItem p)

◆ operator==()

bool albaTagItem::operator== ( const albaTagItem p) const

◆ operator!=()

bool albaTagItem::operator!= ( const albaTagItem p) const

◆ Print()

virtual void albaTagItem::Print ( std::ostream &  os,
const int  indent = 0 
) const
virtual

◆ SetName()

void albaTagItem::SetName ( const char *  name)

Set/Get the name of this Tag.

◆ GetName()

const char * albaTagItem::GetName ( ) const

◆ SetValue() [1/2]

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.

◆ SetComponent() [1/2]

void albaTagItem::SetComponent ( const albaString  value,
int  component = 0 
)

same as SetValue()

◆ SetValue() [2/2]

void albaTagItem::SetValue ( const double  value,
int  component = 0 
)

Set Tag value converting automatically to string and setting the type to NUMERIC.

◆ SetComponent() [2/2]

void albaTagItem::SetComponent ( const double  value,
int  component = 0 
)

Set Tag value converting automatically to string and setting the type to NUMERIC.

◆ SetComponents() [1/4]

void albaTagItem::SetComponents ( const char **  values,
int  numcomp 
)

Set array of components at a once.

◆ SetComponents() [2/4]

void albaTagItem::SetComponents ( const std::vector< albaString components)

Set array of components at a once.

◆ SetValues() [1/4]

void albaTagItem::SetValues ( const std::vector< albaString values)

same as SetComponents()

◆ SetValues() [2/4]

void albaTagItem::SetValues ( const char **  values,
int  numcomp 
)

same as SetComponents()

◆ RemoveValue()

void albaTagItem::RemoveValue ( int  component)

Remove a value

◆ SetValues() [3/4]

void albaTagItem::SetValues ( const double *  values,
int  numcomp 
)

Set array of components at a once, specifying an array of numeric values.

◆ SetValues() [4/4]

void albaTagItem::SetValues ( const std::vector< double >  values)

Set array of components at a once, specifying an array of numeric values.

◆ SetComponents() [3/4]

void albaTagItem::SetComponents ( const double *  components,
int  numcomp 
)

Set array of components at a once, specifying an array of numeric values.

◆ SetComponents() [4/4]

void albaTagItem::SetComponents ( const std::vector< double >  components)

Set array of components at a once, specifying an array of numeric values.

◆ GetValue()

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.

◆ GetComponent()

const char * albaTagItem::GetComponent ( int  comp) const

same as GetValue()

◆ GetValueAsDouble()

double albaTagItem::GetValueAsDouble ( int  component = 0) const

return the value stored in this item converting to a double.

◆ GetComponentAsDouble()

double albaTagItem::GetComponentAsDouble ( int  comp) const

◆ GetComponents()

const std::vector< albaString > * albaTagItem::GetComponents ( ) const
inline

return all the array of values

Definition at line 122 of file albaTagItem.h.

◆ GetComponentsAsDoubles()

std::vector< double > albaTagItem::GetComponentsAsDoubles ( ) const

return vector of values as doubles

◆ GetValueAsSingleString() [1/2]

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>,...)"

◆ GetValueAsSingleString() [2/2]

void albaTagItem::GetValueAsSingleString ( std::string &  str) const

◆ SetType()

void albaTagItem::SetType ( int  t)
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.

◆ GetType()

int albaTagItem::GetType ( ) const
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.

◆ GetTypeAsString() [1/2]

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.

◆ GetTypeAsString() [2/2]

void albaTagItem::GetTypeAsString ( std::string &  value) const

◆ SetNumberOfComponents()

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.

◆ GetNumberOfComponents()

int albaTagItem::GetNumberOfComponents ( ) const

◆ Equals()

bool albaTagItem::Equals ( const albaTagItem item) const

Compare two Tag items.

◆ DeepCopy()

void albaTagItem::DeepCopy ( const albaTagItem item)

copy contents of the given tag item

◆ InternalStore()

virtual int albaTagItem::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.

Implements albaStorable.

◆ InternalRestore()

virtual int albaTagItem::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.

Implements albaStorable.

◆ Initialize()

void albaTagItem::Initialize ( )
protected

Member Data Documentation

◆ m_Name

albaString albaTagItem::m_Name
protected

Definition at line 175 of file albaTagItem.h.

◆ m_Type

int albaTagItem::m_Type
protected

Definition at line 176 of file albaTagItem.h.

◆ m_Components

std::vector<albaString> albaTagItem::m_Components
protected

Definition at line 177 of file albaTagItem.h.


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