diff options
author | 2006-07-09 15:40:26 +0000 | |
---|---|---|
committer | 2006-07-09 15:40:26 +0000 | |
commit | 854f343c0da76c1a5259bee1868607da55ddcb30 (patch) | |
tree | 9915945e0136bf98b276567d07772f3151310f2f | |
parent | f80cf5da45e4243fc8eeb45cf2ddbbba76acfa10 (diff) | |
download | paludis-854f343c0da76c1a5259bee1868607da55ddcb30.tar.gz paludis-854f343c0da76c1a5259bee1868607da55ddcb30.tar.xz |
Remove ContainerEntry class, it is no longer required.
-rw-r--r-- | doc/doc_main.doxygen | 5 | ||||
-rw-r--r-- | paludis/util/container_entry.hh | 77 | ||||
-rw-r--r-- | paludis/util/container_entry_TEST.cc | 65 | ||||
-rw-r--r-- | paludis/util/files.m4 | 1 |
4 files changed, 0 insertions, 148 deletions
diff --git a/doc/doc_main.doxygen b/doc/doc_main.doxygen index fdb947b..a10bfcc 100644 --- a/doc/doc_main.doxygen +++ b/doc/doc_main.doxygen @@ -216,11 +216,6 @@ * \ingroup grplibpaludisutil */ -/** \defgroup grpcontainerentries Container entries - * - * \ingroup grplibpaludisutil - */ - /** \defgroup grppointers Pointers * * \ingroup grplibpaludisutil diff --git a/paludis/util/container_entry.hh b/paludis/util/container_entry.hh deleted file mode 100644 index 737033a..0000000 --- a/paludis/util/container_entry.hh +++ /dev/null @@ -1,77 +0,0 @@ -/* vim: set sw=4 sts=4 et foldmethod=syntax : */ - -/* - * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk> - * - * This file is part of the Paludis package manager. Paludis is free software; - * you can redistribute it and/or modify it under the terms of the GNU General - * Public License version 2, as published by the Free Software Foundation. - * - * Paludis 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 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef PALUDIS_GUARD_PALUDIS_CONTAINER_ENTRY_HH -#define PALUDIS_GUARD_PALUDIS_CONTAINER_ENTRY_HH 1 - -#include <list> - -/** \file - * Declarations for the ContainerEntry class. - * - * \ingroup grpcontainerentries - */ - -namespace paludis -{ - /** - * Hold an entry in a container for as long as our ContainerEntry instance - * is in scope (RAII, see \ref EffCpp item 13 or \ref TCppPL section 14.4). - * - * \ingroup grpcontainerentries - */ - template <typename Container_> - struct ContainerEntry; - - /** - * Hold an entry in a container for as long as our ContainerEntry instance - * is in scope (RAII, see \ref EffCpp item 13 or \ref TCppPL section 14.4; - * partial specialisation for std::list). - * - * \ingroup grpcontainerentries - */ - template <typename Item_> - class ContainerEntry<std::list<Item_> > - { - private: - std::list<Item_> * const _list; - - typename std::list<Item_>::iterator _item; - - public: - /** - * Constructor. - */ - ContainerEntry(std::list<Item_> * const list, const Item_ & item) : - _list(list), - _item(list->insert(list->begin(), item)) - { - } - - /** - * Destructor. - */ - ~ContainerEntry() - { - _list->erase(_item); - } - }; -} - -#endif diff --git a/paludis/util/container_entry_TEST.cc b/paludis/util/container_entry_TEST.cc deleted file mode 100644 index 2daf9d7..0000000 --- a/paludis/util/container_entry_TEST.cc +++ /dev/null @@ -1,65 +0,0 @@ -/* vim: set sw=4 sts=4 et foldmethod=syntax : */ - -/* - * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk> - * - * This file is part of the Paludis package manager. Paludis is free software; - * you can redistribute it and/or modify it under the terms of the GNU General - * Public License version 2, as published by the Free Software Foundation. - * - * Paludis 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 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <algorithm> -#include <paludis/util/container_entry.hh> -#include <test/test_framework.hh> -#include <test/test_runner.hh> - -using namespace test; -using namespace paludis; - -namespace test_cases -{ - /** - * \test Test ContainerEntry on a list. - * - * \ingroup Test - */ - struct ContainerEntryListTest : TestCase - { - ContainerEntryListTest() : TestCase("list") { } - - void run() - { - std::list<int> list; - TEST_CHECK(list.empty()); - { - ContainerEntry<std::list<int> > e1(&list, 5); - TEST_CHECK(list.begin() != list.end()); - TEST_CHECK_EQUAL(std::distance(list.begin(), list.end()), 1); - TEST_CHECK(list.end() != std::find(list.begin(), list.end(), 5)); - - { - ContainerEntry<std::list<int> > e2(&list, 4); - TEST_CHECK(list.begin() != list.end()); - TEST_CHECK_EQUAL(std::distance(list.begin(), list.end()), 2); - TEST_CHECK(list.end() != std::find(list.begin(), list.end(), 5)); - TEST_CHECK(list.end() != std::find(list.begin(), list.end(), 4)); - } - - TEST_CHECK(list.begin() != list.end()); - TEST_CHECK_EQUAL(std::distance(list.begin(), list.end()), 1); - TEST_CHECK(list.end() != std::find(list.begin(), list.end(), 5)); - } - TEST_CHECK(list.empty()); - } - } test_container_entry_list; -} - diff --git a/paludis/util/files.m4 b/paludis/util/files.m4 index cfa6e46..f2f07d3 100644 --- a/paludis/util/files.m4 +++ b/paludis/util/files.m4 @@ -12,7 +12,6 @@ add(`attributes', `hh') add(`collection', `hh') add(`compare', `hh') add(`comparison_policy', `hh', `test') -add(`container_entry', `hh', `test') add(`counted_ptr', `hh', `cc', `test') add(`deleter', `hh', `cc', `test') add(`destringify', `hh', `cc', `test') |