/** Infrastructure common to VOCAL.
*/
namespace Vocal
{
/** Infrastructure common to VOCAL to manipulate the time.<br><br>
*/
namespace TimeAndDate
{
/** An ordered list of TimerEntries. This list is a list of events and the
* time those events expire.<br><br>
*
* @see Vocal::TimeAndDate::TimerEntry
*/
template < class Msg >
class TimerContainer : public Vocal::IO::Writer
{
public:
/** Add a new message to the timer.
*/
TimerEntryId add(Sptr < Msg > ,
milliseconds_t relativeTime);
/** Cancel a delayed event. Returns true is id was found, and
* false otherwise.
*/
bool cancel(TimerEntryId);
/** Get the timeout value for the first available
* message. Returns -1 if no messages available
* (conveying infinite timeout).
*/
int getTimeout();
/** Returns the identifier of the first entry.
*/
TimerEntryId getFirstTimerEntryId();
/** Returns true if a message is available.
*/
bool messageAvailable();
/** Returns the first message available. Throws a
* status exception if no messages are available.
*/
Sptr < Msg > getMessage()
throw ( VMissingDataException );
/** Write a TimerContainer to an ostream.
*/
ostream & writeTo(ostream & out) const;
/** Return the number of all the pending events in the TimerContainer
*/
unsigned int size() const;
using namespace Vocal;
using TimeAndDate::TimerContainer;
using TimeAndDate::TimerEntry;
using TimeAndDate::milliseconds_t;
using TimeAndDate::TimerEntryId;