LCOV - code coverage report
Current view: top level - eq - global.cpp (source / functions) Hit Total Coverage
Test: Equalizer Lines: 23 23 100.0 %
Date: 2016-09-29 05:02:09 Functions: 10 10 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             : #include "global.h"
      21             : 
      22             : #include "nodeFactory.h"
      23             : #ifdef EQUALIZER_USE_HWSD
      24             : #  include <hwsd/nodeInfo.h>
      25             : #endif
      26             : #include <lunchbox/lock.h>
      27             : 
      28             : namespace eq
      29             : {
      30          14 : std::string _programName;
      31          14 : std::string _workDir;
      32             : NodeFactory* Global::_nodeFactory = 0;
      33             : 
      34             : #ifdef EQUALIZER_USE_HWSD
      35          14 : std::string Global::_config = hwsd::NodeInfo::getLocalSession();
      36             : #else
      37             : std::string Global::_config = "configs/config.eqc";
      38             : #endif
      39             : 
      40             : #ifdef AGL
      41             : static lunchbox::Lock _carbonLock;
      42             : #endif
      43             : 
      44           3 : void Global::setProgramName( const std::string& programName )
      45             : {
      46           3 :     _programName = programName;
      47           3 : }
      48             : 
      49           7 : const std::string& Global::getProgramName()
      50             : {
      51           7 :     return _programName;
      52             : }
      53             : 
      54           5 : void Global::setWorkDir( const std::string& workDir )
      55             : {
      56           5 :     _workDir = workDir;
      57           5 : }
      58             : 
      59           7 : const std::string& Global::getWorkDir()
      60             : {
      61           7 :     return _workDir;
      62             : }
      63             : 
      64           2 : void Global::setConfig( const std::string& config )
      65             : {
      66           2 :     _config = config;
      67           2 : }
      68             : 
      69          14 : const std::string& Global::getConfig()
      70             : {
      71          14 :     return _config;
      72             : }
      73             : 
      74           1 : void Global::enterCarbon()
      75             : {
      76             : #ifdef AGL
      77             :     _carbonLock.set();
      78             : #endif
      79           1 : }
      80             : 
      81           1 : void Global::leaveCarbon()
      82             : {
      83             : #ifdef AGL
      84             :     _carbonLock.unset();
      85             : #endif
      86           1 : }
      87             : 
      88          42 : }

Generated by: LCOV version 1.11