aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-13 13:30:32 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-13 13:30:32 +0000
commit6afcbdebeedff936cbe161cdb4dea7b7f58fd827 (patch)
tree8d1f7ae531de6c27c3412e326465cdf810ae6787
parent582061c6d236560eb2fc7a23dd51489dfc00eece (diff)
downloadpaludis-6afcbdebeedff936cbe161cdb4dea7b7f58fd827.tar.gz
paludis-6afcbdebeedff936cbe161cdb4dea7b7f58fd827.tar.xz
Make a visitor-fwd.hh
-rw-r--r--paludis/util/files.m42
-rw-r--r--paludis/util/visitor-fwd.hh75
-rw-r--r--paludis/util/visitor.hh18
3 files changed, 86 insertions, 9 deletions
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4
index 2210260..481b428 100644
--- a/paludis/util/files.m4
+++ b/paludis/util/files.m4
@@ -40,5 +40,5 @@ add(`tokeniser', `hh', `cc', `test')
add(`util', `hh')
add(`validated', `hh', `test')
add(`virtual_constructor', `hh', `impl', `test')
-add(`visitor', `hh', `test')
+add(`visitor', `hh', `fwd', `test')
diff --git a/paludis/util/visitor-fwd.hh b/paludis/util/visitor-fwd.hh
new file mode 100644
index 0000000..ef2e858
--- /dev/null
+++ b/paludis/util/visitor-fwd.hh
@@ -0,0 +1,75 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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_UTIL_VISITOR_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_VISITOR_FWD_HH 1
+
+namespace paludis
+{
+ template <typename NodePtrType_>
+ class Visits;
+
+ namespace visitor_internals
+ {
+ template <unsigned n_>
+ struct NoType;
+
+ template <typename>
+ struct MakePointerToConst;
+
+ template <typename T_>
+ struct MakePointerToConst<T_ *>;
+
+ template <typename NodePtrType_>
+ class Visits;
+
+ template <unsigned n_>
+ class Visits<const visitor_internals::NoType<n_> * >;
+
+ template <unsigned n_>
+ class Visits<visitor_internals::NoType<n_> * >;
+ }
+
+ template <typename VisitorType_>
+ class VisitableInterface;
+
+ template <typename OurType_, typename VisitorType_>
+ class Visitable;
+
+ template <
+ typename N1_,
+ typename N2_ = visitor_internals::NoType<2> *,
+ typename N3_ = visitor_internals::NoType<3> *,
+ typename N4_ = visitor_internals::NoType<4> *,
+ typename N5_ = visitor_internals::NoType<5> *,
+ typename N6_ = visitor_internals::NoType<6> *,
+ typename N7_ = visitor_internals::NoType<7> *,
+ typename N8_ = visitor_internals::NoType<8> *,
+ typename N9_ = visitor_internals::NoType<9> *>
+ class VisitorTypes;
+
+ template <typename VisitorPointer_>
+ class AcceptVisitor;
+
+ template <typename VisitorPointer_>
+ AcceptVisitor<VisitorPointer_> accept_visitor(VisitorPointer_ * const p);
+}
+
+
+#endif
diff --git a/paludis/util/visitor.hh b/paludis/util/visitor.hh
index 09e7efd..3e14879 100644
--- a/paludis/util/visitor.hh
+++ b/paludis/util/visitor.hh
@@ -26,6 +26,8 @@
* \ingroup grpvisitor
*/
+#include <paludis/util/visitor-fwd.hh>
+
namespace std
{
#ifndef DOXYGEN
@@ -236,14 +238,14 @@ namespace paludis
*/
template <
typename N1_,
- typename N2_ = visitor_internals::NoType<2> *,
- typename N3_ = visitor_internals::NoType<3> *,
- typename N4_ = visitor_internals::NoType<4> *,
- typename N5_ = visitor_internals::NoType<5> *,
- typename N6_ = visitor_internals::NoType<6> *,
- typename N7_ = visitor_internals::NoType<7> *,
- typename N8_ = visitor_internals::NoType<8> *,
- typename N9_ = visitor_internals::NoType<9> *>
+ typename N2_,
+ typename N3_,
+ typename N4_,
+ typename N5_,
+ typename N6_,
+ typename N7_,
+ typename N8_,
+ typename N9_>
class VisitorTypes
{
private: