LCOV - code coverage report
Current view: top level - eq/server/equalizers - equalizer.cpp (source / functions) Hit Total Coverage
Test: Equalizer Lines: 19 28 67.9 %
Date: 2017-12-16 05:07:20 Functions: 6 10 60.0 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2008-2014, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *                    2011, Daniel Nachbaur <danielnachbaur@gmail.com>
       4             :  *
       5             :  * This library is free software; you can redistribute it and/or modify it under
       6             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       7             :  * by the Free Software Foundation.
       8             :  *
       9             :  * This library is distributed in the hope that it will be useful, but WITHOUT
      10             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      11             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      12             :  * details.
      13             :  *
      14             :  * You should have received a copy of the GNU Lesser General Public License
      15             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      16             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      17             :  */
      18             : 
      19             : #include "equalizer.h"
      20             : 
      21             : #include "../compound.h"
      22             : #include "../config.h"
      23             : #include "../log.h"
      24             : 
      25             : #include <lunchbox/debug.h>
      26             : 
      27             : namespace eq
      28             : {
      29             : namespace server
      30             : {
      31         276 : Equalizer::Equalizer()
      32             :     : _compound(0)
      33         276 :     , _active(true)
      34             : {
      35         276 :     LBVERB << "New Equalizer @" << (void*)this << std::endl;
      36         276 : }
      37             : 
      38          18 : Equalizer::Equalizer(const fabric::Equalizer& from)
      39             :     : fabric::Equalizer(from)
      40             :     , _compound(0)
      41          18 :     , _active(true)
      42             : {
      43          18 : }
      44             : 
      45           0 : Equalizer::Equalizer(const Equalizer& from)
      46             :     : fabric::Equalizer(from)
      47             :     , CompoundListener(from)
      48             :     , _compound(0)
      49           0 :     , _active(from._active)
      50             : {
      51           0 : }
      52             : 
      53           0 : Equalizer& Equalizer::operator=(const fabric::Equalizer& from)
      54             : {
      55           0 :     fabric::Equalizer::operator=(from);
      56           0 :     return *this;
      57             : }
      58             : 
      59         588 : Equalizer::~Equalizer()
      60             : {
      61         294 :     attach(0);
      62         294 : }
      63             : 
      64         962 : void Equalizer::attach(Compound* compound)
      65             : {
      66         962 :     if (_compound)
      67             :     {
      68         294 :         _compound->removeListener(this);
      69         294 :         _compound = 0;
      70             :     }
      71             : 
      72         962 :     if (compound)
      73             :     {
      74         294 :         _compound = compound;
      75         294 :         compound->addListener(this);
      76             :     }
      77         962 : }
      78             : 
      79           0 : const Config* Equalizer::getConfig() const
      80             : {
      81           0 :     LBASSERT(_compound);
      82           0 :     return _compound->getConfig();
      83             : }
      84             : }
      85          60 : }

Generated by: LCOV version 1.11