ALBA
|
#include <albaTimeMapScalarUX.h>
Public Types | |
typedef std::map< albaTimeStamp, T > | TimeMapScalars |
typedef std::pair< albaTimeStamp, T > | mmuTimePairScalars |
typedef std::map< albaTimeStamp, T > | TimeMapScalars |
typedef std::pair< albaTimeStamp, T > | mmuTimePairScalars |
Public Member Functions | |
albaTimeMapScalar () | |
virtual | ~albaTimeMapScalar () |
albaTimeMapScalar (const albaTimeMapScalar< T > &) | |
void | operator= (const albaTimeMapScalar< T > &) |
void | SetItemTypeName (const char *tname) |
const char * | GetItemTypeName () |
virtual void | AppendItem (albaTimeStamp t, T m) |
virtual void | PrependItem (albaTimeStamp t, T m) |
albaTimeMapScalar< T >::TimeMapScalars::iterator | FindItemByValue (T m) |
virtual void | InsertItem (albaTimeStamp t, T m) |
virtual void | RemoveItem (typename albaTimeMapScalar< T >::TimeMapScalars::iterator it) |
int | RemoveItem (int idx) |
virtual void | RemoveAllItems () |
albaTimeStamp | GetItemTime (int idx) |
void | GetTimeStamps (mmuTimeVectorScalars &kframes) const |
int | GetNumberOfItems () const |
void | GetTimeBounds (albaTimeStamp tbounds[2]) |
void | DeepCopy (albaTimeMapScalar *vitem) |
bool | Equals (albaTimeMapScalar *vmat) |
albaTimeMapScalar< T >::TimeMapScalars::iterator | FindNearestItem (albaTimeStamp t) |
albaTimeMapScalar< T >::TimeMapScalars::iterator | FindItemBefore (albaTimeStamp t) |
albaTimeMapScalar< T >::TimeMapScalars::iterator | FindItem (albaTimeStamp t) |
albaTimeMapScalar< T >::TimeMapScalars::iterator | FindItemByIndex (int idx) |
albaID | FindItemIndex (albaTimeStamp t) |
T | GetItem (albaTimeStamp t) |
T | GetNearestItem (albaTimeStamp t) |
T | GetItemBefore (albaTimeStamp t) |
T | GetItemByIndex (int idx) |
virtual void | Print (std::ostream &os, const int tabs=0) const |
albaTimeMapScalar< T >::TimeMapScalars::iterator | BeginScalarVector () |
albaTimeMapScalar< T >::TimeMapScalars::iterator | EndScalarVector () |
albaTimeMapScalar< T >::TimeMapScalars::iterator | LastScalarVector () |
albaTimeMapScalar () | |
virtual | ~albaTimeMapScalar () |
albaTimeMapScalar (const albaTimeMapScalar< T > &) | |
void | operator= (const albaTimeMapScalar< T > &) |
void | SetItemTypeName (const char *tname) |
const char * | GetItemTypeName () |
virtual void | AppendItem (albaTimeStamp t, T m) |
virtual void | PrependItem (albaTimeStamp t, T m) |
albaTimeMapScalar< T >::TimeMapScalars::iterator | FindItemByValue (T m) |
virtual void | InsertItem (albaTimeStamp t, T m) |
virtual void | RemoveItem (typename albaTimeMapScalar< T >::TimeMapScalars::iterator it) |
int | RemoveItem (int idx) |
virtual void | RemoveAllItems () |
albaTimeStamp | GetItemTime (int idx) |
void | GetTimeStamps (mmuTimeVectorScalars &kframes) const |
int | GetNumberOfItems () const |
void | GetTimeBounds (albaTimeStamp tbounds[2]) |
void | DeepCopy (albaTimeMapScalar *vitem) |
bool | Equals (albaTimeMapScalar *vmat) |
albaTimeMapScalar< T >::TimeMapScalars::iterator | FindNearestItem (albaTimeStamp t) |
albaTimeMapScalar< T >::TimeMapScalars::iterator | FindItemBefore (albaTimeStamp t) |
albaTimeMapScalar< T >::TimeMapScalars::iterator | FindItem (albaTimeStamp t) |
albaTimeMapScalar< T >::TimeMapScalars::iterator | FindItemByIndex (int idx) |
albaID | FindItemIndex (albaTimeStamp t) |
T | GetItem (albaTimeStamp t) |
T | GetNearestItem (albaTimeStamp t) |
T | GetItemBefore (albaTimeStamp t) |
T | GetItemByIndex (int idx) |
virtual void | Print (std::ostream &os, const int tabs=0) const |
albaTimeMapScalar< T >::TimeMapScalars::iterator | BeginScalarVector () |
albaTimeMapScalar< T >::TimeMapScalars::iterator | EndScalarVector () |
albaTimeMapScalar< T >::TimeMapScalars::iterator | LastScalarVector () |
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 albaTimeStamped | |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
Protected Attributes | |
TimeMapScalars | m_TimeMap |
albaString | m_ItemTypeName |
Protected Attributes inherited from albaObject | |
bool | m_HeapFlag |
Protected Attributes inherited from albaTimeStamped | |
albaMTime | m_MTime |
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) |
a dynamic associative sorted array of scalars indexed by their "timestamp".
This class wraps an STL set (associative sorted array) of timestamped scalars, indexed by "timestamp". Its implementation depends on the undergoing data structure (currently an STL "vector", next release could be based on "map" or "hash_map"). Some utility functions are also provided.
This class wraps an STL set (associative sorted array) of timestamped scalars, indexed by "timestamp". Its implementation depends on the undergoing data structure (currently an STL "vector", next release could be based on "map" or "hash_map"). Some utility functions are also provided.
Definition at line 52 of file albaTimeMapScalarUX.h.
typedef std::map<albaTimeStamp, T > albaTimeMapScalar< T >::TimeMapScalars |
Definition at line 55 of file albaTimeMapScalarUX.h.
typedef std::pair<albaTimeStamp, T > albaTimeMapScalar< T >::mmuTimePairScalars |
Definition at line 56 of file albaTimeMapScalarUX.h.
typedef std::map<albaTimeStamp, T > albaTimeMapScalar< T >::TimeMapScalars |
Definition at line 55 of file albaTimeMapScalarWIN.h.
typedef std::pair<albaTimeStamp, T > albaTimeMapScalar< T >::mmuTimePairScalars |
Definition at line 56 of file albaTimeMapScalarWIN.h.
albaTimeMapScalar< T >::albaTimeMapScalar |
Definition at line 167 of file albaTimeMapScalarUX.h.
|
virtual |
Definition at line 174 of file albaTimeMapScalarUX.h.
albaTimeMapScalar< T >::albaTimeMapScalar | ( | const albaTimeMapScalar< T > & | ) |
albaTimeMapScalar< T >::albaTimeMapScalar | ( | ) |
|
virtual |
|
inline |
Definition at line 61 of file albaTimeMapScalarWIN.h.
void albaTimeMapScalar< T >::operator= | ( | const albaTimeMapScalar< T > & | ) |
|
inline |
set the TypeName of the kind of item accepted by this container
Definition at line 65 of file albaTimeMapScalarUX.h.
|
inline |
Definition at line 66 of file albaTimeMapScalarUX.h.
|
virtual |
Insert an item to the vector trying to append it, anyway the array is kept sorted.
Definition at line 181 of file albaTimeMapScalarUX.h.
|
virtual |
Insert an item to the vector trying to prepend it, anyway the array is kept sorted.
Item's timestamp must be >=0
Definition at line 190 of file albaTimeMapScalarUX.h.
albaTimeMapScalar< T >::TimeMapScalars::iterator albaTimeMapScalar< T >::FindItemByValue | ( | T | m | ) |
Find an item index given its pointer.
Definition at line 380 of file albaTimeMapScalarUX.h.
|
virtual |
Set the item for a specified time.
If no item with the same time exist the item is inserted in the vector. If an item with the same time exist, it's simply substituted with the new one. The item is always references and not copied. This function also automatically call the UpdateData() member function.
Definition at line 198 of file albaTimeMapScalarUX.h.
|
virtual |
Remove an item given its iterator.
Definition at line 279 of file albaTimeMapScalarUX.h.
int albaTimeMapScalar< T >::RemoveItem | ( | int | idx | ) |
Remove an item given its index.
Definition at line 288 of file albaTimeMapScalarUX.h.
References ALBA_ERROR, and ALBA_OK.
|
virtual |
Remove all the items.
Definition at line 303 of file albaTimeMapScalarUX.h.
albaTimeStamp albaTimeMapScalar< T >::GetItemTime | ( | int | idx | ) |
Return the timestamp of the i-th item.
Definition at line 415 of file albaTimeMapScalarUX.h.
void albaTimeMapScalar< T >::GetTimeStamps | ( | mmuTimeVectorScalars & | kframes | ) | const |
Return the list of timestamp of the key scalars in the given vector.
Definition at line 225 of file albaTimeMapScalarUX.h.
|
inline |
Return the number of ITEMS stored in this object.
Definition at line 104 of file albaTimeMapScalarUX.h.
Referenced by albaTimeMapScalar< T >::Equals().
void albaTimeMapScalar< T >::GetTimeBounds | ( | albaTimeStamp | tbounds[2] | ) |
Return the time bounds for this vector, i.e.
minimum and maximum time stamps
Definition at line 207 of file albaTimeMapScalarUX.h.
void albaTimeMapScalar< T >::DeepCopy | ( | albaTimeMapScalar< T > * | vitem | ) |
Copy data from another array.
Definition at line 238 of file albaTimeMapScalarUX.h.
References albaTimeMapScalar< T >::BeginScalarVector(), and albaTimeMapScalar< T >::EndScalarVector().
bool albaTimeMapScalar< T >::Equals | ( | albaTimeMapScalar< T > * | vmat | ) |
Compare two different arrays for equality.
They are considered equivalent if their key scalars are equivalent.
Definition at line 254 of file albaTimeMapScalarUX.h.
References albaTimeMapScalar< T >::GetNumberOfItems(), and albaTimeMapScalar< T >::m_TimeMap.
albaTimeMapScalar< T >::TimeMapScalars::iterator albaTimeMapScalar< T >::FindNearestItem | ( | albaTimeStamp | t | ) |
Find the item with the timestamp nearest to t.
Added by Losi 08/17/2009: After creating the test class albaScalarVectorTest I saw that the GetNearestScalar method returned the scalar with the minimum timestamp greater or equal to the specified one instead of the scalar with the timestamp nearest to the specified one. GetNearestScalar method of albaScalarVectorTest class only call this method of albaTimeMapScalar.
Definition at line 312 of file albaTimeMapScalarUX.h.
albaTimeMapScalar< T >::TimeMapScalars::iterator albaTimeMapScalar< T >::FindItemBefore | ( | albaTimeStamp | t | ) |
Find the item with timestamp <=t.
Definition at line 351 of file albaTimeMapScalarUX.h.
albaTimeMapScalar< T >::TimeMapScalars::iterator albaTimeMapScalar< T >::FindItem | ( | albaTimeStamp | t | ) |
Find the item with the timestamp==t.
Returns the item index, and set "item" to its pointer. Return iterator.end() if not found.
Definition at line 372 of file albaTimeMapScalarUX.h.
albaTimeMapScalar< T >::TimeMapScalars::iterator albaTimeMapScalar< T >::FindItemByIndex | ( | int | idx | ) |
return iterator of item with given index
Definition at line 424 of file albaTimeMapScalarUX.h.
albaID albaTimeMapScalar< T >::FindItemIndex | ( | albaTimeStamp | t | ) |
return index of the given item.
return -1 if not found.
Definition at line 439 of file albaTimeMapScalarUX.h.
T albaTimeMapScalar< T >::GetItem | ( | albaTimeStamp | t | ) |
find and return item corresponding to timestamp t.
return NULL if not found.
Definition at line 457 of file albaTimeMapScalarUX.h.
References ALBA_SCALAR_MIN.
T albaTimeMapScalar< T >::GetNearestItem | ( | albaTimeStamp | t | ) |
Return the pointer to the item with timestamp nearest the given one.
NULL is returned if not found.
Definition at line 465 of file albaTimeMapScalarUX.h.
References ALBA_SCALAR_MIN.
T albaTimeMapScalar< T >::GetItemBefore | ( | albaTimeStamp | t | ) |
Return the pointer to the item with timestamp nearest the given one.
NULL is returned if not found.
Definition at line 473 of file albaTimeMapScalarUX.h.
References ALBA_SCALAR_MIN.
T albaTimeMapScalar< T >::GetItemByIndex | ( | int | idx | ) |
return the item with given its order index.
NULL is returned if not found.
Definition at line 448 of file albaTimeMapScalarUX.h.
References ALBA_SCALAR_MIN.
|
virtual |
print debug information for this object
Reimplemented from albaObject.
Definition at line 395 of file albaTimeMapScalarUX.h.
|
inline |
Definition at line 152 of file albaTimeMapScalarUX.h.
Referenced by albaTimeMapScalar< T >::DeepCopy().
|
inline |
Definition at line 153 of file albaTimeMapScalarUX.h.
Referenced by albaTimeMapScalar< T >::DeepCopy().
|
inline |
Definition at line 154 of file albaTimeMapScalarUX.h.
|
inline |
Definition at line 62 of file albaTimeMapScalarWIN.h.
|
inline |
set the TypeName of the kind of item accepted by this container
Definition at line 65 of file albaTimeMapScalarWIN.h.
References albaTimeMapScalar< T >::m_ItemTypeName.
|
inline |
Definition at line 66 of file albaTimeMapScalarWIN.h.
References albaTimeMapScalar< T >::m_ItemTypeName.
|
virtual |
Insert an item to the vector trying to append it, anyway the array is kept sorted.
|
virtual |
Insert an item to the vector trying to prepend it, anyway the array is kept sorted.
Item's timestamp must be >=0
albaTimeMapScalar< T >::TimeMapScalars::iterator albaTimeMapScalar< T >::FindItemByValue | ( | T | m | ) |
Find an item index given its pointer.
|
virtual |
Set the item for a specified time.
If no item with the same time exist the item is inserted in the vector. If an item with the same time exist, it's simply substituted with the new one. The item is always references and not copied. This function also automatically call the UpdateData() member function.
|
virtual |
Remove an item given its iterator.
int albaTimeMapScalar< T >::RemoveItem | ( | int | idx | ) |
Remove an item given its index.
|
virtual |
Remove all the items.
albaTimeStamp albaTimeMapScalar< T >::GetItemTime | ( | int | idx | ) |
Return the timestamp of the i-th item.
void albaTimeMapScalar< T >::GetTimeStamps | ( | mmuTimeVectorScalars & | kframes | ) | const |
Return the list of timestamp of the key scalars in the given vector.
|
inline |
Return the number of ITEMS stored in this object.
Definition at line 104 of file albaTimeMapScalarWIN.h.
References albaTimeMapScalar< T >::m_TimeMap.
void albaTimeMapScalar< T >::GetTimeBounds | ( | albaTimeStamp | tbounds[2] | ) |
Return the time bounds for this vector, i.e.
minimum and maximum time stamps
void albaTimeMapScalar< T >::DeepCopy | ( | albaTimeMapScalar< T > * | vitem | ) |
Copy data from another array.
bool albaTimeMapScalar< T >::Equals | ( | albaTimeMapScalar< T > * | vmat | ) |
Compare two different arrays for equality.
They are considered equivalent if their key scalars are equivalent.
albaTimeMapScalar< T >::TimeMapScalars::iterator albaTimeMapScalar< T >::FindNearestItem | ( | albaTimeStamp | t | ) |
Find the item with the timestamp nearest to t.
albaTimeMapScalar< T >::TimeMapScalars::iterator albaTimeMapScalar< T >::FindItemBefore | ( | albaTimeStamp | t | ) |
Find the item with timestamp <= t.
albaTimeMapScalar< T >::TimeMapScalars::iterator albaTimeMapScalar< T >::FindItem | ( | albaTimeStamp | t | ) |
Find the item with the timestamp==t.
Returns the item index, and set "item" to its pointer. Return iterator.end() if not found.
albaTimeMapScalar< T >::TimeMapScalars::iterator albaTimeMapScalar< T >::FindItemByIndex | ( | int | idx | ) |
return iterator of item with given index
albaID albaTimeMapScalar< T >::FindItemIndex | ( | albaTimeStamp | t | ) |
return index of the given item.
return -1 if not found.
T albaTimeMapScalar< T >::GetItem | ( | albaTimeStamp | t | ) |
find and return item corresponding to timestamp t.
return NULL if not found.
T albaTimeMapScalar< T >::GetNearestItem | ( | albaTimeStamp | t | ) |
Return the pointer to the item with timestamp nearest the given one.
NULL is returned if not found.
T albaTimeMapScalar< T >::GetItemBefore | ( | albaTimeStamp | t | ) |
Return the pointer to the item with timestamp nearest the given one.
NULL is returned if not found.
T albaTimeMapScalar< T >::GetItemByIndex | ( | int | idx | ) |
return the item with given its order index.
NULL is returned if not found.
|
virtual |
print debug information for this object
Reimplemented from albaObject.
|
inline |
Definition at line 152 of file albaTimeMapScalarWIN.h.
References albaTimeMapScalar< T >::m_TimeMap.
|
inline |
Definition at line 153 of file albaTimeMapScalarWIN.h.
References albaTimeMapScalar< T >::m_TimeMap.
|
inline |
Definition at line 154 of file albaTimeMapScalarWIN.h.
References albaTimeMapScalar< T >::m_TimeMap.
|
protected |
the set storing the scalars
Definition at line 157 of file albaTimeMapScalarUX.h.
Referenced by albaTimeMapScalar< T >::BeginScalarVector(), albaTimeMapScalar< T >::EndScalarVector(), albaTimeMapScalar< T >::Equals(), albaTimeMapScalar< T >::GetNumberOfItems(), and albaTimeMapScalar< T >::LastScalarVector().
|
protected |
the name of the item type accepted by this container
Definition at line 158 of file albaTimeMapScalarUX.h.
Referenced by albaTimeMapScalar< T >::GetItemTypeName(), and albaTimeMapScalar< T >::SetItemTypeName().