CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
cmlabs::utils::TimeQueuePointer< T > Class Template Reference

TimeQueue specialization for owned heap pointers: clear()/destructor delete remaining entries. More...

#include <Utils.h>

Inheritance diagram for cmlabs::utils::TimeQueuePointer< T >:
[legend]
Collaboration diagram for cmlabs::utils::TimeQueuePointer< T >:
[legend]

Public Member Functions

 TimeQueuePointer ()
virtual ~TimeQueuePointer ()
getNextEntryDue ()
 Pop the earliest due entry.
virtual bool clear ()
 Delete every scheduled pointer and empty the queue.
Public Member Functions inherited from cmlabs::utils::TimeQueue< T >
 TimeQueue ()
virtual ~TimeQueue ()
bool add (uint64 time, T entry)
 Insert an entry sorted by its due time.
uint32 getCount ()
 Number of scheduled entries.
bool getNextEntryDue (T &entry)
 Pop the earliest entry if its due time has passed (non-blocking).

Additional Inherited Members

Protected Attributes inherited from cmlabs::utils::TimeQueue< T >
Mutex mutex
std::list< TimeQueueEntry< T > > internalList

Detailed Description

template<typename T>
class cmlabs::utils::TimeQueuePointer< T >

TimeQueue specialization for owned heap pointers: clear()/destructor delete remaining entries.

Template Parameters
TPointer type; NULL means "nothing due", so NULL must not be a valid element.

Definition at line 939 of file Utils.h.

Constructor & Destructor Documentation

◆ TimeQueuePointer()

template<typename T>
cmlabs::utils::TimeQueuePointer< T >::TimeQueuePointer ( )
inline

Definition at line 941 of file Utils.h.

◆ ~TimeQueuePointer()

template<typename T>
virtual cmlabs::utils::TimeQueuePointer< T >::~TimeQueuePointer ( )
inlinevirtual

Definition at line 942 of file Utils.h.

References clear().

Member Function Documentation

◆ clear()

template<typename T>
virtual bool cmlabs::utils::TimeQueuePointer< T >::clear ( )
inlinevirtual

Delete every scheduled pointer and empty the queue.

Returns
true on success.

Reimplemented from cmlabs::utils::TimeQueue< T >.

Definition at line 954 of file Utils.h.

References cmlabs::utils::TimeQueue< T >::internalList, and cmlabs::utils::TimeQueue< T >::mutex.

Referenced by ~TimeQueuePointer().

◆ getNextEntryDue()

template<typename T>
T cmlabs::utils::TimeQueuePointer< T >::getNextEntryDue ( )
inline

Pop the earliest due entry.

Returns
The entry (ownership transferred) or NULL when nothing is due.

Definition at line 945 of file Utils.h.

References cmlabs::utils::TimeQueue< T >::getNextEntryDue().


The documentation for this class was generated from the following file:
  • /home/ubuntu/c/partner/psyclone2/CMSDK/include/Utils.h