Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages | Examples

ColCOWS::Node Class Reference

#include <ColCOWS_Node.hh>

Inheritance diagram for ColCOWS::Node:

Inheritance graph
[legend]
Collaboration diagram for ColCOWS::Node:

Collaboration graph
[legend]
List of all members.

Detailed Description

ColCOWS Node class.

The Node class is the front end of ColCOWS library, the one appearing in the user source code. It manages the local CORBA object references and the workspace descriptions, local and remote. The class provides the user with methods for controlling the workspace life-cycle (activation/deactivation, connection/disconnection) and for exploring the references of the local and remote workspaces.

Todo:
Use separate classes for the management of the workspace descriptions

Todo:
Allow several event handlers to be connected
Examples:

TestClient.cc, TestClient2.cc, TestClient2_MPI.cc, TestServer.cc, and TestServer_MPI.cc.

Definition at line 73 of file ColCOWS_Node.hh.

Public Member Functions

 Node ()
 constructor
virtual ~Node ()
 destructor
virtual void printself (std::ostream &stream, int indent=0) const
 print self
void activate ()
 activate this node
void deactivate ()
 deactivate this node
bool isActivated () const
 test if the collective node is activated
unsigned long connect (const std::string &ws_id, const std::string &ws_kind)
 connect a remote workspace identified with an ID and a Kind on the local NameService
unsigned long connect (const std::string &ws_id, const std::string &ws_kind, const std::string &nameservice_str)
 connect a remote workspace identified with an ID and a Kind on another NameService
void disconnect (unsigned long num_connection)
 disconnect a remote workspace
void disconnectAll ()
 disconnect a remote workspace
bool isConnected (std::string ws_id, std::string ws_kind) const
 test if a workspace named 'ws_id' of kind 'ws_kind' is connected and return its connection number
bool isConnected (unsigned long num_connection) const
 test if a workspace with num_connection is connected and return its connection number
unsigned long getNumConnection (std::string ws_id, std::string ws_kind)
 test if a workspace named 'ws_id' of kind 'ws_kind' is connected and return its connection number
void getNumConnectionVec (std::vector< unsigned long > &num_connection_vec, std::string ws_id="", std::string ws_kind="")
 get a vector of connection numbers according to id or kind critera
unsigned long getRemoteNbNodes (unsigned long num_connection, std::string node_kind="")
 get size of a remote workspace
std::string getRemoteWorkspaceID (unsigned long num_connection)
 get id of a remote workspace
std::string getRemoteWorkspaceKind (unsigned long num_connection)
 get kind of a remote workspace
WorkspaceDescgetRemoteWorkspace (unsigned int num_connection)
 get a remote remote workspace description
unsigned long getLocalNbNodes (std::string node_kind="") const
 get size of the local workspace
std::string getLocalWorkspaceID () const
 get id of the local workspace
std::string getLocalWorkspaceKind () const
 get kind of the local workspace
WorkspaceDescgetLocalWorkspace ()
 get the local workspace description
unsigned int addEventHandler (EventHandler *event_handler)
 add an event handler in the manager
void removeEventHandler (unsigned int key)
 remove an event handler from the manager
void removeEventHandler (EventHandler *event_handler)
 remove an event handler from the manager
bool waitActivation (bool use_timeout=true)
 wait end of activation
bool waitDeactivation (bool use_timeout=true)
 wait end of deactivation
unsigned long waitConnection (std::string ws_id, std::string ws_kind, bool use_timeout=true)
 wait the connection of a remote workspace
unsigned long waitAllDisconnection (bool use_timeout=true)
 wait the disconnection of all the remote workspace
unsigned long waitDisconnection (std::string ws_id, std::string ws_kind, bool use_timeout=true)
 wait the disconnection of a remote workspace
EventHandlerManagergetEventHandlerManager ()
 get a pointer on the associated event handler
void setEventHandlerManager (EventHandlerManager *event_handler_manager)
 associate an event handler with the workspace
RemoteWorkspaceManagergetRemoteWorkspaceManager ()
 get a remote remote workspace manager
CORBA::ORB * getORB () const
 get the ORB pointer
void setORB (CORBA::ORB *orbp)
 set the ORB pointer

Static Public Member Functions

static NodeNew (std::string ws_id, std::string ws_kind, std::string node_kind, unsigned long num_node, unsigned long max_descendant, unsigned long nb_nodes, unsigned long num_father, CORBA::ORB *orbp)
 create a new node, full details
static NodeNewHierachical (std::string ws_id, std::string ws_kind, unsigned long num_node, unsigned long nb_nodes, unsigned long base, CORBA::ORB *orbp)
 create a new node, in hierarchy
static NodeNewNode (std::string ws_id, std::string ws_kind, std::string node_kind, unsigned long num_node, unsigned long nb_nodes, CORBA::ORB *orbp)
 create a new node, generical
static NodeNewProxy (std::string ws_id, std::string ws_kind, unsigned long nb_nodes, CORBA::ORB *orbp)
 create a new node, as proxy
static NodeNewPort (std::string ws_id, std::string ws_kind, unsigned long num_node, unsigned long nb_nodes, CORBA::ORB *orbp)
 create a new node, as node

Protected Member Functions

void onActivation (const IdlWorkspaceDesc &ws_desc)
 treatment on the activation of the workspace
void onDeactivation (const IdlWorkspaceDesc &ws_desc)
 treatment on the deactivation of the workspace
void onConnection (unsigned long num_connection, const IdlWorkspaceDesc &ws_desc, bool initiator)
 treatment on the connection of a remote workspace
void onDisconnection (unsigned long num_connection)
 treatment on the disconnection of a remote workspace

Static Protected Member Functions

