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

Node Class Reference

#include <Node.h>

List of all members.


Detailed Description

A Node is the primary unit of computation in models created using DTPF.

Nodes accept inputs, produce outputs, and are event driven. Each Node keeps track of its own collection of EndpointID's which identify the set of communication endpoints it provides.

All Nodes will be derived from this superclass.

Algorithm for Connection Establishment:

1) Connection data format is established. Both the upstream node(s) and the downstream node(s) have to agree on the FormatModel. For now, this must be exactly the same FormatModel.

2) The Roster sends a message to Nodes to indicate the BufferGroup they will use. I.e., it gives a BufferGroupDescriptor. BufferGroup class methods can be used to map a BufferGroupDescriptor to shared memory. Depending on the amount of data involved in the FormatModel for the BufferGroup, a BufferGroup will not be implemented by shared memory, but just by message passing. I.e., if the FormatModel does not require much memory for each buffer, then message passing without shared memory is a good option.

3) Upstream nodes, in the Node superclass implementation, will keep track of a list of downstream nodes. On every "send" for a broadcast connection, the upstream node will send to that list of downstream nodes. This will be handled through the event looper for the Node. The event looper will have a particular event case which requests it to add a downstream node into a broadcast connection.


Public Member Functions

 Node ()
 The Node constructor is responsible for registering the Node.
virtual ~Node ()

Protected Member Functions

virtual status_t StartProcessing ()
 The event looper for this Node calls this method to initate processing by the Node in response to an event received from the Roster.
virtual void BufferReceived (BufferDescriptor **bd)
 Method called by event looper for the Node when a buffer of data is received for the Node.
virtual status_t StopProcessing ()
 In response to an event received from the Roster, the event looper for this Node calls StopProcessing.
virtual status_t GetState (NodeState *state)
 Either Started or Stopped.
virtual status_t GetParameters (muscle::Message *parameters)
 These methods can be called while the Node is Started or Stopped.
virtual status_t SetParameters (muscle::Message parameters)
virtual status_t OpenConnection (EndpointID eid, muscle::Message *requestedFormatModel)
 Attempt to open a connection with the node, on a particular communication end point.
virtual status_t CloseConnection (EndpointID eid)

Private Attributes

NodeState m_nodeState


Constructor & Destructor Documentation

Node::Node  ) 
 

The Node constructor is responsible for registering the Node.

(See the Roster method RegisterNode.) The event looper for the Node will be started once the Node constructor is finished.

Node::~Node  )  [virtual]
 


Member Function Documentation

void Node::BufferReceived BufferDescriptor **  bd  )  [protected, virtual]
 

Method called by event looper for the Node when a buffer of data is received for the Node.

The buffer will not only contain information for processing by the Node, but also information regarding which Node input it is intended for.

Messages that may be sent to a Node:

START_PROCESSING
STOP_PROCESSING
GET_PARAMETERS
SET_PARAMETERS
OPEN_CONNECTION
In the case of opening a connection to a downstream node, this needs to give information about the downstream node. CLOSE_CONNECTION

status_t Node::CloseConnection EndpointID  eid  )  [protected, virtual]
 

status_t Node::GetParameters muscle::Message *  parameters  )  [protected, virtual]
 

These methods can be called while the Node is Started or Stopped.

The intent of these methods is to enable the Roster to Get or Set the parameters of the Node.

status_t Node::GetState NodeState state  )  [protected, virtual]
 

Either Started or Stopped.

It will be Started if StartProcessing has been called (without a call to StopProcessing), and Stopped if StopProcessing has been called (without a call to StartProcessing).

status_t Node::OpenConnection EndpointID  eid,
muscle::Message *  requestedFormatModel
[protected, virtual]
 

Attempt to open a connection with the node, on a particular communication end point.

Connections can only be made between Nodes which are in the Stopped state.

Parameters:
requestedFormatModel,and gives a requested FormatModel for the communication end point.
Returns:
E_OK iff the connection could be established.

E_BAD_FORMAT if the FormatModel was not acceptable to the Node.

E_ALREADY_STARTED if the node was not in the Stopped state

status_t Node::SetParameters muscle::Message  parameters  )  [protected, virtual]
 

status_t Node::StartProcessing  )  [protected, virtual]
 

The event looper for this Node calls this method to initate processing by the Node in response to an event received from the Roster.

Immediately after the event is sent from the Roster to have StartProcessing called, the Roster will indicate the state of the Node is "Starting". After StartProcessing has completed, an event will be sent to the Roster indicating that the Node is Started, and the Roster will reflect this state change.

status_t Node::StopProcessing  )  [protected, virtual]
 

In response to an event received from the Roster, the event looper for this Node calls StopProcessing.

Immediately after this event is sent from the Roster to this Node, the Roster indicates the state of this node is "Stopping". After StopProcessing is finished execution an event is sent to the roster. After this latter event is received by the Roster, the state of this Node indicated by the Roster is Stopped.


Member Data Documentation

NodeState Node::m_nodeState [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Aug 3 07:26:19 2005 for DTPF by  doxygen 1.3.9.1