From d2cef655293e67ae558017a38dae09a9078f683d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 16 Aug 2012 11:58:42 +0000 Subject: Remove old Maid.cpp. git-svn-id: http://svn.drobilla.net/lad/trunk/raul@4714 a436a847-0d15-0410-975c-d299462d15a1 --- src/Maid.cpp | 69 ------------------------------------------------------------ 1 file changed, 69 deletions(-) delete mode 100644 src/Maid.cpp (limited to 'src') diff --git a/src/Maid.cpp b/src/Maid.cpp deleted file mode 100644 index ded48ff..0000000 --- a/src/Maid.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - This file is part of Raul. - Copyright 2007-2012 David Robillard - - Raul is free software: you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation, either version 3 of the License, or any later version. - - Raul 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Raul. If not, see . -*/ - -#include "raul/Maid.hpp" -#include "raul/Deletable.hpp" -#include "raul/SharedPtr.hpp" - -namespace Raul { - -Maid::Maid(size_t size) - : _objects(size) -{ -} - -Maid::~Maid() -{ - cleanup(); -} - -/** Manage a SharedPtr. NOT realtime safe. - * - * @a ptr is guaranteed to be deleted in the context that calls cleanup() - */ -void -Maid::manage(SharedPtr ptr) -{ - if (ptr) - _managed.push_back(new Raul::List >::Node(ptr)); -} - -/** Free all the objects in the queue (passed by push()). - */ -void -Maid::cleanup() -{ - Raul::Deletable* obj = NULL; - - while (!_objects.empty()) { - obj = _objects.front(); - _objects.pop(); - delete obj; - } - - for (Managed::iterator i = _managed.begin(); i != _managed.end() ; ) { - Managed::iterator next = i; - ++next; - - if ((*i).unique()) - _managed.erase(i); - - i = next; - } - -} - -} // namespace Raul -- cgit v1.2.1