static unsigned long calculNumFather (unsigned long min, unsigned long max, unsigned long num_child, unsigned long base)
static unsigned long calculMaxDescend (unsigned long min, unsigned long max, unsigned long num_child, unsigned long base)

Protected Attributes

CORBA::ORB * _orbp
 Pointer on the ORB.
EventHandlerManager_event_handler_manager
 event handler
NodeServant_node_servant
 Implementation of CORBA interface.
WorkspaceDesc_local_workspace
 local workspace description
RemoteWorkspaceManager_remote_workspace_manager
 remote workspace manager
bool _fully_activated
 boolean indicates the user activation treatements are terminated
pthread_mutex_t _event_mut
 event mutex
pthread_cond_t _event_cond
 event condition variable

Friends

class NodeServant


Member Function Documentation

void ColCOWS::Node::activate  ) 
 

activate this node

Do not ensure the workspace is activated after the return nor the "onActivation" treatments are done. Must call "waitActivation"

Examples:
TestClient.cc, TestClient2.cc, TestClient2_MPI.cc, TestServer.cc, and TestServer_MPI.cc.

Definition at line 639 of file ColCOWS_Node.cc.

References _node_servant, ColCOWS::NodeServant::activate(), and ColCOWS::NodeDesc::setActivated().

unsigned long ColCOWS::Node::connect const std::string &  ws_id,
const std::string &  ws_kind,
const std::string &  nameservice_str
 

connect a remote workspace identified with an ID and a Kind on another NameService

Ensure the workspace is connected and the "onConnection" treatments are done *

Definition at line 454 of file ColCOWS_Node.cc.

References _node_servant, and ColCOWS::NodeServant::connect().

unsigned long ColCOWS::Node::connect const std::string &  ws_id,
const std::string &  ws_kind
[inline]
 

connect a remote workspace identified with an ID and a Kind on the local NameService

Ensure the workspace is connected and the "onConnection" treatments are done *

Examples:
TestClient.cc, TestClient2.cc, and TestClient2_MPI.cc.

Definition at line 159 of file ColCOWS_Node.hh.

void ColCOWS::Node::deactivate  ) 
 

deactivate this node

Ensure the workspace is deactivated and the "onDeactivation" treatments are done *

Examples:
TestClient.cc, TestClient2.cc, TestClient2_MPI.cc, TestServer.cc, and TestServer_MPI.cc.

Definition at line 657 of file ColCOWS_Node.cc.

References _node_servant, ColCOWS::NodeServant::deactivate(), and ColCOWS::NodeDesc::setActivated().

void ColCOWS::Node::disconnect unsigned long  num_connection  ) 
 

disconnect a remote workspace

Ensure the workspace is disconnected and the "onDisonnection" treatments are done *

Definition at line 472 of file ColCOWS_Node.cc.

References _node_servant, ColCOWS::NodeServant::disconnect(), and isConnected().

void ColCOWS::Node::disconnectAll  ) 
 

disconnect a remote workspace

Ensure all the connection are closed and all the "onDisonnection" treatments are done *

Examples:
TestClient.cc, TestClient2.cc, TestClient2_MPI.cc, TestServer.cc, and TestServer_MPI.cc.

Definition at line 492 of file ColCOWS_Node.cc.

References _node_servant, and ColCOWS::NodeServant::disconnectAll().

bool ColCOWS::Node::waitActivation bool  use_timeout = true  ) 
 

wait end of activation

Ensure local onActivation treatments are done *

Examples:
TestClient.cc, TestClient2.cc, TestClient2_MPI.cc, TestServer.cc, and TestServer_MPI.cc.

Definition at line 776 of file ColCOWS_Node.cc.

References _event_cond, _event_mut, _fully_activated, ColCOWS::WAITING_RETRY, and ColCOWS::WAITING_TIMEOUT.

unsigned long ColCOWS::Node::waitAllDisconnection bool  use_timeout = true  ) 
 

wait the disconnection of all the remote workspace

Ensure local onDisconnection treatments are done *

Definition at line 908 of file ColCOWS_Node.cc.

References _event_cond, _event_mut, _remote_workspace_manager, ColCOWS::WAITING_RETRY, and ColCOWS::WAITING_TIMEOUT.

unsigned long ColCOWS::Node::waitConnection std::string  ws_id,
std::string  ws_kind,
bool  use_timeout = true
 

wait the connection of a remote workspace

Ensure local onConnection treatments are done *

Definition at line 861 of file ColCOWS_Node.cc.

References _event_cond, _event_mut, isConnected(), ColCOWS::NOT_CONNECTED, ColCOWS::WAITING_RETRY, and ColCOWS::WAITING_TIMEOUT.

bool ColCOWS::Node::waitDeactivation bool  use_timeout = true  ) 
 

wait end of deactivation

Ensure local onDeactivation treatments are done *

Examples:
TestClient.cc, TestClient2.cc, TestClient2_MPI.cc, TestServer.cc, and TestServer_MPI.cc.

Definition at line 819 of file ColCOWS_Node.cc.

References _event_cond, _event_mut, _fully_activated, ColCOWS::WAITING_RETRY, and ColCOWS::WAITING_TIMEOUT.

unsigned long ColCOWS::Node::waitDisconnection std::string  ws_id,
std::string  ws_kind,
bool  use_timeout = true
 

wait the disconnection of a remote workspace

Ensure local onDisconnection treatments are done *

Definition at line 950 of file ColCOWS_Node.cc.

References _event_cond, _event_mut, isConnected(), ColCOWS::NOT_CONNECTED, ColCOWS::WAITING_RETRY, and ColCOWS::WAITING_TIMEOUT.


The documentation for this class was generated from the following files:
Generated on Tue Jun 21 12:56:01 2005 for ColCOWS by  doxygen 1.4.1