20 #ifndef PALUDIS_GUARD_PALUDIS_SPEC_TREE_HH 21 #define PALUDIS_GUARD_PALUDIS_SPEC_TREE_HH 1 23 #include <paludis/spec_tree-fwd.hh> 24 #include <paludis/util/wrapped_forward_iterator.hh> 25 #include <paludis/util/visitor.hh> 27 #include <type_traits> 31 namespace spec_tree_internals
33 template <
typename Tree_>
35 public virtual DeclareAbstractAcceptMethods<BasicNode<Tree_>, typename Tree_::VisitableTypeList>
39 template <
typename Tree_,
typename Item_>
41 public BasicNode<Tree_>,
42 public ImplementAcceptMethods<BasicNode<Tree_>, LeafNode<Tree_, Item_> >
45 const std::shared_ptr<const Item_> _spec;
48 explicit LeafNode(
const std::shared_ptr<const Item_> & i);
50 template <
typename OtherTree_>
51 operator LeafNode<OtherTree_, Item_> ()
const;
53 const std::shared_ptr<const Item_> spec()
const;
56 template <
typename Tree_,
typename Item_>
59 template <
typename Tree_>
61 public BasicNode<Tree_>
64 typedef Sequence<std::shared_ptr<const BasicNode<Tree_> > > ChildList;
65 std::shared_ptr<ChildList> _child_list;
70 typedef BasicInnerNodeConstIteratorTag<Tree_> ConstIteratorTag;
71 typedef WrappedForwardIterator<ConstIteratorTag,
72 const std::shared_ptr<const BasicNode<Tree_> > > ConstIterator;
74 ConstIterator begin()
const;
76 ConstIterator end()
const;
78 void append_node(
const std::shared_ptr<
const BasicNode<Tree_> > & t);
80 template <
typename T_>
81 const std::shared_ptr<typename Tree_::template NodeType<T_>::Type>
82 append(
const std::shared_ptr<const T_> & t);
84 template <
typename T_>
85 const std::shared_ptr<typename Tree_::template NodeType<T_>::Type>
86 append(
const std::shared_ptr<T_> & t);
89 template <
typename Tree_,
typename Item_>
91 public BasicInnerNode<Tree_>,
92 public ImplementAcceptMethods<BasicNode<Tree_>, InnerNode<Tree_, Item_> >
95 const std::shared_ptr<const Item_> _spec;
98 explicit InnerNode(
const std::shared_ptr<const Item_> & i);
100 template <
typename OtherTree_>
101 operator InnerNode<OtherTree_, Item_> ()
const;
103 const std::shared_ptr<const Item_> spec()
const;
106 template <
typename Tree_>
112 template <
typename Tree_,
typename Item_,
typename Tail_>
119 template <
typename Tree_,
typename Item_,
typename Tail_>
126 template <
typename Tree_,
typename NodeList_>
133 template <
typename NodeList_,
typename RootNode_>
137 typedef typename spec_tree_internals::MakeVisitableTypeList<SpecTree, NodeList_>::Type VisitableTypeList;
142 template <
typename Node_>
148 template <
typename Node_>
154 template <
typename Node_>
157 typedef typename std::conditional<
160 typename std::conditional<
168 explicit SpecTree(
const std::shared_ptr<RootNode_> & spec);
170 explicit SpecTree(
const std::shared_ptr<const RootNode_> & spec);
172 const std::shared_ptr<typename InnerNodeType<RootNode_>::Type> top();
174 const std::shared_ptr<const typename InnerNodeType<RootNode_>::Type> top()
const;
177 const std::shared_ptr<typename InnerNodeType<RootNode_>::Type> _top;
199 SpecTreeLeafNodeType<LicenseDepSpec>,
200 SpecTreeInnerNodeType<AllDepSpec>,
201 SpecTreeInnerNodeType<AnyDepSpec>,
203 >::Type, AllDepSpec>;
206 SpecTreeLeafNodeType<FetchableURIDepSpec>,
207 SpecTreeLeafNodeType<URILabelsDepSpec>,
208 SpecTreeInnerNodeType<AllDepSpec>,
210 >::Type, AllDepSpec>;
213 SpecTreeLeafNodeType<SimpleURIDepSpec>,
214 SpecTreeInnerNodeType<AllDepSpec>,
216 >::Type, AllDepSpec>;
219 SpecTreeLeafNodeType<PackageDepSpec>,
220 SpecTreeInnerNodeType<AllDepSpec>,
222 >::Type, AllDepSpec>;
225 SpecTreeLeafNodeType<PlainTextDepSpec>,
226 SpecTreeLeafNodeType<PlainTextLabelDepSpec>,
227 SpecTreeInnerNodeType<AllDepSpec>,
229 >::Type, AllDepSpec>;
232 SpecTreeLeafNodeType<PlainTextDepSpec>,
233 SpecTreeInnerNodeType<AllDepSpec>,
234 SpecTreeInnerNodeType<AnyDepSpec>,
235 SpecTreeInnerNodeType<ExactlyOneDepSpec>,
236 SpecTreeInnerNodeType<AtMostOneDepSpec>,
238 >::Type, AllDepSpec>;
241 SpecTreeLeafNodeType<PackageDepSpec>,
242 SpecTreeLeafNodeType<BlockDepSpec>,
243 SpecTreeLeafNodeType<DependenciesLabelsDepSpec>,
244 SpecTreeLeafNodeType<NamedSetDepSpec>,
245 SpecTreeInnerNodeType<AllDepSpec>,
246 SpecTreeInnerNodeType<AnyDepSpec>,
248 >::Type, AllDepSpec>;
251 SpecTreeLeafNodeType<PackageDepSpec>,
252 SpecTreeLeafNodeType<NamedSetDepSpec>,
253 SpecTreeInnerNodeType<AllDepSpec>
254 >::Type, AllDepSpec>;
257 const std::shared_ptr<const spec_tree_internals::BasicNode<GenericSpecTree> > >;
259 const std::shared_ptr<const spec_tree_internals::BasicNode<DependencySpecTree> > >;
261 const std::shared_ptr<const spec_tree_internals::BasicNode<SetSpecTree> > >;
263 const std::shared_ptr<const spec_tree_internals::BasicNode<PlainTextSpecTree> > >;
265 const std::shared_ptr<const spec_tree_internals::BasicNode<RequiredUseSpecTree> > >;
267 const std::shared_ptr<const spec_tree_internals::BasicNode<SimpleURISpecTree> > >;
269 const std::shared_ptr<const spec_tree_internals::BasicNode<FetchableURISpecTree> > >;
271 const std::shared_ptr<const spec_tree_internals::BasicNode<LicenseSpecTree> > >;
Definition: about_metadata-fwd.hh:23
Definition: type_list.hh:27
Definition: spec_tree-fwd.hh:40
Definition: spec_tree-fwd.hh:32
Definition: spec_tree.hh:149
Definition: spec_tree-fwd.hh:52
Definition: type_list-fwd.hh:28
Definition: spec_tree-fwd.hh:43
Definition: spec_tree-fwd.hh:29
Definition: type_list-fwd.hh:31
Definition: wrapped_forward_iterator-fwd.hh:26
Definition: spec_tree-fwd.hh:37
Definition: spec_tree-fwd.hh:64
Definition: type_list-fwd.hh:46
Definition: spec_tree.hh:143
Definition: spec_tree-fwd.hh:67
Definition: spec_tree-fwd.hh:46
Definition: spec_tree.hh:155
#define PALUDIS_VISIBLE
Definition: attributes.hh:59
Definition: dep_spec.hh:137