#include <agent_watcher.h>
Inheritance diagram for DALT_Client::AgentWatcher:
Public Methods | |
AgentWatcher (AgentWatcher *&ref) | |
constructor, initializes the semaphore. More... | |
~AgentWatcher () | |
destructor - releases all resources. More... | |
void | agentFinished () |
marks another agent as finished; this function is called by the agents themselves when they finish a cycle. More... | |
void | addAgentsToWatch (int n) |
instructs the watcher to wait for some more agents. More... | |
void | newCycle () |
instructs the watcher to start the accounting for a new cycle. More... | |
unsigned long int | getLastCycleTime () |
unsigned long int | getAverageCycleTime () |
virtual void | run () throw () |
main loop. More... | |
Private Attributes | |
int | agents |
how many agents we have to wait for. More... | |
Semaphore* | loop_locker |
semaphore regulating the loop. More... | |
Mutex | rti_mutex |
mutex for accessing rti. More... | |
Mutex | agents_mutex |
mutex for manipulating the number of agents. More... | |
Mutex | l_mon |
sss. More... | |
bool | locker_idle |
bool. More... | |
CountingSemaphore* | agent_sem |
semaphore controlling the main cycle of the watcher. More... | |
RunTimeInfo | rti |
the agent watcher will have to stop this timer when all agents will have finished. More... | |
AgentWatcher* | self_reference |
pointer to be set to NULL upon completion. More... | |
bool | is_new_cycle |
true if this is the first run in a new cycle. More... | |
bool | first_run |
true if this is the first run. More... |
This is acomplished by running an instance (as a thread) and waiting for it to finish by using join(). The AgentWatcher will wait for all agents to call their finishCycle methods before finishing
Definition at line 42 of file agent_watcher.h.
|
constructor, initializes the semaphore.
|
|
destructor - releases all resources.
|
|
instructs the watcher to wait for some more agents.
|
|
marks another agent as finished; this function is called by the agents themselves when they finish a cycle.
|
|
|
|
|
|
instructs the watcher to start the accounting for a new cycle.
|
|
main loop.
|
|
semaphore controlling the main cycle of the watcher.
Definition at line 58 of file agent_watcher.h. |
|
how many agents we have to wait for.
Definition at line 46 of file agent_watcher.h. |
|
mutex for manipulating the number of agents.
Definition at line 52 of file agent_watcher.h. |
|
true if this is the first run.
Definition at line 66 of file agent_watcher.h. |
|
true if this is the first run in a new cycle.
Definition at line 64 of file agent_watcher.h. |
|
sss.
Definition at line 54 of file agent_watcher.h. |
|
bool.
Definition at line 56 of file agent_watcher.h. |
|
semaphore regulating the loop.
Definition at line 48 of file agent_watcher.h. |
|
the agent watcher will have to stop this timer when all agents will have finished.
Definition at line 60 of file agent_watcher.h. |
|
mutex for accessing rti.
Definition at line 50 of file agent_watcher.h. |
|
pointer to be set to NULL upon completion.
Definition at line 62 of file agent_watcher.h. |