Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

DALT_Client::DALTClient Class Reference

Main class for simultation; The DALTClient class acts as a server, receiving all SOAP requests from the simulation serever. More...

#include <dalt_client.h>

Inheritance diagram for DALT_Client::DALTClient:

Inheritance graph
[legend]
Collaboration diagram for DALT_Client::DALTClient:

Collaboration graph
[legend]
List of all members.

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...

AgentWatcheragent_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...


Detailed Description

Main class for simultation; The DALTClient class acts as a server, receiving all SOAP requests from the simulation serever.

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.

Author:
Vlad Mereuta

Definition at line 55 of file dalt_client.h.


Member Typedef Documentation

typedef void(DALTClient::* DALT_Client::DALTClient::HandlerFunction)(const SOAPMethod &request, SOAPMethod &response) [protected]
 

type defined to enable the extended classes to handle soap requests.


Constructor & Destructor Documentation

DALT_Client::DALTClient::DALTClient ( int port_no,
string server )
 

the constructor initialises the soap server service for the client and registers it with the server.

Parameters:
port_no   the number of the port at which the client is going to listen for SOAP requests
server   a string containing the address at which the simulation server is located
Parameters:
port_no  
server  

DALT_Client::DALTClient::~DALTClient ( ) [virtual]
 


Member Function Documentation

int DALT_Client::DALTClient::createAgent ( string type,
int id ) [pure virtual]
 

this function gets called each time a createAgent message is received.

It has to be overloaded by each simulation

Parameters:
type   the type of the agent to be created
id   the id of the agent to be created
Returns:
0 for success , other int indicating the failure code
Parameters:
type  
id  

Reimplemented in CAClient.

void DALT_Client::DALTClient::killAgent ( int id ) [virtual]
 

kills the thread running the agent with a given id and removes the agent from the agents vector.

Parameters:
id  

void DALT_Client::DALTClient::soap_actionRequest ( const SOAPMethod & request,
SOAPMethod & response ) [pure virtual]
 

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

Parameters:
request  
response  

Reimplemented in CAClient.

void DALT_Client::DALTClient::soap_agentStats ( const SOAPMethod & request,
SOAPMethod & response ) [virtual]
 

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.

Parameters:
request  
response  

void DALT_Client::DALTClient::soap_clientStatus ( const SOAPMethod & request,
SOAPMethod & response ) [virtual]
 

returns performance information about this client (mainly the last cycle time and the average cycle time).

Parameters:
request  
response  

void DALT_Client::DALTClient::soap_createAgent ( const SOAPMethod & request,
SOAPMethod & response ) [virtual]
 

creates a new processing agent, given an ID and a type.

Parameters:
request  
response  

void DALT_Client::DALTClient::soap_newCycleNotify ( const SOAPMethod & request,
SOAPMethod & response ) [virtual]
 

notify all the agents managed by this client of the start of a new cycle.

Parameters:
request  
response  


Member Data Documentation

AgentWatcher * DALT_Client::DALTClient::agent_watcher
 

this class monitors the execution state of the agents managed by the client.

Definition at line 77 of file dalt_client.h.

vector< Agent *> DALT_Client::DALTClient::agents [protected]
 

vector containing all the agents.

Definition at line 64 of file dalt_client.h.

SOAPProxy * DALT_Client::DALTClient::endpoint
 

the server.

Definition at line 72 of file dalt_client.h.

string DALT_Client::DALTClient::location [protected]
 

location of this soap server.

Definition at line 66 of file dalt_client.h.

float DALT_Client::DALTClient::machine_speed [protected]
 

the indexed performance of th machine running on.

Definition at line 62 of file dalt_client.h.

string DALT_Client::DALTClient::server_location
 

location of the server.

Definition at line 74 of file dalt_client.h.

list< Agent *> DALT_Client::DALTClient::to_kill [protected]
 

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.


The documentation for this class was generated from the following file:
Generated at Thu Jan 31 15:20:23 2002 for DALT Client by doxygen1.2.8 written by Dimitri van Heesch, © 1997-2001