LCOV - code coverage report
Current view: top level - eq - global.h (source / functions) Hit Total Coverage
Test: Equalizer Lines: 1 1 100.0 %
Date: 2016-09-29 05:02:09 Functions: 1 1 100.0 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2005-2016, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *                          Cedric Stalder <cedric.stalder@gmail.com>
       4             :  *                          Daniel Nachbaur <danielnachbaur@gmail.com>
       5             :  *
       6             :  * This library is free software; you can redistribute it and/or modify it under
       7             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       8             :  * by the Free Software Foundation.
       9             :  *
      10             :  * This library is distributed in the hope that it will be useful, but WITHOUT
      11             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      12             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      13             :  * details.
      14             :  *
      15             :  * You should have received a copy of the GNU Lesser General Public License
      16             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      17             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      18             :  */
      19             : 
      20             : #ifndef EQ_GLOBAL_H
      21             : #define EQ_GLOBAL_H
      22             : 
      23             : #include <eq/api.h>
      24             : #include <eq/init.h>       // friend
      25             : #include <eq/types.h>
      26             : 
      27             : #include <eq/fabric/global.h>     // base class
      28             : #include <eq/fabric/iAttribute.h> // enum definition
      29             : 
      30             : namespace eq
      31             : {
      32             : /** Global parameter handling for the Equalizer client library. */
      33             : class Global : public fabric::Global
      34             : {
      35             : public:
      36             :     /** Set the name of the program. @version 1.5.2 */
      37             :     EQ_API static void setProgramName( const std::string& programName );
      38             : 
      39             :     /** @return the program name. @version 1.5.2 */
      40             :     EQ_API static const std::string& getProgramName();
      41             : 
      42             :     /** Set the working directory of the program. @version 1.5.2 */
      43             :     EQ_API static void setWorkDir( const std::string& workDir );
      44             : 
      45             :     /** @return the working directory of the program. @version 1.5.2 */
      46             :     EQ_API static const std::string& getWorkDir();
      47             : 
      48             :     /** @return the node factory. @version 1.0 */
      49          21 :     static NodeFactory* getNodeFactory() { return _nodeFactory; }
      50             : 
      51             :     /**
      52             :      * Set the config file or hwsd session for the app-local server.
      53             :      *
      54             :      * When started without specifying an explicit server connection, Equalizer
      55             :      * will create an server instance in an application thread using this
      56             :      * configuration. Strings ending with '.eqc' are considered Equalizer
      57             :      * configuration files, otherwise the given string is used as an HWSD
      58             :      * session name for auto-configuration.
      59             :      *
      60             :      * @param config the default configuration.
      61             :      * @version 1.0
      62             :      */
      63             :     EQ_API static void setConfig( const std::string& config );
      64             : 
      65             :     /** @return the configuration for the app-local server. @version 1.0 */
      66             :     EQ_API static const std::string& getConfig();
      67             : 
      68             :     /**
      69             :      * Global lock for all non-thread-safe Carbon API calls.
      70             :      *
      71             :      * Note: this is a NOP on non-AGL builds. Do not use unless you know the
      72             :      * side effects, i.e., ask on the eq-dev mailing list.
      73             :      *
      74             :      * @version 1.0
      75             :      */
      76             :     static void enterCarbon();
      77             : 
      78             :     /** Global unlock for non-thread-safe Carbon API calls. @version 1.0 */
      79             :     static void leaveCarbon();
      80             : 
      81             : private:
      82             :     EQ_API friend bool _init( const int argc, char** argv, NodeFactory* );
      83             :     EQ_API friend bool exit();
      84             : 
      85             :     static NodeFactory* _nodeFactory;
      86             :     static std::string  _config;
      87             : };
      88             : }
      89             : 
      90             : #endif // EQ_GLOBAL_H

Generated by: LCOV version 1.11