ALBA
|
#include <albaTimeMapUX.h>
Public Types | |
typedef std::map< albaTimeStamp, albaAutoPointer< T > > | TimeMap |
typedef std::pair< albaTimeStamp, albaAutoPointer< T > > | mmuTimePair |
typedef std::map< albaTimeStamp, albaAutoPointer< T > > | TimeMap |
typedef std::pair< albaTimeStamp, albaAutoPointer< T > > | mmuTimePair |
Public Member Functions | |
albaTimeMap () | |
virtual | ~albaTimeMap () |
albaTimeMap (const albaTimeMap< T > &) | |
void | operator= (const albaTimeMap< T > &) |
void | SetItemTypeName (const char *tname) |
const char * | GetItemTypeName () |
virtual void | AppendItem (T *m) |
virtual void | AppendAndSetItem (T *m) |
virtual void | PrependItem (T *m) |
albaTimeMap< T >::TimeMap::iterator | FindItem (T *m) |
virtual void | InsertItem (T *m) |
virtual void | RemoveItem (typename albaTimeMap< T >::TimeMap::iterator it) |
int | RemoveItem (int idx) |
virtual void | RemoveAllItems () |
albaTimeStamp | GetItemTime (int idx) |
void | GetTimeStamps (mmuTimeVector &kframes) const |
int | GetNumberOfItems () const |
void | GetTimeBounds (albaTimeStamp tbounds[2]) |
void | DeepCopy (albaTimeMap *vitem) |
bool | Equals (albaTimeMap *vmat) |
albaTimeMap< T >::TimeMap::iterator | FindNearestItem (albaTimeStamp t) |
albaTimeMap< T >::TimeMap::iterator | FindItemBefore (albaTimeStamp t) |
albaTimeMap< T >::TimeMap::iterator | FindItem (albaTimeStamp t) |
albaTimeMap< T >::TimeMap::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 |
albaTimeMap< T >::TimeMap::iterator | Begin () |
albaTimeMap< T >::TimeMap::iterator | End () |
albaTimeMap< T >::TimeMap::iterator | Last () |
albaTimeMap () | |
virtual | ~albaTimeMap () |
albaTimeMap (const albaTimeMap< T > &) | |
void | operator= (const albaTimeMap< T > &) |
void | SetItemTypeName (const char *tname) |
const char * | GetItemTypeName () |
virtual void | AppendItem (T *m) |
virtual void | AppendAndSetItem (T *m) |
virtual void | PrependItem (T *m) |
albaTimeMap< T >::TimeMap::iterator | FindItem (T *m) |
virtual void | InsertItem (T *m) |
virtual void | RemoveItem (typename albaTimeMap< T >::TimeMap::iterator it) |
int | RemoveItem (int idx) |
virtual void | RemoveAllItems () |
albaTimeStamp | GetItemTime (int idx) |
void | GetTimeStamps (mmuTimeVector &kframes) const |
int | GetNumberOfItems () const |
void | GetTimeBounds (albaTimeStamp tbounds[2]) |
void | DeepCopy (albaTimeMap *vitem) |
bool | Equals (albaTimeMap *vmat) |
albaTimeMap< T >::TimeMap::iterator | FindNearestItem (albaTimeStamp t) |
albaTimeMap< T >::TimeMap::iterator | FindItemBefore (albaTimeStamp t) |
albaTimeMap< T >::TimeMap::iterator | FindItem (albaTimeStamp t) |
albaTimeMap< T >::TimeMap::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 |
albaTimeMap< T >::TimeMap::iterator | Begin () |
albaTimeMap< T >::TimeMap::iterator | End () |
albaTimeMap< T >::TimeMap::iterator | Last () |
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 | |
TimeMap | 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 timestamped objects indexed by their "timestamp".
This class wraps an STL set (associative sorted array) of timestamped datasets, 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 datasets, 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 48 of file albaTimeMapUX.h.
typedef std::map<albaTimeStamp, albaAutoPointer<T> > albaTimeMap< T >::TimeMap |
Definition at line 51 of file albaTimeMapUX.h.
typedef std::pair<albaTimeStamp, albaAutoPointer<T> > albaTimeMap< T >::mmuTimePair |
Definition at line 52 of file albaTimeMapUX.h.
typedef std::map<albaTimeStamp, albaAutoPointer<T> > albaTimeMap< T >::TimeMap |
Definition at line 52 of file albaTimeMapWIN.h.
typedef std::pair<albaTimeStamp, albaAutoPointer<T> > albaTimeMap< T >::mmuTimePair |
Definition at line 53 of file albaTimeMapWIN.h.
albaTimeMap< T >::albaTimeMap |
Definition at line 171 of file albaTimeMapUX.h.
|
virtual |
Definition at line 178 of file albaTimeMapUX.h.
albaTimeMap< T >::albaTimeMap | ( | const albaTimeMap< T > & | ) |
albaTimeMap< T >::albaTimeMap | ( | ) |
|
virtual |
|
inline |
Definition at line 58 of file albaTimeMapWIN.h.
void albaTimeMap< T >::operator= | ( | const albaTimeMap< T > & | ) |
|
inline |
set the TypeName of the kind of item accepted by this container
Definition at line 63 of file albaTimeMapUX.h.
|
inline |
Definition at line 64 of file albaTimeMapUX.h.
|
virtual |
Insert an item to the vector trying to append it, anyway the array is kept sorted.
Definition at line 205 of file albaTimeMapUX.h.
References albaErrorMacro.
|
virtual |
append item setting its timestamp to the highest one + 1
Definition at line 185 of file albaTimeMapUX.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 224 of file albaTimeMapUX.h.
References albaErrorMacro.
albaTimeMap< T >::TimeMap::iterator albaTimeMap< T >::FindItem | ( | T * | m | ) |
Find an item index given its pointer.
Definition at line 422 of file albaTimeMapUX.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 242 of file albaTimeMapUX.h.
References albaErrorMacro.
|
virtual |
Remove an item given its iterator.
Definition at line 336 of file albaTimeMapUX.h.
int albaTimeMap< T >::RemoveItem | ( | int | idx | ) |
Remove an item given its index.
Definition at line 345 of file albaTimeMapUX.h.
References ALBA_ERROR, and ALBA_OK.
|
virtual |
Remove all the items.
Definition at line 360 of file albaTimeMapUX.h.
albaTimeStamp albaTimeMap< T >::GetItemTime | ( | int | idx | ) |
Return the timestamp of the i-th item.
Definition at line 451 of file albaTimeMapUX.h.
void albaTimeMap< T >::GetTimeStamps | ( | mmuTimeVector & | kframes | ) | const |
Return the list of timestamp of the key matrixes in the given vector.
Definition at line 280 of file albaTimeMapUX.h.
|
inline |
Return the number of ITEMS stored in this object.
Definition at line 105 of file albaTimeMapUX.h.
Referenced by albaTimeMap< T >::Equals().
void albaTimeMap< T >::GetTimeBounds | ( | albaTimeStamp | tbounds[2] | ) |
Set/Get the Current time for this object.
Return the time bounds for this vector, i.e. minimum and maximum time stamps
Definition at line 262 of file albaTimeMapUX.h.
void albaTimeMap< T >::DeepCopy | ( | albaTimeMap< T > * | vitem | ) |
Copy data from another array.
Definition at line 293 of file albaTimeMapUX.h.
References albaTimeMap< T >::Begin(), albaTimeMap< T >::DeepCopy(), and albaTimeMap< T >::End().
Referenced by albaTimeMap< T >::DeepCopy().
bool albaTimeMap< T >::Equals | ( | albaTimeMap< T > * | vmat | ) |
Compare two different arrays for equality.
They are considered equivalent if their key matrixes are equivalent.
Definition at line 311 of file albaTimeMapUX.h.
References albaTimeMap< T >::GetNumberOfItems(), and albaTimeMap< T >::m_TimeMap.
albaTimeMap< T >::TimeMap::iterator albaTimeMap< T >::FindNearestItem | ( | albaTimeStamp | t | ) |
Find the item with the timestamp nearest to t.
Definition at line 369 of file albaTimeMapUX.h.
albaTimeMap< T >::TimeMap::iterator albaTimeMap< T >::FindItemBefore | ( | albaTimeStamp | t | ) |
Find the item with timestamp <=t.
Definition at line 393 of file albaTimeMapUX.h.
albaTimeMap< T >::TimeMap::iterator albaTimeMap< T >::FindItem | ( | albaTimeStamp | t | ) |
Find the item with the timestamp==t.
Returns the item index, and set "item" to its pointer. Return -1 and NULL if not found. not
Definition at line 414 of file albaTimeMapUX.h.
albaTimeMap< T >::TimeMap::iterator albaTimeMap< T >::FindItemByIndex | ( | int | idx | ) |
return iterator of item with given index
Definition at line 461 of file albaTimeMapUX.h.
albaID albaTimeMap< T >::FindItemIndex | ( | albaTimeStamp | t | ) |
return index of the given item.
return -1 if not found.
Definition at line 476 of file albaTimeMapUX.h.
T * albaTimeMap< T >::GetItem | ( | albaTimeStamp | t | ) |
find and return item corresponding to timestamp t.
return NULL if not found.
Definition at line 494 of file albaTimeMapUX.h.
T * albaTimeMap< 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 502 of file albaTimeMapUX.h.
T * albaTimeMap< 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 510 of file albaTimeMapUX.h.
T * albaTimeMap< T >::GetItemByIndex | ( | int | idx | ) |
return the item with given its order index.
NULL is returned if not found.
Definition at line 485 of file albaTimeMapUX.h.
|
virtual |
print debug information for this object
Reimplemented from albaObject.
Definition at line 431 of file albaTimeMapUX.h.
|
inline |
Definition at line 158 of file albaTimeMapUX.h.
Referenced by albaTimeMap< T >::DeepCopy().
|
inline |
Definition at line 159 of file albaTimeMapUX.h.
Referenced by albaTimeMap< T >::DeepCopy().
|
inline |
Definition at line 160 of file albaTimeMapUX.h.
|
inline |
Definition at line 59 of file albaTimeMapWIN.h.
|
inline |
set the TypeName of the kind of item accepted by this container
Definition at line 64 of file albaTimeMapWIN.h.
References albaTimeMap< T >::m_ItemTypeName.
|
inline |
Definition at line 65 of file albaTimeMapWIN.h.
References albaTimeMap< T >::m_ItemTypeName.
|
virtual |
Insert an item to the vector trying to append it, anyway the array is kept sorted.
|
virtual |
append item setting its timestamp to the highest one + 1
|
virtual |
Insert an item to the vector trying to prepend it, anyway the array is kept sorted.
Item's timestamp must be >=0
albaTimeMap< T >::TimeMap::iterator albaTimeMap< T >::FindItem | ( | 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 albaTimeMap< T >::RemoveItem | ( | int | idx | ) |
Remove an item given its index.
|
virtual |
Remove all the items.
albaTimeStamp albaTimeMap< T >::GetItemTime | ( | int | idx | ) |
Return the timestamp of the i-th item.
void albaTimeMap< T >::GetTimeStamps | ( | mmuTimeVector & | kframes | ) | const |
Return the list of timestamp of the key matrixes in the given vector.
|
inline |
Return the number of ITEMS stored in this object.
Definition at line 106 of file albaTimeMapWIN.h.
References albaTimeMap< T >::m_TimeMap.
void albaTimeMap< T >::GetTimeBounds | ( | albaTimeStamp | tbounds[2] | ) |
Set/Get the Current time for this object.
Return the time bounds for this vector, i.e. minimum and maximum time stamps
void albaTimeMap< T >::DeepCopy | ( | albaTimeMap< T > * | vitem | ) |
Copy data from another array.
bool albaTimeMap< T >::Equals | ( | albaTimeMap< T > * | vmat | ) |
Compare two different arrays for equality.
They are considered equivalent if their key matrixes are equivalent.
albaTimeMap< T >::TimeMap::iterator albaTimeMap< T >::FindNearestItem | ( | albaTimeStamp | t | ) |
Find the item with the timestamp nearest to t.
albaTimeMap< T >::TimeMap::iterator albaTimeMap< T >::FindItemBefore | ( | albaTimeStamp | t | ) |
Find the item with timestamp <=t.
albaTimeMap< T >::TimeMap::iterator albaTimeMap< T >::FindItem | ( | albaTimeStamp | t | ) |
Find the item with the timestamp==t.
Returns the item index, and set "item" to its pointer. Return -1 and NULL if not found. not
albaTimeMap< T >::TimeMap::iterator albaTimeMap< T >::FindItemByIndex | ( | int | idx | ) |
return iterator of item with given index
albaID albaTimeMap< T >::FindItemIndex | ( | albaTimeStamp | t | ) |
return index of the given item.
return -1 if not found.
T * albaTimeMap< T >::GetItem | ( | albaTimeStamp | t | ) |
find and return item corresponding to timestamp t.
return NULL if not found.
T * albaTimeMap< T >::GetNearestItem | ( | albaTimeStamp | t | ) |
Return the pointer to the item with timestamp nearest the given one.
NULL is returned if not found.
T * albaTimeMap< T >::GetItemBefore | ( | albaTimeStamp | t | ) |
Return the pointer to the item with timestamp nearest the given one.
NULL is returned if not found.
T * albaTimeMap< 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 159 of file albaTimeMapWIN.h.
References albaTimeMap< T >::m_TimeMap.
|
inline |
Definition at line 160 of file albaTimeMapWIN.h.
References albaTimeMap< T >::m_TimeMap.
|
inline |
Definition at line 161 of file albaTimeMapWIN.h.
References albaTimeMap< T >::m_TimeMap.
|
protected |
the set storing the datasets
Definition at line 163 of file albaTimeMapUX.h.
Referenced by albaTimeMap< T >::Begin(), albaTimeMap< T >::End(), albaTimeMap< T >::Equals(), albaTimeMap< T >::GetNumberOfItems(), and albaTimeMap< T >::Last().
|
protected |
the name of the item type accepted by this container
Definition at line 164 of file albaTimeMapUX.h.
Referenced by albaTimeMap< T >::GetItemTypeName(), and albaTimeMap< T >::SetItemTypeName().