<?php $isip_window_title = "ISIP Homepage"; ?>
<?php include("/data/isip/www/templates/documentation/header/header.html"); ?>

<!--#set var="isip_page_title" value="Recipe" -->
<?php include("/data/isip/www/templates/documentation/body/index_class.html"); ?>
<?php include("/data/isip/www/templates/documentation/body/bar.html"); ?>

<a name="name">
<b>
name:
<a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h">Recipe</a>
</b>

<br><br>

<a name="synopsis">
<b>synopsis:</b>
<br><br>

<blockquote>
<pre>
g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_sp.a

#include &lt;Recipe.h&gt;

Recipe();
Recipe(const Recipe& arg);
boolean isEmpty() const;
boolean readGraph(Sof& sof, long graph_tag = 0);
</pre>
</blockquote>

<a name="quick_start">
<b>quick start:</b>
<br><br>

<blockquote>
<pre>
Recipe rcp;
Sof sof;
sof.open(L"diagnose_container.sof");
rcp.readGraph(sof);
</pre>
</blockquote>

<a name="description"> 
<b>description:</b>
<br><br>

The Recipe class is used by the

<a href="../FrontEnd/index.html">FrontEnd</a>

class to allow the user to
specify an arbitrary signal flow graph for front end processing. The
user specifies what processing should take place to transform input
to output by specifying a graph using the

<a href="../../../util/speech/isip_transform_builder/index.html">
transform_builder</a>.

This class is responsible for reading in Component graph and
finding the appropriate processing paths through the graph.

<br><br>

<a name="dependencies">
<b>dependencies:</b>
<br><br>

<ul>
  <li> <a href="../../sp/FrontEnd/FrontEndBase/index.html">FrontEndBase</a>
  <li> <a href="../FtrBuffer/index.html">FtrBuffer</a>
  <li> <a href="../../dstr/DiGraph/index.html">DiGraph</a>
  <li> <a href="../Component/index.html">Component</a>
  <li> <a href="../../dstr/SingleLinkedList/index.html">SingleLinkedList</a>
</ul>

<a name="constants">
<b>public constants:</b>
<br><br>

<ul>
  <li> define the class name:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_00.cc&constant=CLASS_NAME">static const String CLASS_NAME = L"Recipe";</a></pre>
       
  <li> define i/o related constants:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_00.cc&constant=PARAM_RECIPE">static const String PARAM_RECIPE = L"recipe";</a></pre>

  <li> define default value(s) of class data:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_00.cc&constant=INPUT_PREFIX">static const String INPUT_PREFIX = L"__input_";</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_00.cc&constant=OUTPUT_PREFIX">static const String OUTPUT_PREFIX = L"__output_";</a>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_00.cc&constant=SAMPLED_DATA_NAME">static const String SAMPLED_DATA_NAME = L"__input_SAMPLED_DATA";</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_00.cc&constant=DUMMY_OUTPUT_NAME">static const String DUMMY_OUTPUT_NAME = L"__output_FEATURES";</a></pre>
</ul>

<a name="error">
<b>error codes:</b>
<br><br>

<ul>
  <li> general error codes:

       <pre><a href="/perl/ifc_document.pl?err=00080400">static const long ERR = 80400;</a></pre>

  <li> multiple component paths exist to output:

       <pre><a href="/perl/ifc_document.pl?err=00080401">static const long ERR_MPATH = 80401;</a></pre>

  <li> no component path exists to output:
       
       <pre><a href="/perl/ifc_document.pl?err=00080402">static const long ERR_NORPATH = 80402;</a></pre>
</ul>

<a name="protected">
<b>protected data:</b>
<br><br>

<ul>
  <li> recipe pool:
       
       <pre>DiGraph&lt;Component&gt; recipe_d;</pre>

  <li> static debug level:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_00.cc&static=debug_level_d">static Integral::DEBUG debug_level_d = Integral::NONE;</a></pre>

  <li> static memory manager:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_00.cc&static=mgr_d">static MemoryManager mgr_d;</a></pre>
</ul>

<a name="public">
<b>required public methods:</b>
<br><br>

