00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PALUDIS_GUARD_PALUDIS_DEP_ATOM_FLATTENER_HH
00021 #define PALUDIS_GUARD_PALUDIS_DEP_ATOM_FLATTENER_HH 1
00022
00023 #include <paludis/environment-fwd.hh>
00024 #include <paludis/package_id-fwd.hh>
00025 #include <paludis/dep_spec-fwd.hh>
00026 #include <paludis/spec_tree.hh>
00027 #include <paludis/util/attributes.hh>
00028 #include <paludis/util/instantiation_policy.hh>
00029 #include <paludis/util/private_implementation_pattern.hh>
00030 #include <paludis/util/no_type.hh>
00031 #include <paludis/util/wrapped_forward_iterator-fwd.hh>
00032 #include <tr1/memory>
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 namespace paludis
00045 {
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 template <typename Heirarchy_, typename Item_>
00065 class PALUDIS_VISIBLE DepSpecFlattener :
00066 private InstantiationPolicy<DepSpecFlattener<Heirarchy_, Item_>, instantiation_method::NonCopyableTag>,
00067 private PrivateImplementationPattern<DepSpecFlattener<Heirarchy_, Item_> >
00068 {
00069 private:
00070 typename PrivateImplementationPattern<DepSpecFlattener<Heirarchy_, Item_> >::ImpPtr & _imp;
00071
00072 public:
00073
00074
00075
00076 void visit(const typename Heirarchy_::template NodeType<NamedSetDepSpec>::Type & node);
00077 void visit(const typename Heirarchy_::template NodeType<PlainTextDepSpec>::Type & node);
00078 void visit(const typename Heirarchy_::template NodeType<PackageDepSpec>::Type & node);
00079 void visit(const typename Heirarchy_::template NodeType<SimpleURIDepSpec>::Type & node);
00080 void visit(const typename Heirarchy_::template NodeType<PlainTextLabelDepSpec>::Type & node);
00081
00082 void visit(const typename Heirarchy_::template NodeType<AllDepSpec>::Type & node);
00083 void visit(const typename Heirarchy_::template NodeType<AnyDepSpec>::Type & node);
00084 void visit(const typename Heirarchy_::template NodeType<ConditionalDepSpec>::Type & node);
00085
00086
00087
00088
00089
00090 template <bool b_> void handle_named_set(const NamedSetDepSpec & spec);
00091 void handle_item(const Item_ & spec);
00092
00093
00094
00095
00096
00097
00098 DepSpecFlattener(const Environment * const);
00099
00100 ~DepSpecFlattener();
00101
00102
00103
00104
00105
00106
00107 struct ConstIteratorTag;
00108 typedef WrappedForwardIterator<ConstIteratorTag, const std::tr1::shared_ptr<const Item_> > ConstIterator;
00109
00110 ConstIterator begin() const;
00111 ConstIterator end() const;
00112
00113
00114 };
00115
00116 #ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
00117 extern template class DepSpecFlattener<ProvideSpecTree, PackageDepSpec>;
00118 extern template class DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec>;
00119 extern template class DepSpecFlattener<SetSpecTree, PackageDepSpec>;
00120 extern template class DepSpecFlattener<SimpleURISpecTree, SimpleURIDepSpec>;
00121 #endif
00122 }
00123
00124 #endif