#include <EpiAutoNode.hpp>
Inheritance diagram for epi::node::AutoNode:

Public Member Functions | |
| AutoNode (const std::string aNodeName) throw (EpiBadArgument, EpiConnectionException) | |
| AutoNode (const std::string aNodeName, const std::string aCookie) throw (EpiBadArgument, EpiConnectionException) | |
| AutoNode (const std::string aNodeName, const std::string aCookie, ErlangTransport *transport) throw (EpiBadArgument, EpiConnectionException) | |
| MailBox * | createMailBox () |
| void | deattachMailBox (MailBox *mailbox) |
| void | registerMailBox (const std::string name, MailBox *mailbox) |
| void | unRegisterMailBox (const std::string name) |
| void | unRegisterMailBox (MailBox *mailbox) |
| void | close () |
| void | startAcceptor () throw (EpiConnectionException) |
| void | run () |
| void | deliver (void *origin, EpiMessage *msg) |
| virtual OutputBuffer * | newOutputBuffer () |
| void | sendBuf (epi::type::ErlPid *from, epi::type::ErlPid *to, epi::node::OutputBuffer *buffer) throw (epi::error::EpiConnectionException) |
| void | sendBuf (epi::type::ErlPid *from, const std::string &to, epi::node::OutputBuffer *buffer) throw (epi::error::EpiConnectionException) |
| void | sendBuf (epi::type::ErlPid *from, const std::string &node, const std::string &to, epi::node::OutputBuffer *buffer) throw (epi::error::EpiConnectionException) |
| void | event (EpiObservable *observed, EpiEventTag event) |
Protected Member Functions | |
| void | addMailBox (MailBox *mailbox) |
| MailBox * | getMailBox (ErlPid *pid) |
| MailBox * | getMailBox (std::string name) |
| void | removeMailBox (MailBox *mailbox) |
| Connection * | getConnection (std::string name) |
| void | addConnection (Connection *connection) |
| void | removeConnection (Connection *connection) |
| void | flushConnections () |
| Connection * | attempConnection (std::string name) throw (EpiConnectionException) |
Once an instance of this class has been created, obtain one or more mailboxes in order to send or receive messages. The first message sent to a given node will cause a connection to be set up to that node. Any messages received will be delivered to the appropriate mailboxes.
Mailboxes can be named using registerMailBox(). Messages can be sent to named mailboxes and named Erlang processes without knowing the pid that identifies the mailbox. This is neccessary in order to set up initial communication between parts of an application. A MailBox can have one or more names.
To shut down the node, call close(). This will prevent the node from accepting additional connections and it will cause all existing connections to be closed. Any unread messages in existing mailboxes can still be read, however no new messages will be delivered to the mailboxes.
Note that the use of this class requires that Epmd (Erlang Port Mapper Daemon) is running on each cooperating host. This class does not start Epmd automatically as Erlang does, you must start it manually or through some other means. See the Erlang documentation for more information about this.
|
|
Create a new node, using default cookie an any port
|
|
||||||||||||
|
Create a new node, using given cookie
|
|
||||||||||||||||
|
Create a new node, using given cookie
|
|
|
Add a connection to the map of Connections. This node will be set as receiver for this connection. Connection will be started and must not be running. I also deletes the connections in the flush list (list of connections to be deleted). |
|
|
Add mailbox to the map of associated mailboxes. This node will be set as sender for mailbox. This node will monitor the mailbox. |
|
|
Get the connection for given name. If no connection exists, try to setup a connection, adding it to the map |
|
|
Close this node. All connections will be closed and no more connections will be created or accepted. |
|
|
Create a new MailBox with a new pid associated to this node. The MailBox will use this node as sender and this node will deliver to this mailbox all messages with mailbox pid as destination. MailBox pointer owership belongs to this node. |
|
|
Deatach a mailbox from this AutoNode. The mailbox will be unregistered from mailboxes lists and will not recive more messages. It will not be deleted and owership by this node is lost, so the user MUST delete the mailbox after call this method. |
|
||||||||||||
|
Deliver incoming message This method will analize the message content, delivering it to the destination mailbox. |
|
||||||||||||
|
Receive an event from an observed object. If the sender is a mailbox and event is EVENT_DESTROY, mailbox will be deleted from mailbox list. |
|
|
Delete all connections in the flush list (connections to be deleted). This method is not guarded, and must be called from a guarded method. |
|
|
Get connection by node name from internal map |
|
|
Get mailbox by string |
|
|
Get mailbox by pid |
|
|
Create a new OutputBuffer to be used with this sender. The output buffer used by AutoNode is a plain buffer that simply stores the term. |
|
||||||||||||
|
Register an MailBox with given name. MailBox must be associated to this node. |
|
|
Remove and delete a connection. It deletes connection only if it exists in connection map. It really adds the connection to a list of connections to be deleted. This allows a connection thread to remove himself. |
|
|
Remove a mailbox |
|
|
Connection acceptor thread code. The node will automacly accept incomming connections. |
|
||||||||||||||||||||
|
Send a buffer to a registered server in the given node |
|
||||||||||||||||
|
Send a buffer to a registered server. |
|
||||||||||||||||
|
Send a buffer to a pid. |
|
|
Start acceptor thread. Call this method to accept new connections automacly.
|
|
|
Unregister all names for this mailbox |
|
|
Unregister a name for a mailbox |
1.3.4