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

#include <mmuTimeSet.h>

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

Public Types

typedef std::set< albaTimeStampTSet
 
typedef std::set< albaTimeStamp >::iterator Iterator
 

Public Member Functions

 mmuTimeSet ()
 
virtual ~mmuTimeSet ()
 
 mmuTimeSet (const mmuTimeSet &c)
 
mmuTimeSetoperator= (const mmuTimeSet &o)
 
bool operator== (const mmuTimeSet &o)
 
void Insert (albaTimeStamp t)
 
void Append (albaTimeStamp t)
 
void Prepend (albaTimeStamp t)
 
void Remove (Iterator ts)
 
void Clear ()
 
TSetGetTSet ()
 
const TSetGetConstTSet () const
 
albaTimeStamp GetByIndex (albaID idx)
 
albaTimeStamp GetNearestTimeStamp (albaTimeStamp t)
 
albaTimeStamp GetTimeStampBefore (albaTimeStamp t)
 
albaID FindTimeStampIndex (albaTimeStamp t)
 
Iterator FindTimeStamp (albaTimeStamp t)
 
Iterator FindNearestTimeStamp (albaTimeStamp t)
 
Iterator FindTimeStampBefore (albaTimeStamp t)
 
void Merge (const mmuTimeSet &v)
 
void Merge (const std::vector< albaTimeStamp > &v)
 
int GetNumberOfTimeStamps () const
 
Iterator Begin ()
 
Iterator End ()
 

Static Public Member Functions

static void Merge (const mmuTimeSet &v1, const mmuTimeSet &v2, mmuTimeSet &outv)
 
static void Merge (const std::vector< albaTimeStamp > &v1, const std::vector< albaTimeStamp > &v2, std::vector< albaTimeStamp > &outv)
 

Protected Attributes

TSet m_TSet
 

Detailed Description

class wrapping an STL "set" of albaTimeStamps providing API to query and merge.

mmuTimeSet

Todo:
  • test Merge of variuos case of time vectors

Definition at line 42 of file mmuTimeSet.h.

Member Typedef Documentation

◆ TSet

typedef std::set<albaTimeStamp> mmuTimeSet::TSet

Definition at line 58 of file mmuTimeSet.h.

◆ Iterator

typedef std::set<albaTimeStamp>::iterator mmuTimeSet::Iterator

Definition at line 59 of file mmuTimeSet.h.

Constructor & Destructor Documentation

◆ mmuTimeSet() [1/2]

mmuTimeSet::mmuTimeSet ( )

◆ ~mmuTimeSet()

virtual mmuTimeSet::~mmuTimeSet ( )
virtual

◆ mmuTimeSet() [2/2]

mmuTimeSet::mmuTimeSet ( const mmuTimeSet c)

copy constructor, this makes a copy of the set

Member Function Documentation

◆ operator=()

mmuTimeSet & mmuTimeSet::operator= ( const mmuTimeSet o)

assign operator, to copy set value from another set

◆ operator==()

bool mmuTimeSet::operator== ( const mmuTimeSet o)

◆ Insert()

void mmuTimeSet::Insert ( albaTimeStamp  t)

insert a timestamp in the set

◆ Append()

void mmuTimeSet::Append ( albaTimeStamp  t)

insert a timestamp forcing insertion point search to start from the end of the set.

In case times are inserted already ordered this ensures a constant time for insertion

◆ Prepend()

void mmuTimeSet::Prepend ( albaTimeStamp  t)

insert a timestamp forcing insertion point search to start from the start of the set.

In case times are inserted already ordered this ensures a constant time for insertion

◆ Remove()

void mmuTimeSet::Remove ( Iterator  ts)

remove timestamp from the set

◆ Clear()

void mmuTimeSet::Clear ( )
inline

remove all items from the internal time set

Definition at line 80 of file mmuTimeSet.h.

◆ GetTSet()

TSet & mmuTimeSet::GetTSet ( )
inline

return reference to inner TSet object

Definition at line 83 of file mmuTimeSet.h.

◆ GetConstTSet()

const TSet & mmuTimeSet::GetConstTSet ( ) const
inline

use this in case you have a to access the TSet of a const mmuTimeSet

Definition at line 86 of file mmuTimeSet.h.

◆ GetByIndex()

albaTimeStamp mmuTimeSet::GetByIndex ( albaID  idx)

Return the idx-th item of the set.

return -1 if not found.

◆ GetNearestTimeStamp()

albaTimeStamp mmuTimeSet::GetNearestTimeStamp ( albaTimeStamp  t)

Return the timestamp with value clsest to t.

◆ GetTimeStampBefore()

albaTimeStamp mmuTimeSet::GetTimeStampBefore ( albaTimeStamp  t)

Return timestamp with value <= t.

◆ FindTimeStampIndex()

albaID mmuTimeSet::FindTimeStampIndex ( albaTimeStamp  t)

return index of the given timestamp.

return -1 if not found.

◆ FindTimeStamp()

Iterator mmuTimeSet::FindTimeStamp ( albaTimeStamp  t)

Return the iterator pointing to the item with value "t".

Return TSet::end() if not found.

◆ FindNearestTimeStamp()

Iterator mmuTimeSet::FindNearestTimeStamp ( albaTimeStamp  t)

Return the iterator pointing to the item with value "t".

Return TSet::end() if none found.

◆ FindTimeStampBefore()

Iterator mmuTimeSet::FindTimeStampBefore ( albaTimeStamp  t)

Return the iterator pointing to the item with lower or equal to "t".

Return TSet::end() if none found.

◆ Merge() [1/4]

static void mmuTimeSet::Merge ( const mmuTimeSet v1,
const mmuTimeSet v2,
mmuTimeSet outv 
)
static

Merge two different time-stamps sets.

◆ Merge() [2/4]

void mmuTimeSet::Merge ( const mmuTimeSet v)

Merge a time-stamps set into this set.

◆ Merge() [3/4]

static void mmuTimeSet::Merge ( const std::vector< albaTimeStamp > &  v1,
const std::vector< albaTimeStamp > &  v2,
std::vector< albaTimeStamp > &  outv 
)
static

Merge two different time-stamps vectors.

◆ Merge() [4/4]

void mmuTimeSet::Merge ( const std::vector< albaTimeStamp > &  v)

Merge a time-stamps vector into this set.

◆ GetNumberOfTimeStamps()

int mmuTimeSet::GetNumberOfTimeStamps ( ) const

return the number of time stamps

◆ Begin()

Iterator mmuTimeSet::Begin ( )
inline

return the first time stamp

Definition at line 131 of file mmuTimeSet.h.

◆ End()

Iterator mmuTimeSet::End ( )
inline

return the last+1 time stamp

Definition at line 133 of file mmuTimeSet.h.

Member Data Documentation

◆ m_TSet

TSet mmuTimeSet::m_TSet
protected

Definition at line 137 of file mmuTimeSet.h.


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