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 <eq/client/client.h>
26 : #include <eq/client/server.h>
27 : #include <lunchbox/debug.h>
28 :
29 : namespace eq
30 : {
31 : namespace server
32 : {
33 :
34 136 : Equalizer::Equalizer()
35 : : _compound( 0 )
36 136 : , _active( true )
37 : {
38 136 : LBVERB << "New Equalizer @" << (void*)this << std::endl;
39 136 : }
40 :
41 48 : Equalizer::Equalizer( const fabric::Equalizer& from )
42 : : fabric::Equalizer( from )
43 : , _compound( 0 )
44 48 : , _active( true )
45 48 : {}
46 :
47 0 : Equalizer::Equalizer( const Equalizer& from )
48 : : fabric::Equalizer( from )
49 : , CompoundListener( from )
50 : , _compound( 0 )
51 0 : , _active( from._active )
52 0 : {}
53 :
54 : // cppcheck-suppress operatorEqVarError
55 0 : Equalizer& Equalizer::operator = ( const fabric::Equalizer& from )
56 : {
57 0 : fabric::Equalizer::operator = ( from );
58 0 : return *this;
59 : }
60 :
61 368 : Equalizer::~Equalizer()
62 : {
63 184 : attach( 0 );
64 184 : }
65 :
66 592 : void Equalizer::attach( Compound* compound )
67 : {
68 592 : if( _compound )
69 : {
70 184 : _compound->removeListener( this );
71 184 : _compound = 0;
72 : }
73 :
74 592 : if( compound )
75 : {
76 184 : _compound = compound;
77 184 : compound->addListener( this );
78 : }
79 592 : }
80 :
81 0 : const Config* Equalizer::getConfig() const
82 : {
83 0 : LBASSERT( _compound );
84 0 : return _compound->getConfig();
85 : }
86 :
87 : }
88 27 : }
|