Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members

epi::node::LocalNode Class Reference

#include <EpiLocalNode.hpp>

Inheritance diagram for epi::node::LocalNode:

epi::node::AbstractNode epi::node::AutoNode List of all members.

Public Member Functions

 LocalNode (const std::string aNodeId) throw (EpiBadArgument, EpiConnectionException, EpiException)
 LocalNode (const std::string aNodeId, const std::string aCookie) throw (EpiBadArgument, EpiConnectionException, EpiException)
 LocalNode (const std::string aNodeName, const std::string aCookie, ErlangTransport *transport) throw (EpiBadArgument, EpiConnectionException)
ErlPidcreatePid ()
ErlPortcreatePort ()
ErlRefcreateRef ()
short getCreation () const
Connectionconnect (const std::string node) throw (EpiConnectionException)
Connectionconnect (const std::string node, const std::string cookie) throw (EpiConnectionException)
Connectionaccept (long timeout=0) throw (EpiConnectionException)
Connectionaccept (const std::string cookie, long timeout=0) throw (EpiConnectionException)
void publishPort () throw (EpiConnectionException)
void unPublishPort () throw (EpiConnectionException)
MailBoxnewMailBox ()
MailBoxcreateMailBox (Connection *connection)

Protected Member Functions

void init (const std::string aNodeId, const std::string aCookie, ErlangTransport *transport) throw (EpiException)

Protected Attributes

short mCreation
unsigned int mPidCount
unsigned int mPortCount
unsigned int mSerial
unsigned int mRefId [3]
ErlangTransportmTransport

Static Protected Attributes

short smCreationCounter = 0

Detailed Description

Self managed node


Constructor & Destructor Documentation

LocalNode::LocalNode const std::string  aNodeId  )  throw (EpiBadArgument, EpiConnectionException, EpiException)
 

Create a new node, using default cookie an any port

Parameters:
aNodeId node identifier with the protocol, alivename, hostname and port. ex: "ei:mynode@host.somewhere.com:3128"
Exceptions:
EpiBadArgument if node name is too long
EpiConnectionException if there is a network problem
EpiException if there is an error in transport creation

LocalNode::LocalNode const std::string  aNodeId,
const std::string  aCookie
throw (EpiBadArgument, EpiConnectionException, EpiException)
 

Create a new node, using given cookie

Parameters:
aNodeId node identifier with the protocol, alivename, hostname and port. ex: "ei:mynode@host.somewhere.com:3128"
cookie cookie to use
Exceptions:
EpiBadArgument if node name is too long
EpiConnectionException if there is a network problem
EpiException if there is an error in transport creation

LocalNode::LocalNode const std::string  aNodeName,
const std::string  aCookie,
ErlangTransport transport
throw (EpiBadArgument, EpiConnectionException)
 

Create a new node, using given cookie

Parameters:
aNodeName node name
aCookie cookie to use
transport to use
Exceptions:
EpiBadArgument if node name is too long
EpiConnectionException if there is a network problem


Member Function Documentation

Connection * LocalNode::accept const std::string  cookie,
long  timeout = 0
throw (EpiConnectionException)
 

Accept a connection from a client process using other cookie This method sets the socket to listen incoming connections.

Parameters:
timeout timeout in ms
Returns:
A new connection. The connection has no receiver defined and is not started. returns 0 if timeout.

Connection * LocalNode::accept long  timeout = 0  )  throw (EpiConnectionException)
 

Accept a connection from a client process. This method sets the socket to listen incoming connections.

Parameters:
timeout timeout in ms
Returns:
A new connection. The connection has no receiver defined and is not started. returns 0 if timeout.

Connection * LocalNode::connect const std::string  node,
const std::string  cookie
throw (EpiConnectionException)
 

Set up a connection to an Erlang node, using other cookie

Parameters:
node node name to connect
cookie cookie to use
Returns:
A new connection. The connection has no receiver defined and is not started.

Connection * LocalNode::connect const std::string  node  )  throw (EpiConnectionException)
 

Set up a connection to an Erlang node, using the default cookie

Parameters:
node node name to connect
Returns:
A new connection. The connection has no receiver defined and is not started.

MailBox * LocalNode::createMailBox Connection connection  ) 
 

Create a new MailBox with a new pid associated to the given connection: the sender of mailbox is connection and the receiver of connection is the mailbox

ErlPid * LocalNode::createPid  ) 
 

Create a new unique pid

ErlPort * LocalNode::createPort  ) 
 

Create a new unique port

ErlRef * LocalNode::createRef  ) 
 

Create a new unique ref

short epi::node::LocalNode::getCreation  )  const [inline]
 

Get creation number FIXME: Where must be the creation number??? How does creation number work? EI documentation and code does not explain this :(.

void LocalNode::init const std::string  aNodeId,
const std::string  aCookie,
ErlangTransport transport
throw (EpiException) [protected]
 

Init counters for pids, ports and refs and the ErlangTransport to use

MailBox * LocalNode::newMailBox  ) 
 

Return new MailBox with a new pid. This mailbox has not a sender defined and must be set using setSender()

void LocalNode::publishPort  )  throw (EpiConnectionException)
 

Publish the node port

void LocalNode::unPublishPort  )  throw (EpiConnectionException)
 

Unpublish the node port


The documentation for this class was generated from the following files:
Generated on Wed Mar 30 22:04:45 2005 for EPI by doxygen 1.3.4