ImplT/PimplT/RimplT renamed to the more readable version: T->Of
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@696 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
3de4a064cb
commit
0e03492cdb
5 changed files with 78 additions and 71 deletions
4
CHANGES
4
CHANGES
|
@ -4,6 +4,10 @@ Version 0.1.6
|
|||
???, 2006
|
||||
_____________________________________
|
||||
|
||||
Pimpl:
|
||||
- ImplT/PimplT/RimplT renamed to the more readable version: T->Of
|
||||
|
||||
|
||||
_____________________________________
|
||||
|
||||
Version 0.1.5
|
||||
|
|
|
@ -140,41 +140,41 @@ namespace Loki
|
|||
|
||||
|
||||
//////////////////////////////////////////
|
||||
/// \class ImplT
|
||||
/// \class ImplOf
|
||||
///
|
||||
/// \ingroup PimplGroup
|
||||
/// \ingroup PimplGroup
|
||||
/// Convenience template for the
|
||||
/// implementations which PimplT points to.
|
||||
/// implementations which Pimpl points to.
|
||||
//////////////////////////////////////////
|
||||
|
||||
template<class T>
|
||||
struct ImplT;
|
||||
struct ImplOf;
|
||||
|
||||
|
||||
//////////////////////////////////////////
|
||||
/// \class PImplT
|
||||
/// \class PImplOf
|
||||
///
|
||||
/// \ingroup PimplGroup
|
||||
/// Convenience template which uses ImplT
|
||||
/// \ingroup PimplGroup
|
||||
/// Convenience template which uses ImplOf
|
||||
/// as implementation structure
|
||||
//////////////////////////////////////////
|
||||
|
||||
|
||||
template<class T, template<class> class Ptr = ConstPropPtr>
|
||||
struct PimplT
|
||||
struct PimplOf
|
||||
{
|
||||
typedef T Impl;
|
||||
|
||||
// declare pimpl
|
||||
typedef Pimpl<ImplT<T>, Ptr<ImplT<T> > > Type;
|
||||
typedef Pimpl<ImplOf<T>, Ptr<ImplOf<T> > > Type;
|
||||
|
||||
// inherit pimpl
|
||||
typedef PimplOwner<ImplT<T>, Ptr<ImplT<T> > > Owner;
|
||||
typedef PimplOwner<ImplOf<T>, Ptr<ImplOf<T> > > Owner;
|
||||
};
|
||||
|
||||
|
||||
template<class T, class UsedPimpl = typename PimplT<T>::Type >
|
||||
struct RimplT
|
||||
template<class T, class UsedPimpl = typename PimplOf<T>::Type >
|
||||
struct RimplOf
|
||||
{
|
||||
typedef typename UsedPimpl::Impl & Type;
|
||||
|
||||
|
@ -196,6 +196,9 @@ namespace Loki
|
|||
#endif
|
||||
|
||||
// $Log$
|
||||
// Revision 1.22 2006/07/17 11:05:44 syntheticpp
|
||||
// ImplT/PimplT/RimplT renamed to the more readable version: T->Of
|
||||
//
|
||||
// Revision 1.21 2006/06/19 12:39:08 syntheticpp
|
||||
// replace tabs with 4 spaces
|
||||
//
|
||||
|
|
|
@ -28,15 +28,15 @@
|
|||
|
||||
|
||||
/////////////////////////////////////////
|
||||
// Definition of ImplT<A>
|
||||
// Definition of ImplOf<A>
|
||||
/////////////////////////////////////////
|
||||
namespace Loki // gcc!!
|
||||
{
|
||||
template<>
|
||||
struct ImplT<A> : public SmallObject<> // inherit SmallObj for speed up
|
||||
struct ImplOf<A> : public SmallObject<> // inherit SmallObj for speed up
|
||||
{
|
||||
ImplT() : data(0) {Printf("A created\n");}
|
||||
~ImplT(){Printf("A destroyed, data=%d\n")(data);}
|
||||
ImplOf() : data(0) {Printf("A created\n");}
|
||||
~ImplOf(){Printf("A destroyed, data=%d\n")(data);}
|
||||
int data;
|
||||
};
|
||||
}
|
||||
|
@ -54,22 +54,22 @@ void A::foo()
|
|||
|
||||
|
||||
/////////////////////////////////////////
|
||||
// Definition of ImplT<B>
|
||||
// Definition of ImplOf<B>
|
||||
/////////////////////////////////////////
|
||||
namespace Loki // gcc!!
|
||||
{
|
||||
template<>
|
||||
struct ImplT<B> : public SmallObject<> // inherit SmallObj for speed up
|
||||
struct ImplOf<B> : public SmallObject<> // inherit SmallObj for speed up
|
||||
{
|
||||
ImplT() : data(0) {Printf("B created\n");}
|
||||
~ImplT(){Printf("B destroyed, data=%d\n")(data);}
|
||||
ImplOf() : data(0) {Printf("B created\n");}
|
||||
~ImplOf(){Printf("B destroyed, data=%d\n")(data);}
|
||||
int data;
|
||||
};
|
||||
}
|
||||
/////////////////////////////////////////
|
||||
// class B definition
|
||||
/////////////////////////////////////////
|
||||
B::B() : Loki::PimplT<B>::Owner()
|
||||
B::B() : Loki::PimplOf<B>::Owner()
|
||||
{}
|
||||
|
||||
void B::foo()
|
||||
|
@ -80,15 +80,15 @@ void B::foo()
|
|||
|
||||
|
||||
/////////////////////////////////////////
|
||||
// Definition of ImplT<C>
|
||||
// Definition of ImplOf<C>
|
||||
/////////////////////////////////////////
|
||||
namespace Loki // gcc!!
|
||||
{
|
||||
template<>
|
||||
struct ImplT<C> : public SmallObject<> // inherit SmallObj for speed up
|
||||
struct ImplOf<C> : public SmallObject<> // inherit SmallObj for speed up
|
||||
{
|
||||
ImplT(): data(0) {Printf("C created\n");}
|
||||
~ImplT(){Printf("C destroyed, data=%d\n")(data);}
|
||||
ImplOf(): data(0) {Printf("C created\n");}
|
||||
~ImplOf(){Printf("C destroyed, data=%d\n")(data);}
|
||||
int data;
|
||||
};
|
||||
}
|
||||
|
@ -106,15 +106,15 @@ void C::foo()
|
|||
|
||||
|
||||
/////////////////////////////////////////
|
||||
// Definition of ImplT<D>
|
||||
// Definition of ImplOf<D>
|
||||
/////////////////////////////////////////
|
||||
namespace Loki // gcc!!
|
||||
{
|
||||
template<>
|
||||
struct ImplT<D> : public SmallObject<> // inherit SmallObj for speed up
|
||||
struct ImplOf<D> : public SmallObject<> // inherit SmallObj for speed up
|
||||
{
|
||||
ImplT(): data(0) {Printf("D created\n");}
|
||||
~ImplT(){Printf("D destroyed, data=%d\n")(data);}
|
||||
ImplOf(): data(0) {Printf("D created\n");}
|
||||
~ImplOf(){Printf("D destroyed, data=%d\n")(data);}
|
||||
int data;
|
||||
};
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ namespace Loki // gcc!!
|
|||
/////////////////////////////////////////
|
||||
// class D definition
|
||||
/////////////////////////////////////////
|
||||
D::D() : Loki::RimplT<D>::Owner()
|
||||
D::D() : Loki::RimplOf<D>::Owner()
|
||||
{}
|
||||
|
||||
void D::foo()
|
||||
|
@ -174,15 +174,15 @@ int main()
|
|||
//Incomplete4 i4; // compiler error
|
||||
|
||||
/////////////////////////////////////////
|
||||
// Definition of ImplT<E>
|
||||
// Definition of ImplOf<E>
|
||||
/////////////////////////////////////////
|
||||
namespace Loki // gcc!!
|
||||
{
|
||||
template<>
|
||||
struct ImplT<E> : public SmallObject<> // inherit SmallObj for speed up
|
||||
struct ImplOf<E> : public SmallObject<> // inherit SmallObj for speed up
|
||||
{
|
||||
ImplT() : data(0) {Printf("E created\n");}
|
||||
~ImplT(){Printf("E destroyed, data=%d\n")(data);}
|
||||
ImplOf() : data(0) {Printf("E created\n");}
|
||||
~ImplOf(){Printf("E destroyed, data=%d\n")(data);}
|
||||
int data;
|
||||
|
||||
void foo() {Printf("E foo() \n");}
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
void foo();
|
||||
|
||||
private:
|
||||
PimplT<A>::Type d;
|
||||
PimplOf<A>::Type d;
|
||||
};
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@ private:
|
|||
// class B declaration
|
||||
/////////////////////////////////////////
|
||||
|
||||
class B : private PimplT<B>::Owner
|
||||
class B : private PimplOf<B>::Owner
|
||||
{
|
||||
public:
|
||||
B();
|
||||
|
@ -63,8 +63,8 @@ public:
|
|||
void foo();
|
||||
|
||||
private:
|
||||
PimplT<C>::Type p;
|
||||
RimplT<C>::Type d;
|
||||
PimplOf<C>::Type p;
|
||||
RimplOf<C>::Type d;
|
||||
};
|
||||
|
||||
|
||||
|
@ -72,7 +72,7 @@ private:
|
|||
// class D declaration
|
||||
/////////////////////////////////////////
|
||||
|
||||
class D : private RimplT<D>::Owner
|
||||
class D : private RimplOf<D>::Owner
|
||||
{
|
||||
public:
|
||||
D();
|
||||
|
@ -88,12 +88,12 @@ public:
|
|||
|
||||
struct E;
|
||||
|
||||
typedef SmartPtr<ImplT<E> > LokiPtr;
|
||||
typedef ConstPropPtr<ImplT<E> > CPropPtr;
|
||||
typedef std::auto_ptr<ImplT<E> > StdAutoPtr;
|
||||
typedef SmartPtr<ImplOf<E> > LokiPtr;
|
||||
typedef ConstPropPtr<ImplOf<E> > CPropPtr;
|
||||
typedef std::auto_ptr<ImplOf<E> > StdAutoPtr;
|
||||
|
||||
#ifdef TEST_WITH_BOOST
|
||||
typedef boost::shared_ptr<ImplT<E> > BoostPtr;
|
||||
typedef boost::shared_ptr<ImplOf<E> > BoostPtr;
|
||||
#else
|
||||
typedef LokiPtr BoostPtr;
|
||||
#endif
|
||||
|
@ -102,11 +102,11 @@ typedef std::auto_ptr<ImplT<E> > StdAutoPtr;
|
|||
|
||||
// Pimpl
|
||||
|
||||
typedef Pimpl<ImplT<E> > Pimpl1;
|
||||
typedef Pimpl<ImplT<E>, CPropPtr> Pimpl2;
|
||||
typedef Pimpl<ImplT<E>, LokiPtr> Pimpl3;
|
||||
typedef Pimpl<ImplT<E>, BoostPtr> Pimpl4;
|
||||
typedef Pimpl<ImplT<E>, StdAutoPtr> Pimpl5;
|
||||
typedef Pimpl<ImplOf<E> > Pimpl1;
|
||||
typedef Pimpl<ImplOf<E>, CPropPtr> Pimpl2;
|
||||
typedef Pimpl<ImplOf<E>, LokiPtr> Pimpl3;
|
||||
typedef Pimpl<ImplOf<E>, BoostPtr> Pimpl4;
|
||||
typedef Pimpl<ImplOf<E>, StdAutoPtr> Pimpl5;
|
||||
|
||||
struct P1 {Pimpl1 d; P1();void f();void f()const;};
|
||||
struct P2 {Pimpl2 d; P2();void f();void f()const;};
|
||||
|
@ -117,11 +117,11 @@ struct P5 {Pimpl5 d; P5();void f();void f()const;};
|
|||
|
||||
// PimplOwner
|
||||
|
||||
typedef PimplOwner<ImplT<E> > PimplOwner1;
|
||||
typedef PimplOwner<ImplT<E>, CPropPtr> PimplOwner2;
|
||||
typedef PimplOwner<ImplT<E>, LokiPtr> PimplOwner3;
|
||||
typedef PimplOwner<ImplT<E>, BoostPtr> PimplOwner4;
|
||||
typedef PimplOwner<ImplT<E>, StdAutoPtr>PimplOwner5;
|
||||
typedef PimplOwner<ImplOf<E> > PimplOwner1;
|
||||
typedef PimplOwner<ImplOf<E>, CPropPtr> PimplOwner2;
|
||||
typedef PimplOwner<ImplOf<E>, LokiPtr> PimplOwner3;
|
||||
typedef PimplOwner<ImplOf<E>, BoostPtr> PimplOwner4;
|
||||
typedef PimplOwner<ImplOf<E>, StdAutoPtr> PimplOwner5;
|
||||
|
||||
struct PO1 : private PimplOwner1 {PO1();void f();void f()const;};
|
||||
struct PO2 : private PimplOwner2 {PO2();void f();void f()const;};
|
||||
|
@ -133,11 +133,11 @@ struct PO5 : private PimplOwner5 {PO5();void f();void f()const;};
|
|||
|
||||
// Rimpl
|
||||
|
||||
typedef RimplT<ImplT<E>,Pimpl1> Rimpl1;
|
||||
typedef RimplT<ImplT<E>,Pimpl2> Rimpl2;
|
||||
typedef RimplT<ImplT<E>,Pimpl3> Rimpl3;
|
||||
typedef RimplT<ImplT<E>,Pimpl4> Rimpl4;
|
||||
typedef RimplT<ImplT<E>,Pimpl5> Rimpl5;
|
||||
typedef RimplOf<E,Pimpl1> Rimpl1;
|
||||
typedef RimplOf<E,Pimpl2> Rimpl2;
|
||||
typedef RimplOf<E,Pimpl3> Rimpl3;
|
||||
typedef RimplOf<E,Pimpl4> Rimpl4;
|
||||
typedef RimplOf<E,Pimpl5> Rimpl5;
|
||||
|
||||
struct R1 {Pimpl1 p; Rimpl1::Type d; R1();void f();void f()const;};
|
||||
struct R2 {Pimpl2 p; Rimpl2::Type d; R2();void f();void f()const;};
|
||||
|
@ -148,11 +148,11 @@ struct R5 {Pimpl5 p; Rimpl5::Type d; R5();void f();void f()const;};
|
|||
|
||||
// RimplOwner
|
||||
|
||||
typedef RimplT<ImplT<E>,Pimpl1>::Owner RimplO1;
|
||||
typedef RimplT<ImplT<E>,Pimpl2>::Owner RimplO2;
|
||||
typedef RimplT<ImplT<E>,Pimpl3>::Owner RimplO3;
|
||||
typedef RimplT<ImplT<E>,Pimpl4>::Owner RimplO4;
|
||||
typedef RimplT<ImplT<E>,Pimpl5>::Owner RimplO5;
|
||||
typedef RimplOf<E,Pimpl1>::Owner RimplO1;
|
||||
typedef RimplOf<E,Pimpl2>::Owner RimplO2;
|
||||
typedef RimplOf<E,Pimpl3>::Owner RimplO3;
|
||||
typedef RimplOf<E,Pimpl4>::Owner RimplO4;
|
||||
typedef RimplOf<E,Pimpl5>::Owner RimplO5;
|
||||
|
||||
struct RO1 : private RimplO1 {RO1();void f();void f()const;};
|
||||
struct RO2 : private RimplO2 {RO2();void f();void f()const;};
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
void foo();
|
||||
|
||||
private:
|
||||
PimplT<A2>::Type d;
|
||||
PimplOf<A2>::Type d;
|
||||
};
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@ private:
|
|||
// class B2 declaration
|
||||
/////////////////////////////////////////
|
||||
|
||||
class B2 : private PimplT<B2>::Owner
|
||||
class B2 : private PimplOf<B2>::Owner
|
||||
{
|
||||
public:
|
||||
B2();
|
||||
|
@ -60,8 +60,8 @@ public:
|
|||
void foo();
|
||||
|
||||
private:
|
||||
PimplT<C2>::Type rint;
|
||||
RimplT<C2>::Type d;
|
||||
PimplOf<C2>::Type rint;
|
||||
RimplOf<C2>::Type d;
|
||||
};
|
||||
|
||||
|
||||
|
@ -69,7 +69,7 @@ private:
|
|||
// class D2 declaration
|
||||
/////////////////////////////////////////
|
||||
|
||||
class D2 : private RimplT<D2>::Owner
|
||||
class D2 : private RimplOf<D2>::Owner
|
||||
{
|
||||
public:
|
||||
D2();
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
Incomplete1();
|
||||
void foo();
|
||||
private:
|
||||
PimplT<Incomplete1>::Type d;
|
||||
PimplOf<Incomplete1>::Type d;
|
||||
};
|
||||
|
||||
class Incomplete2
|
||||
|
@ -97,7 +97,7 @@ public:
|
|||
~Incomplete2();
|
||||
void foo();
|
||||
private:
|
||||
PimplT<Incomplete2>::Type d;
|
||||
PimplOf<Incomplete2>::Type d;
|
||||
};
|
||||
|
||||
|
||||
|
@ -114,7 +114,7 @@ public:
|
|||
}
|
||||
void foo();
|
||||
private:
|
||||
PimplT<Incomplete3>::Type d;
|
||||
PimplOf<Incomplete3>::Type d;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue