<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to FlowDesigner_Programmer's_Guide</title><link>https://sourceforge.net/p/flowdesigner/wiki/FlowDesigner_Programmer%2527s_Guide/</link><description>Recent changes to FlowDesigner_Programmer's_Guide</description><atom:link href="https://sourceforge.net/p/flowdesigner/wiki/FlowDesigner_Programmer's_Guide/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 28 May 2014 12:45:22 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/flowdesigner/wiki/FlowDesigner_Programmer's_Guide/feed" rel="self" type="application/rss+xml"/><item><title>FlowDesigner_Programmer's_Guide modified by Dominic Letourneau</title><link>https://sourceforge.net/p/flowdesigner/wiki/FlowDesigner_Programmer%2527s_Guide/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -5,9 +5,9 @@

-# Class Diagrams
+# API and Classes Diagrams

-# Doxygen API
+  * Will be available soon. 

 # Writing New Nodes

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominic Letourneau</dc:creator><pubDate>Wed, 28 May 2014 12:45:22 -0000</pubDate><guid>https://sourceforge.netff259b65acfa8e3bc4295dd50818aaa7e4568e16</guid></item><item><title>FlowDesigner_Programmer's_Guide modified by Dominic Letourneau</title><link>https://sourceforge.net/p/flowdesigner/wiki/FlowDesigner_Programmer%2527s_Guide/</link><description>&lt;div class="markdown_content"&gt;&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#introduction"&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#class-diagrams"&gt;Class Diagrams&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#doxygen-api"&gt;Doxygen API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#writing-new-nodes"&gt;Writing New Nodes&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#example-vaddcc"&gt;Example: VAdd.cc&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#adding-new-data-type"&gt;Adding New Data Type&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#creating-new-operators"&gt;Creating New Operators&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#double-dispatched-operators"&gt;Double Dispatched Operators&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;h1 id="class-diagrams"&gt;Class Diagrams&lt;/h1&gt;
&lt;h1 id="doxygen-api"&gt;Doxygen API&lt;/h1&gt;
&lt;h1 id="writing-new-nodes"&gt;Writing New Nodes&lt;/h1&gt;
&lt;p&gt;Most of the new nodes will derive from either the Node abstract class or the BufferedNode abstract class. You should use public inheritance when deriving your new class. In all cases, you will need to define a constructor for your new node class. The parameters for this constructors are: (string nodeName, const ParameterSet &amp;amp;params), which are used to initialize the base class, e.g. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;include&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;BufferedNode.h&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;class&lt;/span&gt; &lt;span class="n"&gt;MyNode&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="n"&gt;BufferedNode&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
    &lt;span class="n"&gt;public&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; 
       &lt;span class="n"&gt;MyNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nodeName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;BufferedNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nodeName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

       &lt;span class="p"&gt;...&lt;/span&gt; 
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Also, if you derive from BufferedNode, you need to define the virtual void calculate(int output_id, int count, Buffer &amp;amp;out) method. The arguments are the ID of the input requested (output_id), the iteration ID (count) and the output buffer for the requested output (out). The calculate method is expected to assign an object to out&lt;span&gt;[count]&lt;/span&gt;. &lt;/p&gt;
&lt;p&gt;If you derive directly from the Node class, you will need to override the ObjectRef getOutput(int output_id, int count) method. The meaning of output_id and count is the same as for the BufferedNode equivalent, and the result should be returned as an ObjectRef. &lt;/p&gt;
&lt;p&gt;Here are some other methods you might want to define too: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;void initialize(): As the name implies, it is meant to perform some initialization that cannot be done within the constructor. This method is called only once, starting the processing, but after all the request() have been made. In most (all) cases initialize() should start by calling the base class implementation (e.g. BufferedNode::initialize()). &lt;/li&gt;
&lt;li&gt;void reset(): This method should return the node to the same state it was after initialize() was first called. In most (all) cases reset() should start by calling the base class implementation (e.g. BufferedNode::reset()). &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In some rare cases, you will want to define the following method: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;void request(int outputID, const ParameterSet &amp;amp;req): This method is meant to pass on special requests to input nodes. For now, this is mainly used by the BufferedNode class to compute the size needed for the output buffers. Remember that if you override this method, you must make sure that it propagates the request to all its input nodes. Otherwise, the nodes that won't be reached will have incorrect buffer size. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At last for a new node to be visible in flowdesigner, a special header must be present. An example of this is: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;    &lt;span class="n"&gt;class&lt;/span&gt;  &lt;span class="n"&gt;MyNode&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;DECLARE_NODE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;MyNode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="cm"&gt;/*Node&lt;/span&gt;
&lt;span class="cm"&gt;     *&lt;/span&gt;
&lt;span class="cm"&gt;     * @name  MyNode&lt;/span&gt;
&lt;span class="cm"&gt;     * @category  MyCategory:MySubCategory&lt;/span&gt;
&lt;span class="cm"&gt;     * @description  Some description of what MyNode does&lt;/span&gt;
&lt;span class="cm"&gt;     * &lt;/span&gt;
&lt;span class="cm"&gt;     * @input_name  SOME_INPUT_NAME&lt;/span&gt;
&lt;span class="cm"&gt;     * @input_type  this_input_type&lt;/span&gt;
&lt;span class="cm"&gt;     * @input_description  Description of this input&lt;/span&gt;
&lt;span class="cm"&gt;     * &lt;/span&gt;
&lt;span class="cm"&gt;     * @input_name  SOME_OTHER_INPUT&lt;/span&gt;
&lt;span class="cm"&gt;     * @input_type  that_input_type&lt;/span&gt;
&lt;span class="cm"&gt;     * @input_description  Description of that output&lt;/span&gt;
&lt;span class="cm"&gt;     * &lt;/span&gt;
&lt;span class="cm"&gt;     * @output_name  SOME_OUTPUT&lt;/span&gt;
&lt;span class="cm"&gt;     * @output_type  this_output_type&lt;/span&gt;
&lt;span class="cm"&gt;     * @output_description  Description of the output&lt;/span&gt;
&lt;span class="cm"&gt;     * &lt;/span&gt;
&lt;span class="cm"&gt;     * @parameter_name  SOME_PARAMETER&lt;/span&gt;
&lt;span class="cm"&gt;     * @parameter_type  this_parameter_type&lt;/span&gt;
&lt;span class="cm"&gt;     * @parameter_description  The description of the parameter&lt;/span&gt;
&lt;span class="cm"&gt;     *&lt;/span&gt;
&lt;span class="cm"&gt;     * END*/&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Although this header is only a C++ comment, it is parsed by a PERL script to produce an XML description of each toolbox. The DECLARE_NODE(MyNode) macro is used to register the node in a dictionary when the toolbox is dynamically loaded. &lt;/p&gt;
&lt;h2 id="example-vaddcc"&gt;Example: VAdd.cc&lt;/h2&gt;
&lt;p&gt;Most nodes must include BufferedNode.h. Also, since this node deals with vectors, we need Vector.h &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="cp"&gt;#include &amp;quot;BufferedNode.h&amp;quot; &lt;/span&gt;
&lt;span class="cp"&gt;#include &amp;quot;Vector.h&amp;quot;&lt;/span&gt;

&lt;span class="c1"&gt;//forward declaration of class VAdd for use with the DECLARE_NODE macro&lt;/span&gt;
&lt;span class="n"&gt;class&lt;/span&gt; &lt;span class="n"&gt;VAdd&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;//Declaration of the node. This definition is transformed into XML data for the GUI, as well as documentation for the node&lt;/span&gt;
&lt;span class="n"&gt;DECLARE_NODE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;VAdd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="cm"&gt;/*Node  &lt;/span&gt;
&lt;span class="cm"&gt; *  &lt;/span&gt;
&lt;span class="cm"&gt; * @name VAdd  &lt;/span&gt;
&lt;span class="cm"&gt; * @category DSP:Base  &lt;/span&gt;
&lt;span class="cm"&gt; * @description Adds two vectors of same length  &lt;/span&gt;
&lt;span class="cm"&gt; *&lt;/span&gt;
&lt;span class="cm"&gt; *  &lt;/span&gt;
&lt;span class="cm"&gt; * @input_name INPUT1  &lt;/span&gt;
&lt;span class="cm"&gt; * @input_type Vector&amp;amp;lt;float&amp;amp;gt;  &lt;/span&gt;
&lt;span class="cm"&gt; *&lt;/span&gt;
&lt;span class="cm"&gt; * @input_description First vector  &lt;/span&gt;
&lt;span class="cm"&gt; *  &lt;/span&gt;
&lt;span class="cm"&gt; * @input_name INPUT2  &lt;/span&gt;
&lt;span class="cm"&gt; * @input_type Vector&amp;amp;lt;float&amp;amp;gt;  &lt;/span&gt;
&lt;span class="cm"&gt; * @input_description Second vector  &lt;/span&gt;
&lt;span class="cm"&gt; *  &lt;/span&gt;
&lt;span class="cm"&gt; * @output_name OUTPUT  &lt;/span&gt;
&lt;span class="cm"&gt; * @output_type Vector&amp;amp;lt;float&amp;amp;gt;  &lt;/span&gt;
&lt;span class="cm"&gt; * @output_description Result vector    &lt;/span&gt;
&lt;span class="cm"&gt; * &lt;/span&gt;
&lt;span class="cm"&gt;END*/&lt;/span&gt;

