aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen P. Bennett <spb@exherbo.org> 2007-09-08 21:21:23 +0000
committerAvatar Stephen P. Bennett <spb@exherbo.org> 2007-09-08 21:21:23 +0000
commit355cb7225e8c0dca6eb0f30f49a88e1574e80ac0 (patch)
tree6432d782c1e64f4a12481fb678c18da111a23b22
parent561157f88812146329da3a24cc09607150dc0f63 (diff)
downloadpaludis-355cb7225e8c0dca6eb0f30f49a88e1574e80ac0.tar.gz
paludis-355cb7225e8c0dca6eb0f30f49a88e1574e80ac0.tar.xz
Make dependency label heirarchy more heirarchical
-rw-r--r--paludis/dep_label-fwd.hh45
-rw-r--r--paludis/dep_label.cc44
-rw-r--r--paludis/dep_label.hh84
3 files changed, 129 insertions, 44 deletions
diff --git a/paludis/dep_label-fwd.hh b/paludis/dep_label-fwd.hh
index 7a1bae2..fede402 100644
--- a/paludis/dep_label-fwd.hh
+++ b/paludis/dep_label-fwd.hh
@@ -40,21 +40,38 @@ namespace paludis
struct DependencyLabelVisitorTypes;
struct DependencyLabel;
+ struct DependencySystemLabel;
+ struct DependencyTypeLabel;
+ struct DependencySuggestLabel;
+ struct DependencyABIsLabel;
- template <typename T_> struct ConcreteDependencyLabel;
- typedef ConcreteDependencyLabel<enum DependencyHostLabelTag { }> DependencyHostLabel;
- typedef ConcreteDependencyLabel<enum DependencyTargetLabelTag { }> DependencyTargetLabel;
- typedef ConcreteDependencyLabel<enum DependencyBuildLabelTag { }> DependencyBuildLabel;
- typedef ConcreteDependencyLabel<enum DependencyRunLabelTag { }> DependencyRunLabel;
- typedef ConcreteDependencyLabel<enum DependencyInstallLabelTag { }> DependencyInstallLabel;
- typedef ConcreteDependencyLabel<enum DependencyCompileLabelTag { }> DependencyCompileLabel;
- typedef ConcreteDependencyLabel<enum DependencySuggestedLabelTag { }> DependencySuggestedLabel;
- typedef ConcreteDependencyLabel<enum DependencyRecommendedLabelTag { }> DependencyRecommendedLabel;
- typedef ConcreteDependencyLabel<enum DependencyRequiredLabelTag { }> DependencyRequiredLabel;
- typedef ConcreteDependencyLabel<enum DependencyAnyLabelTag { }> DependencyAnyLabel;
- typedef ConcreteDependencyLabel<enum DependencyMineLabelTag { }> DependencyMineLabel;
- typedef ConcreteDependencyLabel<enum DependencyPrimaryLabelTag { }> DependencyPrimaryLabel;
- typedef ConcreteDependencyLabel<enum DependencyABILabelTag { }> DependencyABILabel;
+ template <typename T_, typename Category_> struct ConcreteDependencyLabel;
+ typedef ConcreteDependencyLabel<enum DependencyHostLabelTag { },
+ DependencySystemLabel> DependencyHostLabel;
+ typedef ConcreteDependencyLabel<enum DependencyTargetLabelTag { },
+ DependencySystemLabel> DependencyTargetLabel;
+ typedef ConcreteDependencyLabel<enum DependencyBuildLabelTag { },
+ DependencyTypeLabel> DependencyBuildLabel;
+ typedef ConcreteDependencyLabel<enum DependencyRunLabelTag { },
+ DependencyTypeLabel> DependencyRunLabel;
+ typedef ConcreteDependencyLabel<enum DependencyInstallLabelTag { },
+ DependencyTypeLabel> DependencyInstallLabel;
+ typedef ConcreteDependencyLabel<enum DependencyCompileLabelTag { },
+ DependencyTypeLabel> DependencyCompileLabel;
+ typedef ConcreteDependencyLabel<enum DependencySuggestedLabelTag { },
+ DependencySuggestLabel> DependencySuggestedLabel;
+ typedef ConcreteDependencyLabel<enum DependencyRecommendedLabelTag { },
+ DependencySuggestLabel> DependencyRecommendedLabel;
+ typedef ConcreteDependencyLabel<enum DependencyRequiredLabelTag { },
+ DependencySuggestLabel> DependencyRequiredLabel;
+ typedef ConcreteDependencyLabel<enum DependencyAnyLabelTag { },
+ DependencyABIsLabel> DependencyAnyLabel;
+ typedef ConcreteDependencyLabel<enum DependencyMineLabelTag { },
+ DependencyABIsLabel> DependencyMineLabel;
+ typedef ConcreteDependencyLabel<enum DependencyPrimaryLabelTag { },
+ DependencyABIsLabel> DependencyPrimaryLabel;
+ typedef ConcreteDependencyLabel<enum DependencyABILabelTag { },
+ DependencyABIsLabel> DependencyABILabel;
std::ostream & operator<< (std::ostream &, const DependencyLabel &) PALUDIS_VISIBLE;
}
diff --git a/paludis/dep_label.cc b/paludis/dep_label.cc
index c4b7e18..305c910 100644
--- a/paludis/dep_label.cc
+++ b/paludis/dep_label.cc
@@ -94,8 +94,8 @@ DependencyLabel::~DependencyLabel()
namespace paludis
{
template <>
- template <typename T_>
- struct Implementation<ConcreteDependencyLabel<T_> >
+ template <typename T_, typename C_>
+ struct Implementation<ConcreteDependencyLabel<T_, C_> >
{
const std::string text;
@@ -106,34 +106,34 @@ namespace paludis
};
}
-template <typename T_>
-ConcreteDependencyLabel<T_>::ConcreteDependencyLabel(const std::string & t) :
- PrivateImplementationPattern<ConcreteDependencyLabel<T_> >(new Implementation<ConcreteDependencyLabel<T_> >(t))
+template <typename T_, typename C_>
+ConcreteDependencyLabel<T_, C_>::ConcreteDependencyLabel(const std::string & t) :
+ PrivateImplementationPattern<ConcreteDependencyLabel<T_, C_> >(new Implementation<ConcreteDependencyLabel<T_, C_> >(t))
{
}
-template <typename T_>
-ConcreteDependencyLabel<T_>::~ConcreteDependencyLabel()
+template <typename T_, typename C_>
+ConcreteDependencyLabel<T_, C_>::~ConcreteDependencyLabel()
{
}
-template <typename T_>
+template <typename T_, typename C_>
const std::string
-ConcreteDependencyLabel<T_>::text() const
+ConcreteDependencyLabel<T_, C_>::text() const
{
return _imp->text;
}
-template class ConcreteDependencyLabel<DependencyHostLabel::Tag>;
-template class ConcreteDependencyLabel<DependencyTargetLabel::Tag>;
-template class ConcreteDependencyLabel<DependencyBuildLabel::Tag>;
-template class ConcreteDependencyLabel<DependencyRunLabel::Tag>;
-template class ConcreteDependencyLabel<DependencyInstallLabel::Tag>;
-template class ConcreteDependencyLabel<DependencyCompileLabel::Tag>;
-template class ConcreteDependencyLabel<DependencySuggestedLabel::Tag>;
-template class ConcreteDependencyLabel<DependencyRecommendedLabel::Tag>;
-template class ConcreteDependencyLabel<DependencyRequiredLabel::Tag>;
-template class ConcreteDependencyLabel<DependencyAnyLabel::Tag>;
-template class ConcreteDependencyLabel<DependencyMineLabel::Tag>;
-template class ConcreteDependencyLabel<DependencyPrimaryLabel::Tag>;
-template class ConcreteDependencyLabel<DependencyABILabel::Tag>;
+template class ConcreteDependencyLabel<DependencyHostLabel::Tag, DependencySystemLabel>;
+template class ConcreteDependencyLabel<DependencyTargetLabel::Tag, DependencySystemLabel>;
+template class ConcreteDependencyLabel<DependencyBuildLabel::Tag, DependencyTypeLabel>;
+template class ConcreteDependencyLabel<DependencyRunLabel::Tag, DependencyTypeLabel>;
+template class ConcreteDependencyLabel<DependencyInstallLabel::Tag, DependencyTypeLabel>;
+template class ConcreteDependencyLabel<DependencyCompileLabel::Tag, DependencyTypeLabel>;
+template class ConcreteDependencyLabel<DependencySuggestedLabel::Tag, DependencySuggestLabel>;
+template class ConcreteDependencyLabel<DependencyRecommendedLabel::Tag, DependencySuggestLabel>;
+template class ConcreteDependencyLabel<DependencyRequiredLabel::Tag, DependencySuggestLabel>;
+template class ConcreteDependencyLabel<DependencyAnyLabel::Tag, DependencyABIsLabel>;
+template class ConcreteDependencyLabel<DependencyMineLabel::Tag, DependencyABIsLabel>;
+template class ConcreteDependencyLabel<DependencyPrimaryLabel::Tag, DependencyABIsLabel>;
+template class ConcreteDependencyLabel<DependencyABILabel::Tag, DependencyABIsLabel>;
diff --git a/paludis/dep_label.hh b/paludis/dep_label.hh
index b48f766..5ae45a2 100644
--- a/paludis/dep_label.hh
+++ b/paludis/dep_label.hh
@@ -46,15 +46,51 @@ namespace paludis
VisitorTypes<
DependencyLabelVisitorTypes,
DependencyLabel,
+ DependencySystemLabel,
+ DependencyTypeLabel,
+ DependencySuggestLabel,
+ DependencyABIsLabel
+ >
+ {
+ };
+
+ struct DependencySystemLabelVisitorTypes :
+ VisitorTypes<
+ DependencySystemLabelVisitorTypes,
+ DependencySystemLabel,
DependencyHostLabel,
- DependencyTargetLabel,
+ DependencyTargetLabel
+ >
+ {
+ };
+
+ struct DependencyTypeLabelVisitorTypes :
+ VisitorTypes<
+ DependencyTypeLabelVisitorTypes,
+ DependencyTypeLabel,
DependencyBuildLabel,
DependencyRunLabel,
DependencyInstallLabel,
- DependencyCompileLabel,
+ DependencyCompileLabel
+ >
+ {
+ };
+
+ struct DependencySuggestLabelVisitorTypes :
+ VisitorTypes<
+ DependencySuggestLabelVisitorTypes,
+ DependencySuggestLabel,
DependencySuggestedLabel,
DependencyRecommendedLabel,
- DependencyRequiredLabel,
+ DependencyRequiredLabel
+ >
+ {
+ };
+
+ struct DependencyABIsLabelVisitorTypes :
+ VisitorTypes<
+ DependencyABIsLabelVisitorTypes,
+ DependencyABIsLabel,
DependencyAnyLabel,
DependencyMineLabel,
DependencyPrimaryLabel,
@@ -101,14 +137,46 @@ namespace paludis
virtual const std::string text() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
};
- template <typename T_>
- class PALUDIS_VISIBLE ConcreteDependencyLabel :
+ struct PALUDIS_VISIBLE DependencySystemLabel :
+ public DependencyLabel,
+ public ConstAcceptInterfaceVisitsThis<DependencyLabelVisitorTypes, DependencySystemLabel>,
+ public virtual ConstAcceptInterface<DependencySystemLabelVisitorTypes>
+ {
+ typedef DependencySystemLabelVisitorTypes VisitorTypes;
+ };
+
+ struct PALUDIS_VISIBLE DependencyTypeLabel :
public DependencyLabel,
- public ConstAcceptInterfaceVisitsThis<DependencyLabelVisitorTypes, ConcreteDependencyLabel<T_> >,
- private PrivateImplementationPattern<ConcreteDependencyLabel<T_> >
+ public ConstAcceptInterfaceVisitsThis<DependencyLabelVisitorTypes, DependencyTypeLabel>,
+ public virtual ConstAcceptInterface<DependencyTypeLabelVisitorTypes>
+ {
+ typedef DependencyTypeLabelVisitorTypes VisitorTypes;
+ };
+
+ struct PALUDIS_VISIBLE DependencySuggestLabel :
+ public DependencyLabel,
+ public ConstAcceptInterfaceVisitsThis<DependencyLabelVisitorTypes, DependencySuggestLabel>,
+ public virtual ConstAcceptInterface<DependencySuggestLabelVisitorTypes>
+ {
+ typedef DependencySuggestLabelVisitorTypes VisitorTypes;
+ };
+
+ struct PALUDIS_VISIBLE DependencyABIsLabel :
+ public DependencyLabel,
+ public ConstAcceptInterfaceVisitsThis<DependencyLabelVisitorTypes, DependencyABIsLabel>,
+ public virtual ConstAcceptInterface<DependencyABIsLabelVisitorTypes>
+ {
+ typedef DependencyABIsLabelVisitorTypes VisitorTypes;
+ };
+
+ template <typename T_, typename C_>
+ class PALUDIS_VISIBLE ConcreteDependencyLabel :
+ public C_,
+ public ConstAcceptInterfaceVisitsThis<typename C_::VisitorTypes, ConcreteDependencyLabel<T_, C_> >,
+ private PrivateImplementationPattern<ConcreteDependencyLabel<T_, C_> >
{
private:
- using PrivateImplementationPattern<ConcreteDependencyLabel<T_> >::_imp;
+ using PrivateImplementationPattern<ConcreteDependencyLabel<T_, C_> >::_imp;
public:
ConcreteDependencyLabel(const std::string &);