#include <dalt_client.h>
Inheritance diagram for DALT_Client::DALTClient:
Public Methods | |
DALTClient (int port_no, string server) | |
the constructor initialises the soap server service for the client and registers it with the server. More... | |
virtual | ~DALTClient () |
virtual int | createAgent (string type, int id)=0 |
this function gets called each time a createAgent message is received. More... | |
virtual void | killAgent (int id) |
kills the thread running the agent with a given id and removes the agent from the agents vector. More... | |
virtual void | soap_createAgent (const SOAPMethod &request, SOAPMethod &response) |
creates a new processing agent, given an ID and a type. More... | |
virtual void | soap_newCycleNotify (const SOAPMethod &request, SOAPMethod &response) |
notify all the agents managed by this client of the start of a new cycle. More... | |
virtual void | soap_clientStatus (const SOAPMethod &request, SOAPMethod &response) |
returns performance information about this client (mainly the last cycle time and the average cycle time). More... | |
virtual void | soap_agentStats (const SOAPMethod &request, SOAPMethod &response) |
returns normalised average performance information about all agent types owned (the time the agent would take to compute on the reference machine). More... | |
virtual void | soap_actionRequest (const SOAPMethod &request, SOAPMethod &response)=0 |
this method is called when an action is to be posted to an agent. More... | |
Public Attributes | |
SOAPProxy* | endpoint |
the server. More... | |
string | server_location |
location of the server. More... | |
AgentWatcher* | agent_watcher |
this class monitors the execution state of the agents managed by the client. More... | |
Protected Types | |
typedef void (DALTClient::* | HandlerFunction )(const SOAPMethod &request, SOAPMethod &response) |
type defined to enable the extended classes to handle soap requests. More... | |
Protected Attributes | |
float | machine_speed |
the indexed performance of th machine running on. More... | |
vector<Agent*> | agents |
vector containing all the agents. More... | |
string | location |
location of this soap server. More... | |
list<Agent*> | to_kill |
agents cannot kill themselves. More... |
It also acts as a container and manager for all the agents running on the same machine. The class knows how to process a series of messages (like the clientInformation) and knows how to forward messages such as action requests to the relevant agents for execution.
This class has to be extended for each particular implementation; each class extending DALTClient has to do the following:
If you want to use clonable agents you will have to implement this yourself, by adding a new soap_cloneAgent method which should be able to receive all data needed to create a new agent.
Definition at line 55 of file dalt_client.h.
|
type defined to enable the extended classes to handle soap requests.
|
|
the constructor initialises the soap server service for the client and registers it with the server.
|
|
|
|
this function gets called each time a createAgent message is received. It has to be overloaded by each simulation
Reimplemented in CAClient. |
|
kills the thread running the agent with a given id and removes the agent from the agents vector.
|
|
this method is called when an action is to be posted to an agent. The client handles the decoding and calling the executeAction method for the right agent
Reimplemented in CAClient. |
|
returns normalised average performance information about all agent types owned (the time the agent would take to compute on the reference machine). This information will be used by the server to aproximate time values for each type of agent.
|
|
returns performance information about this client (mainly the last cycle time and the average cycle time).
|
|
creates a new processing agent, given an ID and a type.
|
|
notify all the agents managed by this client of the start of a new cycle.
|
|
this class monitors the execution state of the agents managed by the client.
Definition at line 77 of file dalt_client.h. |
|
vector containing all the agents.
Definition at line 64 of file dalt_client.h. |
|
the server.
Definition at line 72 of file dalt_client.h. |
|
location of this soap server.
Definition at line 66 of file dalt_client.h. |
|
the indexed performance of th machine running on.
Definition at line 62 of file dalt_client.h. |
|
location of the server.
Definition at line 74 of file dalt_client.h. |
|
agents cannot kill themselves. So they queue do be killed instead; Each newCycle soap request will trigger a cycle which empties this list, by waiting for all Agents to join Definition at line 69 of file dalt_client.h. |