&lt;span class="c1"&gt;//Class definition/implementation. Note that because we won't need to derive from this class, we don't need a header file (.h) and we can put everything in the .cc. Our node, like most other nodes, derives from BufferedNode.&lt;/span&gt;

    &lt;span class="n"&gt;class&lt;/span&gt; &lt;span class="n"&gt;VAdd&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="n"&gt;BufferedNode&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;input1ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
       &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;input2ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
       &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;outputID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;public:&lt;/span&gt;
       &lt;span class="n"&gt;VAdd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;nodeName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ParameterSet&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;BufferedNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nodeName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
       &lt;span class="p"&gt;{&lt;/span&gt;

          &lt;span class="c1"&gt;//In the constructor, we create both the inputs and outputs.&lt;/span&gt;
          &lt;span class="n"&gt;input1ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;addInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;INPUT1&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
          &lt;span class="n"&gt;input2ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;addInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;INPUT2&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
          &lt;span class="n"&gt;outputID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;addOutput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;OUTPUT&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;

       &lt;span class="c1"&gt;//This is the main method for the node, it is called from the BufferedNode class each time a result needs to be calculated.&lt;/span&gt;
       &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;calculate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;output_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Buffer&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
       &lt;span class="p"&gt;{&lt;/span&gt; 
          &lt;span class="c1"&gt;//Get input data from previous node(s).&lt;/span&gt;
          &lt;span class="n"&gt;ObjectRef&lt;/span&gt; &lt;span class="n"&gt;input1Value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input1ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
          &lt;span class="n"&gt;ObjectRef&lt;/span&gt; &lt;span class="n"&gt;input2Value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input2ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
          &lt;span class="c1"&gt;//We cast the generic objects (received through ObjectRefs) into a reference to a Vector&amp;amp;lt;float&amp;amp;gt;. &lt;/span&gt;
          &lt;span class="c1"&gt;//If the cast fails, an exception will automatically be thrown.&lt;/span&gt;

          &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;Vector&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;in1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;object_cast&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input1Value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
          &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;Vector&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;in2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;object_cast&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input2Value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

          &lt;span class="c1"&gt;//Check that the size of the two vectors match. Otherwise, throw an exception. &lt;/span&gt;
          &lt;span class="c1"&gt;//Here __FILE__ and __LINE__ are pre-processor macros that will print the file and line where this exception was thrown.&lt;/span&gt;

          &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;in1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;in2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
              &lt;span class="n"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;NodeException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                                      &lt;span class="s"&gt;&amp;quot;Input vectors must be of same length&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                       &lt;span class="n"&gt;__FILE__&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;__LINE__&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

          &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;inputLength&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;in1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

          &lt;span class="c1"&gt;//Allocate a new Vector&amp;amp;lt;float&amp;amp;gt; from the pool of free vectors (that's why we don't use new).&lt;/span&gt;
          &lt;span class="n"&gt;Vector&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Vector&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;alloc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inputLength&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

          &lt;span class="c1"&gt;//Put the new Vector&amp;amp;lt;float&amp;amp;gt; in the return buffer.&lt;/span&gt;
          &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

          &lt;span class="c1"&gt;//Compute the result of the sum.&lt;/span&gt;
          &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h1 id="adding-new-data-type"&gt;Adding New Data Type&lt;/h1&gt;
&lt;p&gt;It is possible to define new types in FlowDesigner. In order to be used in new nodes, new types must derive from the Object base class. That the only absolute requirement. However, if you want the new type to integrate more closely with FlowDesigner, there are several things you can do: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Implement the void printOn(ostream &amp;amp;out) const method. This method writes the object to the out stream. &lt;/li&gt;
&lt;li&gt;Implement the void readFrom (istream &amp;amp;in). &lt;/li&gt;
&lt;li&gt;Add the macro DECLARE_TYPE(MyType) to the C++ file where the object is implemented. &lt;br /&gt;
There is a certain format which all Object must respect. The object should start with "&amp;lt;MyType" and end with "&amp;gt;" (without the quotes). Usually, every field will be inside &lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="creating-new-operators"&gt;Creating New Operators&lt;/h1&gt;
&lt;h2 id="double-dispatched-operators"&gt;Double Dispatched Operators&lt;/h2&gt;
&lt;p&gt;It is possible to define binary operators that can act on different kinds of input. One example is the "add" operator, which can be used to add two ints, two floats, two vectors, or an int and a float, ... See data-flow/include/operators.h &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominic Letourneau</dc:creator><pubDate>Wed, 28 May 2014 12:45:22 -0000</pubDate><guid>https://sourceforge.net67564701e2afc2b2d5547a515795d7d40a01e52d</guid></item></channel></rss>