Scopira  20080306
scopira::agent::agent_i Class Referenceabstract

#include <agent.h>

Inheritance diagram for scopira::agent::agent_i:
scopira::tool::object scopira::agent::local_agent scopira::agent::cluster_agent

Public Member Functions

virtual ~agent_i ()
 dtor
 
virtual void notify_stop (void)=0
 notifies the agent to stop
 
virtual void wait_stop (void)=0
 
virtual void enqueue_network_quit (void)=0
 
virtual bool failed (void) const =0
 
virtual void set_agenterror_reactor (agenterror_reactor_i *r)=0
 sets the agenterror handler... there can only be one, eh
 
virtual void reg_context (scopira::tool::uuid &ctxid, taskmsg_reactor_i *reac)=0
 register a content
 
virtual void unreg_context (scopira::tool::uuid ctxid)=0
 unregister a content
 
virtual int find_services (scopira::tool::uuid &serviceid, scopira::basekit::narray< scopira::tool::uuid > &out)=0
 
virtual int universe_size (void)=0
 
virtual scopira::tool::uuid get_agent_id (void)=0
 
virtual scopira::tool::uuid launch_task (const std::type_info &t, scopira::tool::uuid where)=0
 
virtual scopira::tool::uuid launch_group (int numps, const std::type_info &t)=0
 
virtual void launch_slaves (scopira::tool::uuid masterid, int numtotalps, const std::type_info &t, scopira::basekit::narray< scopira::tool::uuid > &peers)=0
 
virtual void kill_task (scopira::tool::uuid ps)=0
 
virtual bool wait_task (scopira::tool::uuid ps, int msec)=0
 
virtual bool is_alive_task (scopira::tool::uuid ps)=0
 
virtual bool is_killed_task (scopira::tool::uuid ps)=0
 
virtual bool wait_msg (const uuid_query &srcq, scopira::tool::uuid &foundsrc, scopira::tool::uuid dest, int timeout)=0
 
virtual void send_msg (scopira::tool::uuid src, scopira::tool::uuid dest, scopira::tool::bufferflow *buf)=0
 
virtual void send_msg_bcast (scopira::tool::uuid src, scopira::tool::uuid destserviceid, scopira::tool::bufferflow *buf)=0
 
virtual void recv_msg (const uuid_query &srcq, scopira::tool::uuid &foundsrc, scopira::tool::uuid dest, scopira::tool::count_ptr< scopira::tool::bufferflow > &buf)=0
 
- Public Member Functions inherited from scopira::tool::object
virtual ~object ()
 
int add_ref (void) const
 
bool sub_ref (void) const
 
void auto_ref (void) const
 
int current_ref (void) const
 
virtual scopira::tool::oflow_iprint (scopira::tool::oflow_i &o) const
 
virtual bool load (scopira::tool::iobjflow_i &in)
 
virtual void save (scopira::tool::oobjflow_i &out) const
 
bool is_alive_object (void) const
 
bool is_dead_object (void) const
 

Static Public Member Functions

static agent_iinstance (void)
 
static agent_inew_agent (void)
 
static bool get_cluster_server_url (std::string &serverurl)
 

Protected Member Functions

 agent_i (void)
 ctor
 
- Protected Member Functions inherited from scopira::tool::object
 object (void)
 
 object (bool neverusecounter)
 

Detailed Description

Basic agent interface

Author
Aleksander Demko

Member Function Documentation

◆ enqueue_network_quit()

virtual void scopira::agent::agent_i::enqueue_network_quit ( void  )
pure virtual

tell the whole cluster to quit will result in a local notify_stop

Implemented in scopira::agent::cluster_agent, and scopira::agent::local_agent.

◆ failed()

virtual bool scopira::agent::agent_i::failed ( void  ) const
pure virtual

has this agent successfully booted up? if not, you shouldnt use it and probably just nuke it.

Implemented in scopira::agent::cluster_agent, and scopira::agent::local_agent.

Referenced by scopira::agent::agent_loop::failed(), and scopira::agent::task_context::failed().

◆ get_cluster_server_url()

static bool scopira::agent::agent_i::get_cluster_server_url ( std::string &  serverurl)
static

Gets the address of the current cluster server. returns true on success.

Author
Aleksander Demko

◆ instance()

◆ new_agent()

static agent_i* scopira::agent::agent_i::new_agent ( void  )
static

Instantiate a new agent... auto determines the internal type n such.

Author
Aleksander Demko

◆ wait_stop()

virtual void scopira::agent::agent_i::wait_stop ( void  )
pure virtual

block the caller until this agent_i has terminated because of a agent end message

Implemented in scopira::agent::local_agent.


The documentation for this class was generated from the following file: