equalizer.cpp

00001 
00002 /* Copyright (c) 2008-2009, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #include "equalizer.h"
00019 
00020 #include "../compound.h"
00021 #include "../config.h"
00022 #include "../log.h"
00023 
00024 #include <eq/client/client.h>
00025 #include <eq/client/server.h>
00026 #include <eq/base/debug.h>
00027 
00028 namespace eq
00029 {
00030 namespace server
00031 {
00032 
00033 Equalizer::Equalizer()
00034         : _compound( 0 )
00035         , _frozen( false )
00036 {
00037     EQINFO << "New Equalizer @" << (void*)this << std::endl;
00038 }
00039 
00040 Equalizer::Equalizer( const Equalizer& from )
00041         : CompoundListener( from )
00042         , _compound( 0 )
00043         , _frozen( from._frozen )
00044 {}
00045 
00046 Equalizer::~Equalizer()
00047 {
00048     attach( 0 );
00049 }
00050 
00051 void Equalizer::attach( Compound* compound )
00052 {
00053     if( _compound )
00054     {
00055         _compound->removeListener( this );
00056         _compound = 0;
00057     }
00058 
00059     if( compound )
00060     {
00061         _compound = compound;
00062         compound->addListener( this );
00063     }
00064 }
00065 
00066 const Config* Equalizer::getConfig() const
00067 {
00068     EQASSERT( _compound );
00069     return _compound->getConfig();
00070 }
00071 
00072 }
00073 }
Generated on Mon Aug 10 18:58:32 2009 for Equalizer 0.9 by  doxygen 1.5.8