[Yake-svn] SF.net SVN: yake: [1735] branches/v0-6-0/yake
Status: Beta
Brought to you by:
psyclonist
From: <psy...@us...> - 2007-04-24 17:19:00
|
Revision: 1735 http://svn.sourceforge.net/yake/?rev=1735&view=rev Author: psyclonist Date: 2007-04-24 10:19:00 -0700 (Tue, 24 Apr 2007) Log Message: ----------- added SignalConnectionGroup Modified Paths: -------------- branches/v0-6-0/yake/src/base/yake.cpp branches/v0-6-0/yake/yake/base/templates/yakeSignals.h branches/v0-6-0/yake/yake/base/yake.h Added Paths: ----------- branches/v0-6-0/yake/src/base/templates/yakeSignals.cpp Added: branches/v0-6-0/yake/src/base/templates/yakeSignals.cpp =================================================================== --- branches/v0-6-0/yake/src/base/templates/yakeSignals.cpp (rev 0) +++ branches/v0-6-0/yake/src/base/templates/yakeSignals.cpp 2007-04-24 17:19:00 UTC (rev 1735) @@ -0,0 +1,53 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright (c) 2004 - 2008 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#include <yake/base/yakePCH.h> +#include <yake/base/templates/yakeSignals.h> + +namespace yake { + + //----------------------------------------------------- + SignalConnectionGroup::SignalConnectionGroup() + { + } + SignalConnectionGroup::~SignalConnectionGroup() + { + this->clearAndDisconnectAll(); + } + void SignalConnectionGroup::clearAndDisconnectAll() + { + for (SignalConnectionList::const_iterator it = connections_.begin(); + it != connections_.end(); ++it) + (*it).disconnect(); + connections_.clear(); + } + SignalConnectionGroup& SignalConnectionGroup::operator += (const SignalConnection& connection) + { + connections_.push_back( connection ); + return *this; + } + +} // yake Modified: branches/v0-6-0/yake/src/base/yake.cpp =================================================================== --- branches/v0-6-0/yake/src/base/yake.cpp 2007-04-24 16:02:00 UTC (rev 1734) +++ branches/v0-6-0/yake/src/base/yake.cpp 2007-04-24 17:19:00 UTC (rev 1735) @@ -26,3 +26,4 @@ */ #include <yake/base/yakePCH.h> #include <yake/base/yake.h> +#include <yake/base/templates/yakeSignals.h> \ No newline at end of file Modified: branches/v0-6-0/yake/yake/base/templates/yakeSignals.h =================================================================== --- branches/v0-6-0/yake/yake/base/templates/yakeSignals.h 2007-04-24 16:02:00 UTC (rev 1734) +++ branches/v0-6-0/yake/yake/base/templates/yakeSignals.h 2007-04-24 17:19:00 UTC (rev 1735) @@ -122,6 +122,25 @@ namespace yake { + /** A SignalConnectionGroup acts as a container of SignalConnections + and is usually used to control the life time if subscriptions to signals. + */ + struct YAKE_BASE_API SignalConnectionGroup : public boost::noncopyable + { + /** Constructs a SignalConnectionGroup. */ + SignalConnectionGroup(); + /** Disconnects all connections contained in this SignalConnectionGroup. */ + ~SignalConnectionGroup(); + /** Add a new connection to this SignalConnectionGroup. */ + SignalConnectionGroup& operator += (const SignalConnection& connection); + /** Disconnects all connections contained in this SignalConnectionGroup + and clears all references to these connections. + */ + void clearAndDisconnectAll(); + private: + typedef std::deque<SignalConnection> SignalConnectionList; + SignalConnectionList connections_; + }; } // yake Modified: branches/v0-6-0/yake/yake/base/yake.h =================================================================== --- branches/v0-6-0/yake/yake/base/yake.h 2007-04-24 16:02:00 UTC (rev 1734) +++ branches/v0-6-0/yake/yake/base/yake.h 2007-04-24 17:19:00 UTC (rev 1735) @@ -60,6 +60,7 @@ //#include "yakeDebugOutputStream.h" #include "yakeLibrary.h" #include <yake/base/type_info.h> +#include "yakeConfigFile.h" #include "math/yakeQuaternion.h" #include "math/yakeVector3.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |