Data-flow

Index


1.0 DOC++ generated API
2.0 Data-Flow Network description
3.0 Network Syntax
4.0 Defined Nodes
5.0 Creating New Network Nodes


1.0 DOC++ generated API

API


3.0 Network Syntax


Click here for the complete syntax reference.
 

4.0 Defined Nodes

 
Node Network Iterator
Constant InputStream OutputStream
Load Save List
AND Collector
IsValid MUX NOT
ExecNode PathList NotDone
OR Pack
Sum Switch UnPack
VNSum VSum

 

Node (abstract)

This is the base class from which all the nodes must derive. The following table should be the template to use to describe nodes.
 
NAME TYPE MEANING
Inputs none
Outputs none
Parameters none

Network (Node)

Technically, a Network is not a node, but it derives from node and it is possible to manipulate a Network as if it were a node.
 
NAME TYPE MEANING
Inputs user defined any Correspond to the missing input(s) from the node defined in <netInput: ...>
Outputs user defined any Corresponds to the output of the node defined in <netOutput: ...>
Parameters user defined any Correspond to the use of subnet_params: in a node's parameters

Iterator (Network)

Technically, an Iterator is not a node, but it derives from node and it is possible to manipulate a Network as if it were a node.
 
NAME TYPE MEANING
Inputs user defined any Correspond to the missing input(s) from the node defined in <netInput: ...>
Outputs user defined any Corresponds to the output of the node defined in <netOutput: ...>
Parameters DOWHILE

user defined

any

any

If specified, the iterator acts as a do{}while() in C and 
returns the output just after the condition goes to false
Correspond to the use of subnet_params: in a node's parameters

Constant (Node)

Defines a constant. It returns always the same value regardless of everything else
 
NAME TYPE MEANING
Inputs none
Outputs VALUE any The object sent as the VALUE parameter
Parameters VALUE any The value of the constant

InputStream (Node)

Opens a file (read-only) and returns an input stream to it
 
NAME TYPE MEANING
Inputs INPUT String The file name
Outputs OUTPUT IFStream The input stream corresponding to the file
Parameters none

OutputStream (Node)

Opens a file (write-only) and returns an output stream to it
 
NAME TYPE MEANING
Inputs INPUT String The file name
Outputs OUTPUT OFStream The output stream corresponding to the file
Parameters none

template <class T> Load<T> (Node)

Loads an object from an input stream
 
 
NAME TYPE MEANING
Inputs STREAM IFStream The input stream
Outputs OUTPUT T The loaded object
Parameters none

Save (Node)

Saves an object to an output stream
 
NAME TYPE MEANING
Inputs STREAM
OBJECT
OFStream
any (that supports <<)
The output stream
The object to save
Outputs OUTPUT Object (nilObject) Returns nil (no result)
Parameters none

List (Node)

Reads a file and returns all the lines in a vector (useful for loading a list of files to process)
 
NAME TYPE MEANING
Inputs STREAM IFStream The input stream of the file to read
Outputs OUTPUT Vector<ObjectRef> A Vector (of Strings) containing each line of the file
Parameters none

AND (Node)

Logical AND reads all connected inputs and AND the result giving a value true of false.
 
NAME TYPE MEANING
Inputs UNLIMITED (user defined names) Bool The N connected inputs to be ANDed
Outputs OUTPUT Bool The AND result
Parameters none

Collector (Node)

Collects the inputs of any kinds to the same node.
 
NAME TYPE MEANING
Inputs UNLIMITED (user defined names) any We are connecting ObjectRefs with the desired name.
Outputs UNLIMITED (user defined names) any This is a special case, the output = the input. The outputs names are the same than the inputs name. We ca say tha this is a pass through node.
Parameters none


 

IsValid (Node)

Verifies if the specified Object status is valid.
 
NAME TYPE MEANING
Inputs INPUT any Check for the status of any Object
Outputs OUTPUT Bool Return true or false Bool values.
Parameters none

MUX (Node)

This is a multiplexer! This is intended multiple inputs and one output.
 
NAME TYPE MEANING
Inputs 
  • SWITCH
  • UNLIMITED
  • String
  • any
  • The desired input Name of the MUX
  • The  named inputs of any type (ObjectRef)
Outputs
  • OUTPUT
  • any
  • The output selected by the SWITCH input.
Parameters none none none

NOT (Node)

This is a logical NOT (Inverter).
 
NAME TYPE MEANING
Inputs INPUT Bool The input to be negated (inverter)
Outputs OUTPUT Bool The nagated value of the input
Parameters none


 

ExecNode (Node)

This node executes a program and gets its standard output.
 
NAME TYPE MEANING
Inputs
  • CMDSTRING_IN
  • ARGS_IN
  • String
  • String
  • The command line
  • Arguments added to the command line
Outputs
  • STRING_OUT
  • STATUS_OUT
  • String
  • Int
  • The standard output caught from the program's output
  • The returned status of the program
Parameters none

