LCOV - code coverage report
Current view: top level - eq/client - init.h (source / functions) Hit Total Coverage
Test: lcov2.info Lines: 3 7 42.9 %
Date: 2014-06-18 Functions: 1 1 100.0 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2005-2011, Stefan Eilemann <eile@equalizergraphics.com> 
       3             :  *
       4             :  * This library is free software; you can redistribute it and/or modify it under
       5             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       6             :  * by the Free Software Foundation.
       7             :  *  
       8             :  * This library is distributed in the hope that it will be useful, but WITHOUT
       9             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      10             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      11             :  * details.
      12             :  * 
      13             :  * You should have received a copy of the GNU Lesser General Public License
      14             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      15             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      16             :  */
      17             : 
      18             : #ifndef EQ_INIT_H
      19             : #define EQ_INIT_H
      20             : 
      21             : #include <eq/client/api.h>
      22             : #include <eq/client/types.h>
      23             : #include <eq/client/version.h>    // used inline
      24             : #include <lunchbox/log.h>   // used inline
      25             : 
      26             : namespace eq
      27             : {
      28             :     /** @internal */
      29             :     EQ_API bool _init( const int argc, char** argv, NodeFactory* nodeFactory );
      30             :     
      31             :     /**
      32             :      * Initialize the Equalizer client library.
      33             :      *
      34             :      * The following command line options are recognized by this function:
      35             :      * <ul>
      36             :      *   <li>--eq-logfile &lt;filename&gt; redirect all log output to the given
      37             :      *         file.</li>
      38             :      *   <li>--eq-server &lt;hostname&gt; to specify an explicit server
      39             :      *         address (cf. Global::setServer())</li>
      40             :      *   <li>--eq-config &lt;filename&gt; to specify the configuration file if
      41             :      *         an application-specific server is used (cf.
      42             :      *         Global::setConfigFile())</li>
      43             :      *   <li>--eq-render-client &lt;filename&gt; to specify an alternate name
      44             :      *         for the render client executable (default is argv[0]). Also sets
      45             :      *         the working directory to the director part of the filename.</li>
      46             :      * </ul>
      47             :      *
      48             :      * Please note that further command line parameters are recognized by
      49             :      * co::LocalNode::initLocal().
      50             :      *
      51             :      * @param argc the command line argument count.
      52             :      * @param argv the command line argument values.
      53             :      * @param nodeFactory the factory for allocating Equalizer objects.
      54             :      * @return true if the library was successfully initialized, 
      55             :      *         false otherwise.
      56             :      */
      57           9 :     inline bool init( const int argc, char** argv, NodeFactory* nodeFactory )
      58             :     {
      59           9 :         if( EQ_VERSION_ABI == Version::getABI( ))
      60           9 :             return eq::_init( argc, argv, nodeFactory );
      61           0 :         LBWARN << "Equalizer shared library v" << Version::getABI()
      62           0 :                << " not binary compatible with application v" << EQ_VERSION_ABI
      63           0 :                << std::endl;
      64           0 :         return false;
      65             :     }
      66             : 
      67             :     /**
      68             :      * De-initialize the Equalizer client library.
      69             :      *
      70             :      * @return <code>true</code> if the library was successfully de-initialized,
      71             :      *         <code>false</code> otherwise.
      72             :      */
      73             :     EQ_API bool exit();
      74             : 
      75             :     /**
      76             :      * Convenience function to retrieve a configuration.
      77             :      *
      78             :      * This function initializes a local client node, connects it to the server,
      79             :      * and retrieves a configuration. On any failure everything is correctly
      80             :      * deinitialized and 0 is returned.
      81             :      *
      82             :      * @return the pointer to a configuration, or 0 upon error.
      83             :      */
      84             :     EQ_API Config* getConfig( const int argc, char** argv );
      85             : 
      86             :    /** 
      87             :     * Convenience function to release a configuration.
      88             :     *
      89             :     * This function releases the configuration, disconnects the server,
      90             :     * and stops the local client node.
      91             :     */
      92             :     EQ_API void releaseConfig( Config* config );
      93             : }
      94             : 
      95             : #endif // EQ_INIT_H
      96             : 

Generated by: LCOV version 1.10