Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

IDEA::AgentTimingService Class Reference
[Agent handle classes]

This class provides all timing-related issues for the agent. More...

#include <AgentTimingService.hh>

List of all members.

Public Methods

 AgentTimingService ()
 Constructor.

 ~AgentTimingService ()
 Destructor.

RecursiveThreadMutexgetMutex () const
AgentTimingServiceImplsetAgentTimingServiceImpl (AgentTimingServiceImpl *impl, bool deleteInstance)
TimeEventHandlersetTimeEventHandler (TimeEventHandler *handler, bool deleteInstance) const
const TimeEventHandlergetTimeEventHandler () const
void setCancellableEventTimer (const Time &time) const
 A cancellabe event is an event which will be pre-empted if you set a new cancellable event.

void setLatency (const Time &latency)
const TimegetLatency () const
void cancelRebootEventAtEndOfTick ()
 Cancels the reboot-timer event if any.

void cancelEventTimer () const
 Removes the last set cancelable event from scheduled events.

void setRebootTimer (const Time &time) const
void cancelRebootTimer () const
void setNonCancellableEventTimer (const Time &time) const
 Schedules an event at time time.

void cancelAllTimers () const
 Removes all (cancellable, non-cancellabe and reboot) scheduled events.

void incrementNonWarpableCommands () const
 Increases the number of non-warpable commands by one.

void decrementNonWarpableCommands () const
 Decrements the number of non-warpable commands by one.

bool isInitialized () const
 Returns true if the invoking AgentTimingService has been initialized successfully. Otherwise returns false.

Time getTimeOfDay () const
 Returns the time of day as an offset of a pivot-date (typically january 1, 1970 depending on OS).

Time getCurrentTime () const
 Returns the current (simulated) time. If the invoking class has not been initialized yet it will return Time(0,0).

Time getCurrentTick () const
 Returns the current tick. If the invoking class has not been initialized yet it will return Time(0,0).

Time getElapsedTime () const
 Returns the elapsed time since the construction of the timing-service.

void incrementTransitMessages (int numOfMsgs=1) const
 The sender will tell the TimingService how many messages it has sent.

void decrementTransitMessages (int numOfMsgs=1) const
 The receiver will tell the TimingService how many messages it has received.

void cancelTimer (const Time &time) const
 Cancels a timer set at time time if exists.

bool getNextScheduledTime (Time &time) const
 Returns true if there is a next scheduled event for the invoking agent and will populate time with the time of this event. Otherwise will return false.

void stop ()
 Stops the invoking AgentTimingService.


Private Attributes

AgentTimingServiceImplm_AgentTimingServiceImpl
bool m_DeleteAgentTimingServiceImpl
Time m_Latency


Detailed Description

This class provides all timing-related issues for the agent.

Author:
David Rijsman rijsman@email.arc.nasa.gov


Constructor & Destructor Documentation

IDEA::AgentTimingService::AgentTimingService  
 

Constructor.

Creates an empty instance of AgentTimingService

IDEA::AgentTimingService::~AgentTimingService  
 

Destructor.


Member Function Documentation

void IDEA::AgentTimingService::cancelAllTimers  
 

Removes all (cancellable, non-cancellabe and reboot) scheduled events.

void IDEA::AgentTimingService::cancelEventTimer  
 

Removes the last set cancelable event from scheduled events.

void IDEA::AgentTimingService::cancelRebootEventAtEndOfTick  
 

Cancels the reboot-timer event if any.

void IDEA::AgentTimingService::cancelRebootTimer  
 

void IDEA::AgentTimingService::cancelTimer const Time   time const
 

Cancels a timer set at time time if exists.

void IDEA::AgentTimingService::decrementNonWarpableCommands  
 

Decrements the number of non-warpable commands by one.

In case the counter reaches zero we tell the invoking timingService it is no longer active.

void IDEA::AgentTimingService::decrementTransitMessages int    numOfMsgs = 1 const
 

The receiver will tell the TimingService how many messages it has received.

Time IDEA::AgentTimingService::getCurrentTick  
 

Returns the current tick. If the invoking class has not been initialized yet it will return Time(0,0).

The current tick is an integer rounded up to the nearest multiple of the latency. Any time in the interval ( currentTick - latency, currentTick ] is considered current 'tick'.

Time IDEA::AgentTimingService::getCurrentTime  
 

Returns the current (simulated) time. If the invoking class has not been initialized yet it will return Time(0,0).

Time IDEA::AgentTimingService::getElapsedTime  
 

Returns the elapsed time since the construction of the timing-service.

const Time & IDEA::AgentTimingService::getLatency  
 

RecursiveThreadMutex & IDEA::AgentTimingService::getMutex  
 

bool IDEA::AgentTimingService::getNextScheduledTime Time   time const
 

Returns true if there is a next scheduled event for the invoking agent and will populate time with the time of this event. Otherwise will return false.

const TimeEventHandler * IDEA::AgentTimingService::getTimeEventHandler  
 

Time IDEA::AgentTimingService::getTimeOfDay  
 

Returns the time of day as an offset of a pivot-date (typically january 1, 1970 depending on OS).

void IDEA::AgentTimingService::incrementNonWarpableCommands  
 

Increases the number of non-warpable commands by one.

If we increment the value to one we notify the invoking timing-service that its active.

void IDEA::AgentTimingService::incrementTransitMessages int    numOfMsgs = 1 const
 

The sender will tell the TimingService how many messages it has sent.

bool IDEA::AgentTimingService::isInitialized  
 

Returns true if the invoking AgentTimingService has been initialized successfully. Otherwise returns false.

AgentTimingServiceImpl * IDEA::AgentTimingService::setAgentTimingServiceImpl AgentTimingServiceImpl   impl,
bool    deleteInstance
 

void IDEA::AgentTimingService::setCancellableEventTimer const Time   time const
 

A cancellabe event is an event which will be pre-empted if you set a new cancellable event.

void IDEA::AgentTimingService::setLatency const Time   latency
 

void IDEA::AgentTimingService::setNonCancellableEventTimer const Time   time const
 

Schedules an event at time time.

void IDEA::AgentTimingService::setRebootTimer const Time   time const
 

TimeEventHandler * IDEA::AgentTimingService::setTimeEventHandler TimeEventHandler   handler,
bool    deleteInstance
const
 

void IDEA::AgentTimingService::stop  
 

Stops the invoking AgentTimingService.


Member Data Documentation

AgentTimingServiceImpl* IDEA::AgentTimingService::m_AgentTimingServiceImpl [private]
 

bool IDEA::AgentTimingService::m_DeleteAgentTimingServiceImpl [private]
 

Time IDEA::AgentTimingService::m_Latency [private]
 


Contact information
© IDEA
Generated on Fri Feb 3 17:09:45 2006 for IDEA.