<ul>
  <li> static methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=name">static const String& name();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_02.cc&method=diagnose">static boolean diagnose(Integral::DEBUG debug_level);</a></pre>

  <li> debug methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_01.cc&method=debug">boolean debug(const unichar* message) const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=setDebug">static boolean setDebug(Integral::DEBUG debug_level);</a></pre>

  <li> destructor/constructor(s):
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=destructor">~Recipe();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=default+constructor">Recipe();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=copy+constructor">Recipe(const Recipe& arg);</a></pre>

  <li> assign methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=assign">boolean assign(const Recipe& arg);</a></pre>
       
  <li> i/o methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_04.cc&method=sofSize">long sofSize() const;</a></pre>     
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_03.cc&method=read">boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);</a></pre>     
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_04.cc&method=write">boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;</a></pre>     
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_03.cc&method=readData">boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);</a></pre>     
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_04.cc&method=writeData">boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;</a></pre>     

  <li> equality methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=equality">boolean eq(const Recipe& arg) const;</a></pre>
       
  <li> memory management methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=new">static void* operator new(size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=new\[\]">static void* operator new[](size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=delete">static void operator delete(void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=delete\[\]">static void operator delete[](void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=setGrowSize">static boolean setGrowSize(long grow_size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=clear">boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);</a></pre>
</ul>

<a name="specific">
<b>class-specific public methods:</b>
<br><br>

<ul>
  <li> set and get methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=setAllocationMode">boolean setAllocationMode(DstrBase::ALLOCATION alloc);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=getAllocationMode">DstrBase::ALLOCATION getAllocationMode() const;</a></pre>

  <li> methods to manipulate graphs:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_05.cc&method=readGraph">boolean readGraph(Sof& sof, long graph_tag);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=isEmpty">boolean isEmpty() const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_05.cc&method=findComponent&instance=0">boolean findRecipe(SingleLinkedList&lt;Component&gt;& comp, const FrontEndBase& fend, const String& cname);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_05.cc&method=findComponent&instance=1">boolean findComponent(SingleLinkedList&lt;Component&gt;& comp, const FrontEndBase& fend, Vector&lt;String&gt;& inputs);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_05.cc&method=delayComponent">boolean delayComponent(Vector&lt;SingleLinkedList&lt;Component&gt; &gt;& dcomp, FtrBuffer& buf, const FrontEndBase& fend, SingleLinkedList&lt;Component&gt;& temp_list);</a></pre>
</ul>

<a name="private">
<b>private methods:</b>
<br><br>

<ul>       
  <li> topological sort methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=topologicalSort">boolean topologicalSort(SingleLinkedList&lt;Component&gt;& sorted_data, boolean partial = false);</a></pre>

  <li> color hash table creation methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/Recipe.h&method=makeColorHash">boolean makeColorHash(Integral::COLOR col = Integral::DEF_COLOR);</a></pre>

  <li> path related methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_05.cc&method=reverseVisitDfs">boolean reverseVisitDfs(const FrontEndBase& fend, const String& cname);</a></pre>

  <li> support methods for readRecipeGraph:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_05.cc&method=checkInputs">boolean checkInputs();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_05.cc&method=expandSubGraphs">boolean expandSubGraphs(Sof& sof);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/sp/Recipe/rcp_05.cc&method=readSubGraph">boolean readSubGraph(GraphVertex&lt;Component&gt;*& sub_in, GraphVertex&lt;Component&gt;*& sub_out, Sof& sof, long graph_tag);</a></pre>
</ul>
       
<a name="examples">
<b>examples:</b>
<br><br>

<ul>
  <li> This example demonstrates how to use the Recipe class:

<pre>
Recipe rcp;
Sof sof;
sof.open(L"diagnose_container.sof");
rcp.readGraph(sof);

SingleLinkedList<Component> algos(DstrBase::USER);
SingleLinkedList< Triple< Pair<Long,Long>, Float, Boolean> > topo;

algos.read(sof, 0);
topo.read(sof, 0);
DiGraph<Component> expected;
expected.assign(algos, topo);
if (!rcp.recipe_d.eq(expected)) {
  rcp.recipe_pool_d.debug(L"recipe");
}
sof.close();</pre>
</ul>

<a name="notes">
<b>notes:</b>
<br><br>

<ul>
  <li> This class is not intended to be used by application programmers.
       It is a core class in the front end software, and is used
       heavily by <i>isip_transform</i>.
</ul>

<!--#include virtual="/hse/ies/templates/documentation/footer/footer.html" -->
