[Debtags-commits] [svn] r1736 - in tagcoll/2.0: . tagcoll
tagcoll/coll tagcoll/stream tagcoll/tests
Enrico Zini
enrico at costa.debian.org
Tue May 9 00:58:34 UTC 2006
Author: enrico
Date: Tue May 9 00:58:32 2006
New Revision: 1736
Added:
tagcoll/2.0/tagcoll/coll/
tagcoll/2.0/tagcoll/coll/base.h
Removed:
tagcoll/2.0/tagcoll/Collection.h
tagcoll/2.0/tagcoll/ReadonlyCollection.h
Modified:
tagcoll/2.0/ (props changed)
tagcoll/2.0/tagcoll/DerivedTags.cc
tagcoll/2.0/tagcoll/Implications.cc
tagcoll/2.0/tagcoll/Implications.h
tagcoll/2.0/tagcoll/InputMerger.cc
tagcoll/2.0/tagcoll/InputMerger.h
tagcoll/2.0/tagcoll/Makefile.am
tagcoll/2.0/tagcoll/PatchCollection.cc
tagcoll/2.0/tagcoll/PatchCollection.h
tagcoll/2.0/tagcoll/Patches.cc
tagcoll/2.0/tagcoll/Patches.h
tagcoll/2.0/tagcoll/TDBIndexer.cc
tagcoll/2.0/tagcoll/TDBIndexer.h
tagcoll/2.0/tagcoll/stream/expression.cc
tagcoll/2.0/tagcoll/stream/filters.cc
tagcoll/2.0/tagcoll/stream/substitutions.cc
tagcoll/2.0/tagcoll/test-utils.tcc
tagcoll/2.0/tagcoll/tests/test-utils.h
Log:
r2623 at viaza: enrico | 2006-05-08 13:27:05 -0500
Merged ReadonlyCollection and Collection into coll/base.h
Moved the various collections into the coll namespace
Modified: tagcoll/2.0/tagcoll/DerivedTags.cc
==============================================================================
--- tagcoll/2.0/tagcoll/DerivedTags.cc (original)
+++ tagcoll/2.0/tagcoll/DerivedTags.cc Tue May 9 00:58:32 2006
@@ -64,7 +64,7 @@
"c: milk\n"
"d: coffee, milk, sugar, sweet_cappuccino\n"
);
- InputMerger<string, string> result;
+ coll::InputMerger<string, string> result;
DerivedTags derivations;
derivations.add("cappuccino", Expression("coffee && milk && !sugar"));
@@ -72,7 +72,7 @@
parseCollection(input_coll, addDerived(derivations, inserter(result)));
- InputMerger<string, string> reference;
+ coll::InputMerger<string, string> reference;
parseCollection(output_coll, inserter(reference));
ensure_coll_equals(reference, result);
@@ -93,7 +93,7 @@
"c: milk\n"
"d: coffee, milk, sugar\n"
);
- InputMerger<string, string> result;
+ coll::InputMerger<string, string> result;
DerivedTags derivations;
derivations.add("cappuccino", Expression("coffee && milk && !sugar"));
@@ -101,7 +101,7 @@
parseCollection(input_coll, removeDerived(derivations, inserter(result)));
- InputMerger<string, string> reference;
+ coll::InputMerger<string, string> reference;
parseCollection(output_coll, inserter(reference));
ensure_coll_equals(reference, result);
Modified: tagcoll/2.0/tagcoll/Implications.cc
==============================================================================
--- tagcoll/2.0/tagcoll/Implications.cc (original)
+++ tagcoll/2.0/tagcoll/Implications.cc Tue May 9 00:58:32 2006
@@ -152,13 +152,13 @@
"c: coffee, milk, sugar, awake, sweet, bitter\n"
"d: sugar, sweet\n"
);
- InputMerger<string, string> result;
+ coll::InputMerger<string, string> result;
Implications<string> implications;
parseCollection(input_impl, inserter(implications));
parseCollection(input_coll, addImplied(implications, inserter(result)));
- InputMerger<string, string> reference;
+ coll::InputMerger<string, string> reference;
parseCollection(output_coll, inserter(reference));
ensure_coll_equals(reference, result);
@@ -184,13 +184,13 @@
"c: coffee, milk, sugar\n"
"d: sugar\n"
);
- InputMerger<string, string> result;
+ coll::InputMerger<string, string> result;
Implications<string> implications;
parseCollection(input_impl, inserter(implications));
parseCollection(input_coll, removeImplied(implications, inserter(result)));
- InputMerger<string, string> reference;
+ coll::InputMerger<string, string> reference;
parseCollection(output_coll, inserter(reference));
ensure_coll_equals(reference, result);
Modified: tagcoll/2.0/tagcoll/Implications.h
==============================================================================
--- tagcoll/2.0/tagcoll/Implications.h (original)
+++ tagcoll/2.0/tagcoll/Implications.h Tue May 9 00:58:32 2006
@@ -35,7 +35,7 @@
* List of explicit implications that can be applied to a tagged collection.
*/
template <class TAG>
-class Implications : public InputMerger<TAG, TAG>
+class Implications : public coll::InputMerger<TAG, TAG>
{
protected:
/// Get the set of all tags seen when walking through all parent lists
Modified: tagcoll/2.0/tagcoll/InputMerger.cc
==============================================================================
--- tagcoll/2.0/tagcoll/InputMerger.cc (original)
+++ tagcoll/2.0/tagcoll/InputMerger.cc Tue May 9 00:58:32 2006
@@ -27,6 +27,7 @@
using namespace wibble::operators;
namespace tagcoll {
+namespace coll {
#if 0
template<class T, class Tag>
@@ -180,14 +181,17 @@
}
}
+}
#ifndef INSTANTIATING_TEMPLATES
#include <string>
namespace tagcoll {
+namespace coll {
template class InputMerger<std::string, std::string>;
}
+}
#endif
@@ -208,7 +212,7 @@
template<> template<>
void to::test<1>()
{
- InputMerger<string, string> coll;
+ coll::InputMerger<string, string> coll;
output_test_collection(inserter(coll));
test_readonly_collection(coll);
@@ -217,7 +221,7 @@
template<> template<>
void to::test<2>()
{
- InputMerger<string, string> coll;
+ coll::InputMerger<string, string> coll;
test_collection(coll);
}
Modified: tagcoll/2.0/tagcoll/InputMerger.h
==============================================================================
--- tagcoll/2.0/tagcoll/InputMerger.h (original)
+++ tagcoll/2.0/tagcoll/InputMerger.h Tue May 9 00:58:32 2006
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (C) 2003,2004,2005 Enrico Zini <enrico at debian.org>
+ * Copyright (C) 2003,2004,2005,2006 Enrico Zini <enrico at debian.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -26,13 +26,15 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <tagcoll/Collection.h>
+#include <tagcoll/coll/base.h>
#include <map>
-namespace tagcoll
-{
-template<typename T1, typename T2> class PatchList;
+namespace tagcoll {
+template<typename ITEM, typename TAG>
+class PatchList;
+
+namespace coll {
template<typename ITEM, typename TAG>
class InputMerger;
@@ -56,7 +58,7 @@
* It is also a full-featured collection, although not very optimized.
*/
template<typename ITEM, typename TAG>
-class InputMerger : public Collection< InputMerger<ITEM, TAG> >
+class InputMerger : public coll::Collection< InputMerger<ITEM, TAG> >
{
protected:
std::map< ITEM, std::set<TAG> > coll;
@@ -142,7 +144,8 @@
void clear();
};
-};
+}
+}
// vim:set ts=4 sw=4:
#endif
Modified: tagcoll/2.0/tagcoll/Makefile.am
==============================================================================
--- tagcoll/2.0/tagcoll/Makefile.am (original)
+++ tagcoll/2.0/tagcoll/Makefile.am Tue May 9 00:58:32 2006
@@ -17,8 +17,7 @@
stream/expression.h \
stream/substitutions.h \
Consumer.h \
- ReadonlyCollection.h \
- Collection.h \
+ coll/base.h \
Patches.h \
Patches.tcc \
InputMerger.h \
Modified: tagcoll/2.0/tagcoll/PatchCollection.cc
==============================================================================
--- tagcoll/2.0/tagcoll/PatchCollection.cc (original)
+++ tagcoll/2.0/tagcoll/PatchCollection.cc Tue May 9 00:58:32 2006
@@ -26,8 +26,8 @@
using namespace std;
using namespace wibble::operators;
-namespace tagcoll
-{
+namespace tagcoll {
+namespace coll {
template<typename ROCOLL>
typename coll_traits<ROCOLL>::itemset_type PatchCollection<ROCOLL>::getItems(const Tag& tag) const
@@ -198,7 +198,7 @@
return card;
}
-
+}
}
#ifdef COMPILE_TESTSUITE
@@ -219,9 +219,9 @@
void to::test<1>()
{
// Use an InputMerger as the embedded collection
- InputMerger<string, string> startcoll;
+ coll::InputMerger<string, string> startcoll;
- PatchCollection< InputMerger<string, string> > coll(startcoll);
+ coll::PatchCollection< coll::InputMerger<string, string> > coll(startcoll);
output_test_collection(inserter(coll));
test_readonly_collection(coll);
@@ -231,9 +231,9 @@
void to::test<2>()
{
// Use an InputMerger as the embedded collection
- InputMerger<string, string> startcoll;
+ coll::InputMerger<string, string> startcoll;
- PatchCollection< InputMerger<string, string> > coll(startcoll);
+ coll::PatchCollection< coll::InputMerger<string, string> > coll(startcoll);
test_collection(coll);
}
Modified: tagcoll/2.0/tagcoll/PatchCollection.h
==============================================================================
--- tagcoll/2.0/tagcoll/PatchCollection.h (original)
+++ tagcoll/2.0/tagcoll/PatchCollection.h Tue May 9 00:58:32 2006
@@ -6,7 +6,7 @@
*/
/*
- * Copyright (C) 2005 Enrico Zini <enrico at debian.org>
+ * Copyright (C) 2005,2006 Enrico Zini <enrico at debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,13 +23,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <tagcoll/Collection.h>
+#include <tagcoll/coll/base.h>
#include <tagcoll/Patches.h>
-namespace tagcoll
-{
+namespace tagcoll {
template<typename T1, typename T2> class PatchList;
+namespace coll {
template<typename ROCOLL>
class PatchCollection;
@@ -47,7 +47,7 @@
* a PatchList.
*/
template<typename ROCOLL>
-class PatchCollection : public Collection< PatchCollection<ROCOLL> >
+class PatchCollection : public coll::Collection< PatchCollection<ROCOLL> >
{
public:
typedef Patch<
@@ -242,6 +242,7 @@
};
}
+}
// vim:set ts=4 sw=4:
#endif
Modified: tagcoll/2.0/tagcoll/Patches.cc
==============================================================================
--- tagcoll/2.0/tagcoll/Patches.cc (original)
+++ tagcoll/2.0/tagcoll/Patches.cc Tue May 9 00:58:32 2006
@@ -56,7 +56,7 @@
"c: \n"
"d: c::D, c::d, e::F\n"
);
- InputMerger<string, string> result;
+ coll::InputMerger<string, string> result;
PatchList<string, string> patches;
std::set<string> added;
@@ -76,7 +76,7 @@
parseCollection(input_coll, patcher(patches, inserter(result)));
- InputMerger<string, string> reference;
+ coll::InputMerger<string, string> reference;
parseCollection(output_coll, inserter(reference));
ensure_coll_equals(reference, result);
Modified: tagcoll/2.0/tagcoll/Patches.h
==============================================================================
--- tagcoll/2.0/tagcoll/Patches.h (original)
+++ tagcoll/2.0/tagcoll/Patches.h Tue May 9 00:58:32 2006
@@ -6,7 +6,7 @@
*/
/*
- * Copyright (C) 2003,2004,2005 Enrico Zini <enrico at debian.org>
+ * Copyright (C) 2003,2004,2005,2006 Enrico Zini <enrico at debian.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -23,8 +23,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <tagcoll/Collection.h>
-
#include <wibble/operators.h>
#include <wibble/singleton.h>
#include <wibble/mixin.h>
Modified: tagcoll/2.0/tagcoll/TDBIndexer.cc
==============================================================================
--- tagcoll/2.0/tagcoll/TDBIndexer.cc (original)
+++ tagcoll/2.0/tagcoll/TDBIndexer.cc Tue May 9 00:58:32 2006
@@ -24,9 +24,10 @@
#include <wibble/operators.h>
using namespace std;
-using namespace tagcoll;
using namespace wibble::operators;
+namespace tagcoll {
+namespace coll {
template<class ITEM, class TAG>
std::set<ITEM> TDBIndexer<ITEM, TAG>::getItems(const TAG& tag) const
@@ -131,12 +132,17 @@
}
#endif
+}
+}
+
#ifndef INSTANTIATING_TEMPLATES
#include <string>
namespace tagcoll {
+namespace coll {
template class TDBIndexer<std::string, std::string>;
}
+}
#endif
#ifdef COMPILE_TESTSUITE
@@ -154,7 +160,7 @@
template<> template<>
void to::test<1>()
{
- TDBIndexer<string, string> coll;
+ tagcoll::coll::TDBIndexer<string, string> coll;
output_test_collection(inserter(coll));
test_readonly_collection(coll);
@@ -163,7 +169,7 @@
template<> template<>
void to::test<2>()
{
- TDBIndexer<string, string> coll;
+ tagcoll::coll::TDBIndexer<string, string> coll;
test_collection(coll);
}
Modified: tagcoll/2.0/tagcoll/TDBIndexer.h
==============================================================================
--- tagcoll/2.0/tagcoll/TDBIndexer.h (original)
+++ tagcoll/2.0/tagcoll/TDBIndexer.h Tue May 9 00:58:32 2006
@@ -6,7 +6,7 @@
*/
/*
- * Copyright (C) 2005 Enrico Zini <enrico at debian.org>
+ * Copyright (C) 2005,2006 Enrico Zini <enrico at debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,13 +23,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <tagcoll/Collection.h>
+#include <tagcoll/coll/base.h>
#include <map>
-namespace tagcoll
-{
+namespace tagcoll {
template<typename T1, typename T2> class PatchList;
+namespace coll {
template<typename ITEM, typename TAG>
class TDBIndexer;
@@ -53,7 +53,7 @@
* run and tend to be more compact than the ones created by TDBDiskIndex.
*/
template<class ITEM, class TAG>
-class TDBIndexer : public Collection< TDBIndexer<ITEM, TAG> >
+class TDBIndexer : public coll::Collection< TDBIndexer<ITEM, TAG> >
{
protected:
std::map<ITEM, std::set<TAG> > items;
@@ -119,7 +119,8 @@
void applyChange(const PatchList<ITEM, TAG>& change);
};
-};
+}
+}
// vim:set ts=4 sw=4:
#endif
Modified: tagcoll/2.0/tagcoll/stream/expression.cc
==============================================================================
--- tagcoll/2.0/tagcoll/stream/expression.cc (original)
+++ tagcoll/2.0/tagcoll/stream/expression.cc Tue May 9 00:58:32 2006
@@ -31,6 +31,7 @@
using namespace tagcoll;
using namespace tagcoll::stream;
using namespace tagcoll::tests;
+using namespace tagcoll::coll;
struct tagcoll_stream_expression_shar {
};
Modified: tagcoll/2.0/tagcoll/stream/filters.cc
==============================================================================
--- tagcoll/2.0/tagcoll/stream/filters.cc (original)
+++ tagcoll/2.0/tagcoll/stream/filters.cc Tue May 9 00:58:32 2006
@@ -33,6 +33,7 @@
using namespace tagcoll;
using namespace tagcoll::stream;
using namespace tagcoll::tests;
+using namespace tagcoll::coll;
struct tagcoll_stream_filters_shar {
};
Modified: tagcoll/2.0/tagcoll/stream/substitutions.cc
==============================================================================
--- tagcoll/2.0/tagcoll/stream/substitutions.cc (original)
+++ tagcoll/2.0/tagcoll/stream/substitutions.cc Tue May 9 00:58:32 2006
@@ -31,6 +31,7 @@
using namespace tagcoll;
using namespace tagcoll::stream;
using namespace tagcoll::tests;
+using namespace tagcoll::coll;
struct tagcoll_stream_substitutions_shar {
};
Modified: tagcoll/2.0/tagcoll/test-utils.tcc
==============================================================================
--- tagcoll/2.0/tagcoll/test-utils.tcc (original)
+++ tagcoll/2.0/tagcoll/test-utils.tcc Tue May 9 00:58:32 2006
@@ -291,7 +291,7 @@
// TODO: virtual std::set<ITEM> getRelatedItems(const std::set<TAG>& tags, int maxdistance = 1) const
// void output(Consumer<ITEM, TAG>& consumer) const
- InputMerger<string, string> coll1;
+ coll::InputMerger<string, string> coll1;
tc.output(inserter(coll1));
inner_ensure_coll_equals(tc, coll1);
Modified: tagcoll/2.0/tagcoll/tests/test-utils.h
==============================================================================
--- tagcoll/2.0/tagcoll/tests/test-utils.h (original)
+++ tagcoll/2.0/tagcoll/tests/test-utils.h Tue May 9 00:58:32 2006
@@ -13,7 +13,6 @@
#define TEST_TAGCOLL
#ifdef TEST_TAGCOLL
-#include <tagcoll/Collection.h>
#include <tagcoll/StringParserInput.h>
#include <tagcoll/TextFormat.h>
#endif
More information about the Debtags-commits
mailing list