Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

var_bool.cpp

00001 /*****************************************************************************
00002  * var_bool.cpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: var_bool.cpp 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Cyril Deguet     <[email protected]>
00008  *          Olivier Teulière <[email protected]>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00023  *****************************************************************************/
00024 
00025 #include "var_bool.hpp"
00026 
00027 
00028 const string VarBool::m_type = "bool";
00029 
00030 
00031 VarBoolImpl::VarBoolImpl( intf_thread_t *pIntf ):
00032     VarBool( pIntf ), m_value( false )
00033 {
00034 }
00035 
00036 
00037 void VarBoolImpl::set( bool value )
00038 {
00039     if( value != m_value )
00040     {
00041         m_value = value;
00042         notify();
00043     }
00044 }
00045 
00046 
00047 VarBoolAndBool::VarBoolAndBool( intf_thread_t *pIntf, VarBool &rVar1,
00048                                 VarBool &rVar2 ):
00049     VarBool( pIntf ), m_rVar1( rVar1 ), m_rVar2( rVar2 )
00050 {
00051     m_rVar1.addObserver( this );
00052     m_rVar2.addObserver( this );
00053 }
00054 
00055 
00056 VarBoolAndBool::~VarBoolAndBool()
00057 {
00058     m_rVar1.delObserver( this );
00059     m_rVar2.delObserver( this );
00060 }
00061 
00062 
00063 void VarBoolAndBool::onUpdate( Subject<VarBool> &rVariable )
00064 {
00065     notify();
00066 }
00067 
00068 
00069 VarBoolOrBool::VarBoolOrBool( intf_thread_t *pIntf, VarBool &rVar1,
00070                               VarBool &rVar2 ):
00071     VarBool( pIntf ), m_rVar1( rVar1 ), m_rVar2( rVar2 )
00072 {
00073     m_rVar1.addObserver( this );
00074     m_rVar2.addObserver( this );
00075 }
00076 
00077 
00078 VarBoolOrBool::~VarBoolOrBool()
00079 {
00080     m_rVar1.delObserver( this );
00081     m_rVar2.delObserver( this );
00082 }
00083 
00084 
00085 void VarBoolOrBool::onUpdate( Subject<VarBool> &rVariable )
00086 {
00087     notify();
00088 }
00089 
00090 
00091 VarNotBool::VarNotBool( intf_thread_t *pIntf, VarBool &rVar ):
00092     VarBool( pIntf ), m_rVar( rVar )
00093 {
00094     m_rVar.addObserver( this );
00095 }
00096 
00097 
00098 VarNotBool::~VarNotBool()
00099 {
00100     m_rVar.delObserver( this );
00101 }
00102 
00103 
00104 void VarNotBool::onUpdate( Subject<VarBool> &rVariable )
00105 {
00106     notify();
00107 }
00108 
00109 

Generated on Tue Dec 20 10:14:43 2005 for vlc-0.8.4a by  doxygen 1.4.2