PathList (Node)

It gets the list of file from a path.
 
NAME TYPE MEANING
Inputs
  • PATH
  • EXTENSION
  • String
  • String
  • The path where to read the files
  • The extension of the files we want to read
Outputs
  • FILENAME_OUT
  • FULLNAME_OUT
  • String
  • String
  • The filename without the complete path
  • The complete path + filename
Parameters none

NotDone (Node)

Returns true unless the status of the input is past_end
 
NAME TYPE MEANING
Inputs INPUT any All that counts is the status of the object
Outputs OUTPUT Bool Are we done (condition for the iterator)
Parameters none

OR (Node)

Logical OR, returns the ORed results (Bool)
 
NAME TYPE MEANING
Inputs UNLIMITED Bool Any number of Bool inputs
Outputs OUTPUT Bool The ORed result of all Bool inputs
Parameters none

Pack (Node)

Accumulates the input in a vector
 
NAME TYPE MEANING
Inputs INPUT any The objects to accumulate
Outputs OUTPUT Vector<ObjectRef> A Vector containing all the inputs
Parameters none

 

Sum (Node)

Sums all the input vectors
 
NAME TYPE MEANING
Inputs INPUT Float The value to accumulate
Outputs OUTPUT Float The sum of all the inputs
Parameters none

Switch (Node)

Propagates the inputs to the outputs if the condition is met.
 
NAME TYPE MEANING
Inputs
  • CONDITION
  • UNLIMITED
  • Bool
  • any
  • The condition to meet to propagates the inputs to the outputs
  • Any number of inputs (ObjectRef)
Outputs UNLIMITED any The propagated inputs
Parameters none

UnPack (Node)

Extracts simgle objects from a Vector of objects (see Pack)
 
NAME TYPE MEANING
Inputs INPUT Vector<ObjectRef> The Vector to unpack
Outputs OUTPUT any An element of the input Vector
Parameters none

VNSum (Node)

Same as VSum, except that only the values above the average are added.
 
NAME TYPE MEANING
Inputs INPUT Vector<ObjectRef> The Vectors to add
Outputs OUTPUT Vector<ObjectRef> The result of the Sum
Parameters none

VSum (Node)

Same as Sum, but operates on a a Vector of ObjectRef's to Floats
 
NAME TYPE MEANING
Inputs INPUT Vector<ObjectRef> The Vectors to add
Outputs OUTPUT Vector<ObjectRef> The result of the Sum
Parameters none



5.0 Creating New Network Nodes

Every Node should derive from base class Node. Here are the virtual methods you MUST define when creating a new node :
 

Method(s)

Comment(s)

Constructor of the node with (string nodeName, const ParameterSet &params);
  • We must be able to build new nodes with given name and parameters.
virtual ObjectRef getOutput(int output_id, int count); 
  • This is the most important part of the node. It asks its inputs to return their values and returns the result of the processing. 

Here are the virtual methods that you MAY define if the already defined methods in Node are not doing the job!
 
 

Method(s)

Impact Level

Comments(s)

virtual ObjectRef getOutputNamed (const string &outputName, int count); OPTIONAL
  • We are using output names only for convenience. The already defined getOutputNamed from Node will work if you did add inputs and outputs with the addOutput(...) and addInput(...) methods.
virtual void connectToNode(string in, Node *inputNode, string out); NOT RECOMMANDED
  • This is very dangerous to change this method. It connects two Nodes with a predetermined protocol. We only had to redefine this method for Sub Networks and the Iterator. You should not need to redefine this method for standard Nodes.
virtual void initialize (); NOT RECOMMANDED
  • This is very dangerous to change this method. The initialization of the nodes requires a special handling for proper initialization.
virtual void specificInitialize(); RECOMMANDED
  • This is the specific Node initialization. If you have initialization to do when all the nodes are connected, you should redefine this method.
virtual bool hasOutput(int output_id) const; NOT RECOMMANDED
  • If you have added ouputs with the addOutput method, you shoud never need to redefine this method.
virtual void setDebugMode(); OPTIONAL
  • Sets the debug flag for the node. You can do more things if you want to...
virtual void resetDebugMode(); OPTIONAL
  • Resets the debug flag for the node.
virtual void reset(); RECOMMANDED
  • Needed if the node needs proper reinitialization else than setting the processCount to -1.
virtual void request(const ParameterSet &req); OPTIONAL
  • This is a way to request someting to our inputs node at initialization time.
virtual int translateInput(string inputName); NOT RECOMMANDED
  • Be careful with that. It translates input strings to integer that represent the input number. You do not need to take care of this method if you are using addInput.
virtual int translateOutput(string inputName); NOT RECOMMANDED
  • Be careful with that. It translates ouput strings to integer that represent the output number. You do not need to take care of this method if you are using addOutput.

 
 



Jean-Marc Valin, Université de Sherbrooke
Dominic Létourneau, Université de Sherbrooke
$Date: 1999/08/26 15:09:14 $