Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > eebc325dc36bd6e3b09b9b45133e42f8 > files > 3822

HippoDraw-devel-docs-1.21.1-10.fc13.i686.rpm

<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>HippoDraw Class Library</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="hippoApp.ico">
</head><body>
<!-- Generated by Doxygen 1.6.2 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_bd46360b4c6a7cd846adf95fa79d46e4.html">python</a>
  </div>
</div>
<div class="contents">
<h1>export_NTupleController.cxx</h1><a href="export__NTupleController_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00012"></a>00012 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="comment">// nonstandard extension used &#39;extern&#39; before...</span>
<a name="l00014"></a>00014 <span class="preprocessor"># pragma warning(disable:4231)  </span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="comment">// needs to have dll-interface used by client</span>
<a name="l00017"></a>00017 <span class="preprocessor"># pragma warning(disable:4251)  </span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a>00019 <span class="comment">// non dll-interface struct</span>
<a name="l00020"></a>00020 <span class="preprocessor"># pragma warning(disable:4275)  </span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a>00022 <span class="comment">// &#39;int&#39; : forcing value to bool &#39;true&#39; or &#39;false&#39; (performance warning)</span>
<a name="l00023"></a>00023 <span class="preprocessor"># pragma warning(disable:4800)  </span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="comment">// include first to avoid _POSIX_C_SOURCE warning.</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;boost/python.hpp&gt;</span>
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 <span class="preprocessor">#include &quot;<a class="code" href="PyDataSource_8h.html" title="hippodraw::PyDataSource class interface">PyDataSource.h</a>&quot;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;<a class="code" href="PyNTupleController_8h.html" title="hippodraw::PyNTupleController class interface.">PyNTupleController.h</a>&quot;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="preprocessor">#include &quot;<a class="code" href="CircularBuffer_8h.html" title="CircularBuffer class interface.">datasrcs/CircularBuffer.h</a>&quot;</span>
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="keyword">using</span> std::vector;
<a name="l00035"></a>00035 <span class="keyword">using namespace </span>boost::python;
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 <span class="keyword">namespace </span>hippodraw {
<a name="l00038"></a>00038 <span class="keyword">namespace </span>Python {
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 <span class="keywordtype">void</span> 
<a name="l00041"></a>00041 <a class="code" href="namespacehippodraw_1_1Python.html#a5d842477ca8e4156769692e4adfb574e" title="Exports the NTupleController class to Python.">export_NTupleController</a>()
<a name="l00042"></a>00042 {
<a name="l00043"></a>00043   class_ &lt; PyNTupleController, bases&lt;&gt;,
<a name="l00044"></a>00044     PyNTupleController, boost::noncopyable &gt;
<a name="l00045"></a>00045     ( <span class="stringliteral">&quot;NTupleController&quot;</span>,
<a name="l00046"></a>00046       <span class="stringliteral">&quot;A singleton object to manage NTuple objects.&quot;</span>,
<a name="l00047"></a>00047       no_init )
<a name="l00048"></a>00048 
<a name="l00049"></a>00049     .def ( <span class="stringliteral">&quot;instance&quot;</span>,  &amp;<a class="code" href="classhippodraw_1_1PyNTupleController.html#aa4c2092d0abd15b0a47dba934c61c0ec" title="The singleton instance method.">PyNTupleController::instance</a>,
<a name="l00050"></a>00050            return_value_policy &lt; reference_existing_object &gt;  (),
<a name="l00051"></a>00051            <span class="stringliteral">&quot;instance () -&gt; NTupleController\n&quot;</span>
<a name="l00052"></a>00052            <span class="stringliteral">&quot;\n&quot;</span>
<a name="l00053"></a>00053            <span class="stringliteral">&quot;Returns the single instance of the controller&quot;</span> )
<a name="l00054"></a>00054 
<a name="l00055"></a>00055     .staticmethod( <span class="stringliteral">&quot;instance&quot;</span> )
<a name="l00056"></a>00056 
<a name="l00057"></a>00057     .def ( <span class="stringliteral">&quot;createDataArray&quot;</span>,
<a name="l00058"></a>00058            &amp;<a class="code" href="classhippodraw_1_1PyNTupleController.html#a54ad3ba0cc17e8722e998708f47fd4e9" title="Creates a DataArray Python object from the file filename.">PyNTupleController::createDataArray</a>,
<a name="l00059"></a>00059            return_value_policy &lt; manage_new_object &gt; (),
<a name="l00060"></a>00060            <span class="stringliteral">&quot;createDataArray ( filename ) -&gt; DataArray\n&quot;</span>
<a name="l00061"></a>00061            <span class="stringliteral">&quot;\n&quot;</span>
<a name="l00062"></a>00062            <span class="stringliteral">&quot;Creates a DataArray from file.&quot;</span> )
<a name="l00063"></a>00063 
<a name="l00064"></a>00064     .def ( <span class="stringliteral">&quot;createNTuple&quot;</span>,
<a name="l00065"></a>00065            ( NTuple * ( PyNTupleController::* ) <span class="comment">// function point cast</span>
<a name="l00066"></a>00066              ( ) ) <span class="comment">// function signature</span>
<a name="l00067"></a>00067            &amp;<a class="code" href="classhippodraw_1_1PyNTupleController.html#acb491d08abb6c7ddc23c3fee5f09094f" title="Creates an empty NTuple object.">PyNTupleController::createNTuple</a>,
<a name="l00068"></a>00068            return_value_policy &lt; manage_new_object &gt;  (),
<a name="l00069"></a>00069            <span class="stringliteral">&quot;Creates an empty NTuple&quot;</span> )
<a name="l00070"></a>00070 
<a name="l00071"></a>00071     .def ( <span class="stringliteral">&quot;createNTuple&quot;</span>,
<a name="l00072"></a>00072            ( DataSource * ( PyNTupleController::* ) <span class="comment">// function point cast</span>
<a name="l00073"></a>00073              ( <span class="keyword">const</span> std::string &amp; ) ) <span class="comment">// function signature</span>
<a name="l00074"></a>00074            &amp;<a class="code" href="classhippodraw_1_1PyNTupleController.html#acb491d08abb6c7ddc23c3fee5f09094f" title="Creates an empty NTuple object.">PyNTupleController::createNTuple</a>,
<a name="l00075"></a>00075            return_value_policy &lt; manage_new_object &gt;  (),
<a name="l00076"></a>00076            <span class="stringliteral">&quot;createNTuple () -&gt; NTuple\n&quot;</span>
<a name="l00077"></a>00077            <span class="stringliteral">&quot;createNTuple ( string ) -&gt; NTuple\n&quot;</span>
<a name="l00078"></a>00078            <span class="stringliteral">&quot;\n&quot;</span>
<a name="l00079"></a>00079            <span class="stringliteral">&quot;Creates and registers an NTuple.   The first method creates an\n&quot;</span>
<a name="l00080"></a>00080            <span class="stringliteral">&quot;empty NTuple object.   The second method creates one from a\n&quot;</span>
<a name="l00081"></a>00081            <span class="stringliteral">&quot;file.  Both methods return ownership of the created object to\n&quot;</span>
<a name="l00082"></a>00082            <span class="stringliteral">&quot;Python.&quot;</span> )
<a name="l00083"></a>00083 
<a name="l00084"></a>00084     .def ( <span class="stringliteral">&quot;createCircularBuffer&quot;</span>,
<a name="l00085"></a>00085            ( CircularBuffer * ( PyNTupleController::* ) <span class="comment">// function point cast</span>
<a name="l00086"></a>00086              ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) ) <span class="comment">// function signature</span>
<a name="l00087"></a>00087            &amp; <a class="code" href="classhippodraw_1_1PyNTupleController.html#abe5e046b69f62a258ecfc15e45031cdd" title="Creates an empty CircularBuffer object with n columns.">PyNTupleController::createCircularBuffer</a>,
<a name="l00088"></a>00088            return_value_policy &lt; manage_new_object &gt;  (),
<a name="l00089"></a>00089            <span class="stringliteral">&quot;createCircularBuffer ( value ) -&gt; CircularBuffer\n&quot;</span>
<a name="l00090"></a>00090            <span class="stringliteral">&quot;\n&quot;</span>
<a name="l00091"></a>00091            <span class="stringliteral">&quot;Creates and registers a CircularBuffer object with set number of\n&quot;</span>
<a name="l00092"></a>00092            <span class="stringliteral">&quot;columns.&quot;</span> )
<a name="l00093"></a>00093 
<a name="l00094"></a>00094     .def ( <span class="stringliteral">&quot;registerNTuple&quot;</span>,
<a name="l00095"></a>00095            ( std::string ( PyNTupleController:: * ) <span class="comment">// function pointer cast</span>
<a name="l00096"></a>00096              ( DataSource * ) ) <span class="comment">// function signature</span>
<a name="l00097"></a>00097            &amp; <a class="code" href="classhippodraw_1_1PyNTupleController.html#ad3b01e81b51eacf4fc67bb140f1644e4" title="Registers the DataSource object and returns its assigned name.">PyNTupleController::registerNTuple</a>,
<a name="l00098"></a>00098            <span class="stringliteral">&quot;Register an NTuple to make it visible to the application&quot;</span> )
<a name="l00099"></a>00099 
<a name="l00100"></a>00100     .def ( <span class="stringliteral">&quot;registerNTuple&quot;</span>,
<a name="l00101"></a>00101            ( <span class="keywordtype">void</span> ( PyNTupleController:: * ) <span class="comment">// function pointer cast</span>
<a name="l00102"></a>00102              ( <span class="keyword">const</span> std::string &amp;, DataSource * ) ) <span class="comment">// function signature</span>
<a name="l00103"></a>00103            &amp; PyNTupleController::registerNTuple,
<a name="l00104"></a>00104            <span class="stringliteral">&quot;registerNTuple ( DataSource ) -&gt; None\n&quot;</span>
<a name="l00105"></a>00105            <span class="stringliteral">&quot;registerNTuple ( string, DataSource ) -&gt; None\n&quot;</span>
<a name="l00106"></a>00106            <span class="stringliteral">&quot;\n&quot;</span>
<a name="l00107"></a>00107            <span class="stringliteral">&quot;Register an NTuple to make it visible to the application.   The\n&quot;</span>
<a name="l00108"></a>00108            <span class="stringliteral">&quot;first form takes the name from the DataSource object, if it has\n&quot;</span>
<a name="l00109"></a>00109            <span class="stringliteral">&quot;one, otherwise generates a unique name.   The second form takes\n&quot;</span>
<a name="l00110"></a>00110            <span class="stringliteral">&quot;string argument for the name.&quot;</span> )
<a name="l00111"></a>00111 
<a name="l00112"></a>00112     .def ( <span class="stringliteral">&quot;writeToFile&quot;</span>,
<a name="l00113"></a>00113            ( <span class="keywordtype">int</span> ( PyNTupleController:: * ) <span class="comment">// function pointer cast</span>
<a name="l00114"></a>00114              ( DataSource *, <span class="keyword">const</span> std::string &amp; ) ) <span class="comment">// function signature</span>
<a name="l00115"></a>00115            &amp; <a class="code" href="classhippodraw_1_1PyNTupleController.html#a66b12b1d426bb84b3511ebbec62ad6aa" title="Writes the DataSource to the file filename.">PyNTupleController::writeNTupleToFile</a>,
<a name="l00116"></a>00116            <span class="stringliteral">&quot;writeToFile ( DataSource, string ) -&gt; value\n&quot;</span>
<a name="l00117"></a>00117            <span class="stringliteral">&quot;\n&quot;</span>
<a name="l00118"></a>00118            <span class="stringliteral">&quot;Writes the NTuple to a file as ASCII text.   Returns 0 if\n&quot;</span>
<a name="l00119"></a>00119            <span class="stringliteral">&quot;successful.&quot;</span> )
<a name="l00120"></a>00120 
<a name="l00121"></a>00121     .def ( <span class="stringliteral">&quot;findNTuple&quot;</span>,
<a name="l00122"></a>00122            ( DataSource * ( PyNTupleController:: * ) <span class="comment">// function pointer cast</span>
<a name="l00123"></a>00123              ( <span class="keyword">const</span> std::string &amp; ) <span class="keyword">const</span> ) <span class="comment">// function signature</span>
<a name="l00124"></a>00124            &amp; <a class="code" href="classhippodraw_1_1PyNTupleController.html#a12d64d4bd97d8216595ba5a405e4399b" title="Finds the DataSource by name.">PyNTupleController::findDataSource</a>,
<a name="l00125"></a>00125            return_value_policy &lt; reference_existing_object &gt; (),
<a name="l00126"></a>00126            <span class="stringliteral">&quot;findNTuple ( string ) -&gt; DataSource\n&quot;</span>
<a name="l00127"></a>00127            <span class="stringliteral">&quot;\n&quot;</span>
<a name="l00128"></a>00128            <span class="stringliteral">&quot;Find an registered NTuple by its name and returns a reference to\n&quot;</span>
<a name="l00129"></a>00129            <span class="stringliteral">&quot;it.  If the DataSource can not be found, an exception is thrown.\n&quot;</span>
<a name="l00130"></a>00130            <span class="stringliteral">&quot;\n&quot;</span>
<a name="l00131"></a>00131            <span class="stringliteral">&quot;Warning: if more than one DataSource has the same name,\n&quot;</span>
<a name="l00132"></a>00132            <span class="stringliteral">&quot;the first one found is returned.&quot;</span> )
<a name="l00133"></a>00133 
<a name="l00134"></a>00134      .def ( <span class="stringliteral">&quot;changeName&quot;</span>,
<a name="l00135"></a>00135             ( <span class="keywordtype">void</span> ( PyNTupleController:: * ) <span class="comment">// function pointer cast</span>
<a name="l00136"></a>00136               ( DataSource *, <span class="keyword">const</span> std::string &amp; ) ) <span class="comment">// function signature</span>
<a name="l00137"></a>00137             &amp; <a class="code" href="classhippodraw_1_1PyNTupleController.html#a1a82f788ee5bf0a627e95d320f4f31c7" title="Changes the name of the DataSource.">PyNTupleController::changeName</a>,
<a name="l00138"></a>00138             <span class="stringliteral">&quot;changeName ( DataSource, string ) -&gt; None\n&quot;</span>
<a name="l00139"></a>00139             <span class="stringliteral">&quot;\n&quot;</span>
<a name="l00140"></a>00140             <span class="stringliteral">&quot;Change the name of an NTuple.\n&quot;</span>
<a name="l00141"></a>00141             <span class="stringliteral">&quot;This method is deprecated, there&#39;s not need to do this&quot;</span> )
<a name="l00142"></a>00142 
<a name="l00143"></a>00143     ;
<a name="l00144"></a>00144 
<a name="l00145"></a>00145 }
<a name="l00146"></a>00146 
<a name="l00147"></a>00147 } <span class="comment">// namespace Python</span>
<a name="l00148"></a>00148 } <span class="comment">// namespace hippodraw</span>
</pre></div></div>
<hr size="1"><address style="align: right;"><small>
Generated for HippoDraw Class Library by <a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0>
</a> </small></address>
</body>
</html>