1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/ResTraits.h
12 #ifndef ZYPP_RESTRAITS_H
13 #define ZYPP_RESTRAITS_H
15 #include "zypp/base/PtrTypes.h"
16 #include "zypp/base/KindOf.h"
18 ///////////////////////////////////////////////////////////////////
20 { /////////////////////////////////////////////////////////////////
36 class SystemResObject;
38 /** Base of ResTraits. Defines the Resolvable::Kind type. */
39 struct ResolvableTraits
41 typedef KindOf<Resolvable> KindType;
44 /** ResTraits. Defines common types and the Kind value. */
45 template<typename _Res>
46 struct ResTraits : public ResolvableTraits
48 typedef intrusive_ptr<_Res> PtrType;
49 typedef intrusive_ptr<const _Res> constPtrType;
51 static const KindType kind;
54 /** ResTraits specialisation for Resolvable.
55 * Resolvable is common base and has no Kind value.
58 struct ResTraits<Resolvable> : public ResolvableTraits
60 typedef intrusive_ptr<Resolvable> PtrType;
61 typedef intrusive_ptr<const Resolvable> constPtrType;
64 /** ResTraits specialisation for ResObject.
65 * ResObject is common base and has no Kind value.
68 struct ResTraits<ResObject> : public ResolvableTraits
70 typedef intrusive_ptr<ResObject> PtrType;
71 typedef intrusive_ptr<const ResObject> constPtrType;
74 /////////////////////////////////////////////////////////////////
76 ///////////////////////////////////////////////////////////////////
77 #endif // ZYPP_RESTRAITS_H