![]() |
ircproxy The Ultimate Cyborg |
00001 // ircproxy -- An IRC bouncer. 00002 // 00003 //! @file Bool.cc 00004 //! @brief This file contains the implementation of class Bool. 00005 // 00006 // Copyright (C) 2006, 2007 by 00007 // 00008 // Carlo Wood, Run on IRC <carlo@alinoe.com> 00009 // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt 00010 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 00011 // 00012 // This file may be distributed under the terms of the Q Public License 00013 // version 1.0 as appearing in the file LICENSE.QPL included in the 00014 // packaging of this file. 00015 00016 #ifndef USE_PCH 00017 #include "sys.h" 00018 #endif 00019 00020 #include "Bool.h" 00021 #include "Expression.h" 00022 00023 void Bool::changed_to(bool b) 00024 { 00025 // The call to bool_changed might cause the expression to trigger. 00026 // Once handled, the expression is released and therefore the ExpressionEventServer 00027 // is removed from the set<>. Therefore we need to advance iter before 00028 // calling bool_changed(). 00029 M_value = b; 00030 std::set<boost::shared_ptr<ExpressionEventServer> >::iterator iter = M_event_servers.begin(); 00031 while (iter != M_event_servers.end()) 00032 (*iter++)->bool_changed(); 00033 } 00034 00035 Bool::~Bool() 00036 { 00037 M_being_destructed = true; 00038 for (std::set<boost::shared_ptr<ExpressionEventServer> >::iterator iter = M_event_servers.begin(); 00039 iter != M_event_servers.end(); ++iter) 00040 (*iter)->bool_destructed(); 00041 } 00042
Copyright © 2005-2007 Carlo Wood. All rights reserved. |
---|