variable. The C++ standard then provides above guarantee. The instance will be
initialized the first time, the code flow passes the variable declaration found in
the instance() body.
-
- \fixme TimerQueue as \c map \e and \c priority_queue doesn't make sense ...
*/
static Scheduler & instance();
///< Add timeout event
/**< \param[in] timeout timeout in nanoseconds
\param[in] cb callback to call after \a timeout
- milliseconds
- \todo Return some kind of handle/pointer and add
- support to update or revoke a timeout */
+ milliseconds */
void cancelTimeout(unsigned id);
};
typedef std::map<int,EventSpec> FdTable;
- typedef std::map<unsigned,TimerSpec> TimerMap;
+ typedef std::map<unsigned,TimerSpec> TimerMap; // sorted by id
struct TimerSpecCompare
{
};
typedef std::priority_queue<TimerMap::iterator, std::vector<TimerMap::iterator>,
- TimerSpecCompare> TimerQueue;
+ TimerSpecCompare> TimerQueue; // sorted by time
FdTable fdTable_;
unsigned timerIdCounter_;