make disabling the TYPELIST macros possible
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@333 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
ba524baf5a
commit
570f0ed652
15 changed files with 1252 additions and 375 deletions
|
@ -19,6 +19,7 @@
|
||||||
#define LOKI_ABSTRACTFACTORY_INC_
|
#define LOKI_ABSTRACTFACTORY_INC_
|
||||||
|
|
||||||
#include "Typelist.h"
|
#include "Typelist.h"
|
||||||
|
#include "Sequence.h"
|
||||||
#include "TypeManip.h"
|
#include "TypeManip.h"
|
||||||
#include "HierarchyGenerators.h"
|
#include "HierarchyGenerators.h"
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "Functor.h"
|
#include "Functor.h"
|
||||||
#include "AssocVector.h"
|
#include "AssocVector.h"
|
||||||
#include "SmallObj.h"
|
#include "SmallObj.h"
|
||||||
|
#include "Sequence.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
|
@ -129,6 +130,283 @@ namespace Loki
|
||||||
{
|
{
|
||||||
virtual AP* CreateObject(const Id & id ) = 0;
|
virtual AP* CreateObject(const Id & id ) = 0;
|
||||||
};
|
};
|
||||||
|
template <typename AP, typename Id, typename P1 >
|
||||||
|
struct FactoryImpl<AP,Id, Seq<P1> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1 ) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id, typename P1,typename P2 >
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2 ) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id, typename P1,typename P2,typename P3 >
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3 ) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id, typename P1,typename P2,typename P3,typename P4 >
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3, P4> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3, Parm4 ) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id,
|
||||||
|
typename P1,typename P2,typename P3,typename P4,typename P5 >
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3, P4, P5> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3, Parm4, Parm5 ) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id,
|
||||||
|
typename P1,typename P2,typename P3,typename P4,typename P5,
|
||||||
|
typename P6>
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3, P4, P5, P6> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3, Parm4, Parm5,
|
||||||
|
Parm6 )
|
||||||
|
= 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id,
|
||||||
|
typename P1,typename P2,typename P3,typename P4,typename P5,
|
||||||
|
typename P6,typename P7>
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3, P4, P5, P6, P7> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3, Parm4, Parm5,
|
||||||
|
Parm6, Parm7 )
|
||||||
|
= 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id,
|
||||||
|
typename P1,typename P2,typename P3,typename P4,typename P5,
|
||||||
|
typename P6,typename P7,typename P8>
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3, P4, P5, P6, P7, P8> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3, Parm4, Parm5,
|
||||||
|
Parm6, Parm7, Parm8)
|
||||||
|
= 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id,
|
||||||
|
typename P1,typename P2,typename P3,typename P4,typename P5,
|
||||||
|
typename P6,typename P7,typename P8,typename P9>
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3, Parm4, Parm5,
|
||||||
|
Parm6, Parm7, Parm8, Parm9)
|
||||||
|
= 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id,
|
||||||
|
typename P1,typename P2,typename P3,typename P4,typename P5,
|
||||||
|
typename P6,typename P7,typename P8,typename P9,typename P10>
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
typedef typename TypeTraits<P10>::ParameterType Parm10;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3, Parm4, Parm5,
|
||||||
|
Parm6, Parm7, Parm8, Parm9,Parm10)
|
||||||
|
= 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id,
|
||||||
|
typename P1,typename P2,typename P3,typename P4,typename P5,
|
||||||
|
typename P6,typename P7,typename P8,typename P9,typename P10,
|
||||||
|
typename P11>
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
typedef typename TypeTraits<P10>::ParameterType Parm10;
|
||||||
|
typedef typename TypeTraits<P11>::ParameterType Parm11;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3, Parm4, Parm5,
|
||||||
|
Parm6, Parm7, Parm8, Parm9,Parm10,
|
||||||
|
Parm11)
|
||||||
|
= 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id,
|
||||||
|
typename P1,typename P2,typename P3,typename P4,typename P5,
|
||||||
|
typename P6,typename P7,typename P8,typename P9,typename P10,
|
||||||
|
typename P11,typename P12>
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
typedef typename TypeTraits<P10>::ParameterType Parm10;
|
||||||
|
typedef typename TypeTraits<P11>::ParameterType Parm11;
|
||||||
|
typedef typename TypeTraits<P12>::ParameterType Parm12;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3, Parm4, Parm5,
|
||||||
|
Parm6, Parm7, Parm8, Parm9,Parm10,
|
||||||
|
Parm11,Parm12)
|
||||||
|
= 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id,
|
||||||
|
typename P1,typename P2,typename P3,typename P4,typename P5,
|
||||||
|
typename P6,typename P7,typename P8,typename P9,typename P10,
|
||||||
|
typename P11,typename P12,typename P13>
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
typedef typename TypeTraits<P10>::ParameterType Parm10;
|
||||||
|
typedef typename TypeTraits<P11>::ParameterType Parm11;
|
||||||
|
typedef typename TypeTraits<P12>::ParameterType Parm12;
|
||||||
|
typedef typename TypeTraits<P13>::ParameterType Parm13;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3, Parm4, Parm5,
|
||||||
|
Parm6, Parm7, Parm8, Parm9,Parm10,
|
||||||
|
Parm11,Parm12,Parm13)
|
||||||
|
= 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id,
|
||||||
|
typename P1,typename P2,typename P3,typename P4,typename P5,
|
||||||
|
typename P6,typename P7,typename P8,typename P9,typename P10,
|
||||||
|
typename P11,typename P12,typename P13,typename P14>
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
typedef typename TypeTraits<P10>::ParameterType Parm10;
|
||||||
|
typedef typename TypeTraits<P11>::ParameterType Parm11;
|
||||||
|
typedef typename TypeTraits<P12>::ParameterType Parm12;
|
||||||
|
typedef typename TypeTraits<P13>::ParameterType Parm13;
|
||||||
|
typedef typename TypeTraits<P14>::ParameterType Parm14;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3, Parm4, Parm5,
|
||||||
|
Parm6, Parm7, Parm8, Parm8,Parm10,
|
||||||
|
Parm11,Parm12,Parm13,Parm14)
|
||||||
|
= 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename AP, typename Id,
|
||||||
|
typename P1,typename P2,typename P3,typename P4,typename P5,
|
||||||
|
typename P6,typename P7,typename P8,typename P9,typename P10,
|
||||||
|
typename P11,typename P12,typename P13,typename P14,typename P15 >
|
||||||
|
struct FactoryImpl<AP, Id, Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15> >
|
||||||
|
: public FactoryImplBase
|
||||||
|
{
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
typedef typename TypeTraits<P10>::ParameterType Parm10;
|
||||||
|
typedef typename TypeTraits<P11>::ParameterType Parm11;
|
||||||
|
typedef typename TypeTraits<P12>::ParameterType Parm12;
|
||||||
|
typedef typename TypeTraits<P13>::ParameterType Parm13;
|
||||||
|
typedef typename TypeTraits<P14>::ParameterType Parm14;
|
||||||
|
typedef typename TypeTraits<P15>::ParameterType Parm15;
|
||||||
|
virtual AP* CreateObject(const Id& id,Parm1, Parm2, Parm3, Parm4, Parm5,
|
||||||
|
Parm6, Parm7, Parm8, Parm9,Parm10,
|
||||||
|
Parm11,Parm12,Parm13,Parm14,Parm15 )
|
||||||
|
= 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
template <typename AP, typename Id, typename P1 >
|
template <typename AP, typename Id, typename P1 >
|
||||||
struct FactoryImpl<AP,Id, LOKI_TYPELIST_1( P1 )>
|
struct FactoryImpl<AP,Id, LOKI_TYPELIST_1( P1 )>
|
||||||
|
@ -404,8 +682,9 @@ namespace Loki
|
||||||
Parm6, Parm7, Parm8, Parm9,Parm10,
|
Parm6, Parm7, Parm8, Parm9,Parm10,
|
||||||
Parm11,Parm12,Parm13,Parm14,Parm15 )
|
Parm11,Parm12,Parm13,Parm14,Parm15 )
|
||||||
= 0;
|
= 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif //LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -757,6 +1036,9 @@ namespace Loki
|
||||||
#endif // FACTORY_INC_
|
#endif // FACTORY_INC_
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.8 2005/10/30 13:49:44 syntheticpp
|
||||||
|
// make disabling the TYPELIST macros possible
|
||||||
|
//
|
||||||
// Revision 1.7 2005/10/05 09:57:37 syntheticpp
|
// Revision 1.7 2005/10/05 09:57:37 syntheticpp
|
||||||
// move unreachable code warnings
|
// move unreachable code warnings
|
||||||
//
|
//
|
||||||
|
|
|
@ -111,9 +111,9 @@ namespace Loki
|
||||||
|
|
||||||
template<class R,class P01>
|
template<class R,class P01>
|
||||||
struct Function<R(P01)>
|
struct Function<R(P01)>
|
||||||
: public Loki::Functor<R,typename Seq<P01>::Type>
|
: public Loki::Functor<R, Seq<P01> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01>::Type> FBase;
|
typedef Functor<R, Seq<P01> > FBase;
|
||||||
|
|
||||||
template<class R2,class Q01>
|
template<class R2,class Q01>
|
||||||
Function(Function<R2(Q01)> func)
|
Function(Function<R2(Q01)> func)
|
||||||
|
@ -124,9 +124,9 @@ namespace Loki
|
||||||
|
|
||||||
template<class R,class P01,class P02>
|
template<class R,class P01,class P02>
|
||||||
struct Function<R(P01,P02)>
|
struct Function<R(P01,P02)>
|
||||||
: public Functor<R,typename Seq<P01,P02>::Type>
|
: public Functor<R, Seq<P01,P02> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02>::Type> FBase;
|
typedef Functor<R, Seq<P01,P02> > FBase;
|
||||||
|
|
||||||
template<class R2,class Q01, class Q02>
|
template<class R2,class Q01, class Q02>
|
||||||
Function(Function<R2(Q01,Q02)> func)
|
Function(Function<R2(Q01,Q02)> func)
|
||||||
|
@ -137,9 +137,9 @@ namespace Loki
|
||||||
|
|
||||||
template<class R,class P01,class P02, class P03>
|
template<class R,class P01,class P02, class P03>
|
||||||
struct Function<R(P01,P02,P03)>
|
struct Function<R(P01,P02,P03)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03>::Type>
|
: public Functor<R, Seq<P01,P02,P03> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03>::Type> FBase;
|
typedef Functor<R, Seq<P01,P02,P03> > FBase;
|
||||||
|
|
||||||
template<class R2,class Q01, class Q02,class Q03>
|
template<class R2,class Q01, class Q02,class Q03>
|
||||||
Function(Function<R2(Q01,Q02,Q03)> func)
|
Function(Function<R2(Q01,Q02,Q03)> func)
|
||||||
|
@ -150,9 +150,9 @@ namespace Loki
|
||||||
|
|
||||||
template<class R,class P01,class P02, class P03,class P04>
|
template<class R,class P01,class P02, class P03,class P04>
|
||||||
struct Function<R(P01,P02,P03,P04)>
|
struct Function<R(P01,P02,P03,P04)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03,P04>::Type>
|
: public Functor<R, Seq<P01,P02,P03,P04> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03,P04>::Type> FBase;
|
typedef Functor<R, Seq<P01,P02,P03,P04> > FBase;
|
||||||
|
|
||||||
template<class R2,class Q01,class Q02, class Q03,class Q04>
|
template<class R2,class Q01,class Q02, class Q03,class Q04>
|
||||||
Function(Function<R2(Q01,Q02,Q03,Q04)> func)
|
Function(Function<R2(Q01,Q02,Q03,Q04)> func)
|
||||||
|
@ -163,9 +163,9 @@ namespace Loki
|
||||||
|
|
||||||
template<class R,class P01,class P02, class P03,class P04,class P05>
|
template<class R,class P01,class P02, class P03,class P04,class P05>
|
||||||
struct Function<R(P01,P02,P03,P04,P05)>
|
struct Function<R(P01,P02,P03,P04,P05)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03,P04,P05>::Type>
|
: public Functor<R, Seq<P01,P02,P03,P04,P05> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03,P04,P05>::Type> FBase;
|
typedef Functor<R, Seq<P01,P02,P03,P04,P05> > FBase;
|
||||||
|
|
||||||
template<class R2,class Q01,class Q02, class Q03,class Q04,class Q05>
|
template<class R2,class Q01,class Q02, class Q03,class Q04,class Q05>
|
||||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05)> func)
|
Function(Function<R2(Q01,Q02,Q03,Q04,Q05)> func)
|
||||||
|
@ -177,9 +177,9 @@ namespace Loki
|
||||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||||
class P06>
|
class P06>
|
||||||
struct Function<R(P01,P02,P03,P04,P05,P06)>
|
struct Function<R(P01,P02,P03,P04,P05,P06)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03,P04,P05,P06>::Type>
|
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03,P04,P05,P06>::Type> FBase;
|
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06> > FBase;
|
||||||
|
|
||||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||||
class Q06>
|
class Q06>
|
||||||
|
@ -192,9 +192,9 @@ namespace Loki
|
||||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||||
class P06,class P07>
|
class P06,class P07>
|
||||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07)>
|
struct Function<R(P01,P02,P03,P04,P05,P06,P07)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07>::Type>
|
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07>::Type> FBase;
|
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07> > FBase;
|
||||||
|
|
||||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||||
class Q06,class Q07>
|
class Q06,class Q07>
|
||||||
|
@ -207,9 +207,9 @@ namespace Loki
|
||||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||||
class P06,class P07, class P08>
|
class P06,class P07, class P08>
|
||||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08)>
|
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08>::Type>
|
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08>::Type> FBase;
|
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08> > FBase;
|
||||||
|
|
||||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||||
class Q06,class Q07, class Q08>
|
class Q06,class Q07, class Q08>
|
||||||
|
@ -222,9 +222,9 @@ namespace Loki
|
||||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||||
class P06,class P07, class P08,class P09>
|
class P06,class P07, class P08,class P09>
|
||||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09)>
|
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09>::Type>
|
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09 >::Type> FBase;
|
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09 > > FBase;
|
||||||
|
|
||||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||||
class Q06,class Q07, class Q08,class Q09>
|
class Q06,class Q07, class Q08,class Q09>
|
||||||
|
@ -237,9 +237,9 @@ namespace Loki
|
||||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||||
class P06,class P07, class P08,class P09,class P10>
|
class P06,class P07, class P08,class P09,class P10>
|
||||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10)>
|
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10>::Type>
|
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10>::Type> FBase;
|
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10> > FBase;
|
||||||
|
|
||||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||||
class Q06,class Q07, class Q08,class Q09,class Q10>
|
class Q06,class Q07, class Q08,class Q09,class Q10>
|
||||||
|
@ -253,9 +253,9 @@ namespace Loki
|
||||||
class P06,class P07, class P08,class P09,class P10,
|
class P06,class P07, class P08,class P09,class P10,
|
||||||
class P11>
|
class P11>
|
||||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11)>
|
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11>::Type>
|
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11>::Type>FBase;
|
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11> >FBase;
|
||||||
|
|
||||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||||
|
@ -270,9 +270,9 @@ namespace Loki
|
||||||
class P06,class P07, class P08,class P09,class P10,
|
class P06,class P07, class P08,class P09,class P10,
|
||||||
class P11,class P12>
|
class P11,class P12>
|
||||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12)>
|
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12>::Type>
|
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12>::Type> FBase;
|
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12> > FBase;
|
||||||
|
|
||||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||||
|
@ -287,9 +287,9 @@ namespace Loki
|
||||||
class P06,class P07, class P08,class P09,class P10,
|
class P06,class P07, class P08,class P09,class P10,
|
||||||
class P11,class P12, class P13>
|
class P11,class P12, class P13>
|
||||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13)>
|
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13>::Type>
|
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13>::Type> FBase;
|
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13> > FBase;
|
||||||
|
|
||||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||||
|
@ -304,9 +304,9 @@ namespace Loki
|
||||||
class P06,class P07, class P08,class P09,class P10,
|
class P06,class P07, class P08,class P09,class P10,
|
||||||
class P11,class P12, class P13,class P14>
|
class P11,class P12, class P13,class P14>
|
||||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14)>
|
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14>::Type>
|
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14>::Type> FBase;
|
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14> > FBase;
|
||||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||||
class Q11,class Q12, class Q13,class Q14>
|
class Q11,class Q12, class Q13,class Q14>
|
||||||
|
@ -320,9 +320,9 @@ namespace Loki
|
||||||
class P06,class P07, class P08,class P09,class P10,
|
class P06,class P07, class P08,class P09,class P10,
|
||||||
class P11,class P12, class P13,class P14,class P15>
|
class P11,class P12, class P13,class P14,class P15>
|
||||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14,P15)>
|
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14,P15)>
|
||||||
: public Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14,P15>::Type>
|
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14,P15> >
|
||||||
{
|
{
|
||||||
typedef Functor<R,typename Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14,P15>::Type> FBase;
|
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14,P15> > FBase;
|
||||||
|
|
||||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||||
|
|
|
@ -13,12 +13,13 @@
|
||||||
// without express or implied warranty.
|
// without express or implied warranty.
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Last update: June 20, 2001
|
// $Header:
|
||||||
|
|
||||||
#ifndef LOKI_FUNCTOR_INC_
|
#ifndef LOKI_FUNCTOR_INC_
|
||||||
#define LOKI_FUNCTOR_INC_
|
#define LOKI_FUNCTOR_INC_
|
||||||
|
|
||||||
#include "Typelist.h"
|
#include "Typelist.h"
|
||||||
|
#include "Sequence.h"
|
||||||
#include "EmptyType.h"
|
#include "EmptyType.h"
|
||||||
#include "SmallObj.h"
|
#include "SmallObj.h"
|
||||||
#include "TypeTraits.h"
|
#include "TypeTraits.h"
|
||||||
|
@ -104,6 +105,394 @@ namespace Loki
|
||||||
virtual R operator()() = 0;
|
virtual R operator()() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 1 parameter
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R, Seq<P1>, ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
virtual R operator()(Parm1) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 2 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R, Seq<P1, P2>, ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
virtual R operator()(Parm1, Parm2) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 3 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R, Seq<P1, P2, P3>, ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 4 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3, typename P4,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R, Seq<P1, P2, P3, P4>, ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3, Parm4) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 5 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3, typename P4,
|
||||||
|
typename P5,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R, Seq<P1, P2, P3, P4, P5>, ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3, Parm4, Parm5) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 6 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3, typename P4,
|
||||||
|
typename P5, typename P6,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R, Seq<P1, P2, P3, P4, P5, P6>, ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3, Parm4, Parm5, Parm6) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 7 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3, typename P4,
|
||||||
|
typename P5, typename P6, typename P7,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R, Seq<P1, P2, P3, P4, P5, P6, P7>, ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3, Parm4, Parm5, Parm6,
|
||||||
|
Parm7) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 8 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3, typename P4,
|
||||||
|
typename P5, typename P6, typename P7, typename P8,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R, Seq<P1, P2, P3, P4, P5, P6, P7, P8>,
|
||||||
|
ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3, Parm4, Parm5, Parm6,
|
||||||
|
Parm7, Parm8) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 9 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3, typename P4,
|
||||||
|
typename P5, typename P6, typename P7, typename P8, typename P9,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R, Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9>,
|
||||||
|
ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3, Parm4, Parm5, Parm6,
|
||||||
|
Parm7, Parm8, Parm9) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 10 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3, typename P4,
|
||||||
|
typename P5, typename P6, typename P7, typename P8, typename P9,
|
||||||
|
typename P10,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R, Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>,
|
||||||
|
ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
typedef typename TypeTraits<P10>::ParameterType Parm10;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3, Parm4, Parm5, Parm6,
|
||||||
|
Parm7, Parm8, Parm9, Parm10) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 11 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3, typename P4,
|
||||||
|
typename P5, typename P6, typename P7, typename P8, typename P9,
|
||||||
|
typename P10, typename P11,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R,
|
||||||
|
Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>,
|
||||||
|
ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
typedef typename TypeTraits<P10>::ParameterType Parm10;
|
||||||
|
typedef typename TypeTraits<P11>::ParameterType Parm11;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3, Parm4, Parm5, Parm6,
|
||||||
|
Parm7, Parm8, Parm9, Parm10, Parm11) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 12 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3, typename P4,
|
||||||
|
typename P5, typename P6, typename P7, typename P8, typename P9,
|
||||||
|
typename P10, typename P11, typename P12,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R,
|
||||||
|
Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>,
|
||||||
|
ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
typedef typename TypeTraits<P10>::ParameterType Parm10;
|
||||||
|
typedef typename TypeTraits<P11>::ParameterType Parm11;
|
||||||
|
typedef typename TypeTraits<P12>::ParameterType Parm12;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3, Parm4, Parm5, Parm6,
|
||||||
|
Parm7, Parm8, Parm9, Parm10, Parm11, Parm12) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 13 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3, typename P4,
|
||||||
|
typename P5, typename P6, typename P7, typename P8, typename P9,
|
||||||
|
typename P10, typename P11, typename P12, typename P13,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R,
|
||||||
|
Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13>,
|
||||||
|
ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
typedef typename TypeTraits<P10>::ParameterType Parm10;
|
||||||
|
typedef typename TypeTraits<P11>::ParameterType Parm11;
|
||||||
|
typedef typename TypeTraits<P12>::ParameterType Parm12;
|
||||||
|
typedef typename TypeTraits<P13>::ParameterType Parm13;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3, Parm4, Parm5, Parm6,
|
||||||
|
Parm7, Parm8, Parm9, Parm10, Parm11, Parm12, Parm13) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 14 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3, typename P4,
|
||||||
|
typename P5, typename P6, typename P7, typename P8, typename P9,
|
||||||
|
typename P10, typename P11, typename P12, typename P13, typename P14,
|
||||||
|
template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R,
|
||||||
|
Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13,
|
||||||
|
P14>,
|
||||||
|
ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
typedef typename TypeTraits<P10>::ParameterType Parm10;
|
||||||
|
typedef typename TypeTraits<P11>::ParameterType Parm11;
|
||||||
|
typedef typename TypeTraits<P12>::ParameterType Parm12;
|
||||||
|
typedef typename TypeTraits<P13>::ParameterType Parm13;
|
||||||
|
typedef typename TypeTraits<P14>::ParameterType Parm14;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3, Parm4, Parm5, Parm6,
|
||||||
|
Parm7, Parm8, Parm9, Parm10, Parm11, Parm12, Parm13, Parm14) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// class template FunctorImpl
|
||||||
|
// Specialization for 15 parameters
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template <typename R, typename P1, typename P2, typename P3, typename P4,
|
||||||
|
typename P5, typename P6, typename P7, typename P8, typename P9,
|
||||||
|
typename P10, typename P11, typename P12, typename P13, typename P14,
|
||||||
|
typename P15, template <class> class ThreadingModel>
|
||||||
|
class FunctorImpl<R,
|
||||||
|
Seq<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13,
|
||||||
|
P14, P15>,
|
||||||
|
ThreadingModel>
|
||||||
|
: public Private::FunctorImplBase<R, ThreadingModel>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef R ResultType;
|
||||||
|
typedef typename TypeTraits<P1>::ParameterType Parm1;
|
||||||
|
typedef typename TypeTraits<P2>::ParameterType Parm2;
|
||||||
|
typedef typename TypeTraits<P3>::ParameterType Parm3;
|
||||||
|
typedef typename TypeTraits<P4>::ParameterType Parm4;
|
||||||
|
typedef typename TypeTraits<P5>::ParameterType Parm5;
|
||||||
|
typedef typename TypeTraits<P6>::ParameterType Parm6;
|
||||||
|
typedef typename TypeTraits<P7>::ParameterType Parm7;
|
||||||
|
typedef typename TypeTraits<P8>::ParameterType Parm8;
|
||||||
|
typedef typename TypeTraits<P9>::ParameterType Parm9;
|
||||||
|
typedef typename TypeTraits<P10>::ParameterType Parm10;
|
||||||
|
typedef typename TypeTraits<P11>::ParameterType Parm11;
|
||||||
|
typedef typename TypeTraits<P12>::ParameterType Parm12;
|
||||||
|
typedef typename TypeTraits<P13>::ParameterType Parm13;
|
||||||
|
typedef typename TypeTraits<P14>::ParameterType Parm14;
|
||||||
|
typedef typename TypeTraits<P15>::ParameterType Parm15;
|
||||||
|
virtual R operator()(Parm1, Parm2, Parm3, Parm4, Parm5, Parm6,
|
||||||
|
Parm7, Parm8, Parm9, Parm10, Parm11, Parm12, Parm13, Parm14,
|
||||||
|
Parm15) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// class template FunctorImpl
|
// class template FunctorImpl
|
||||||
// Specialization for 1 parameter
|
// Specialization for 1 parameter
|
||||||
|
@ -490,6 +879,8 @@ namespace Loki
|
||||||
Parm15) = 0;
|
Parm15) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif //LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// class template FunctorHandler
|
// class template FunctorHandler
|
||||||
// Wraps functors and pointers to functions
|
// Wraps functors and pointers to functions
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "loki/Singleton.h"
|
#include "loki/Singleton.h"
|
||||||
#include "loki/Typelist.h"
|
#include "loki/Typelist.h"
|
||||||
|
#include "loki/Sequence.h"
|
||||||
|
|
||||||
namespace Loki
|
namespace Loki
|
||||||
{
|
{
|
||||||
|
@ -165,7 +165,7 @@ namespace Loki
|
||||||
};
|
};
|
||||||
|
|
||||||
template<unsigned int L, class T, typename P1>
|
template<unsigned int L, class T, typename P1>
|
||||||
class OrderedStatic<L, T, LOKI_TYPELIST_1(P1)> : public Private::OrderedStaticBase<T>
|
class OrderedStatic<L, T, Loki::Seq<P1> > : public Private::OrderedStaticBase<T>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OrderedStatic(P1 p) : Private::OrderedStaticBase<T>(L), para_(p)
|
OrderedStatic(P1 p) : Private::OrderedStaticBase<T>(L), para_(p)
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
#ifndef LOKI_SEQUENCE_INC_
|
#ifndef LOKI_SEQUENCE_INC_
|
||||||
#define LOKI_SEQUENCE_INC_
|
#define LOKI_SEQUENCE_INC_
|
||||||
|
|
||||||
|
#include "Typelist.h"
|
||||||
|
|
||||||
namespace Loki
|
namespace Loki
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define LOKI_TYPETRAITS_INC_
|
#define LOKI_TYPETRAITS_INC_
|
||||||
|
|
||||||
#include "Typelist.h"
|
#include "Typelist.h"
|
||||||
|
#include "Sequence.h"
|
||||||
|
|
||||||
namespace Loki
|
namespace Loki
|
||||||
{
|
{
|
||||||
|
@ -64,6 +65,7 @@ namespace Loki
|
||||||
|
|
||||||
namespace Private
|
namespace Private
|
||||||
{
|
{
|
||||||
|
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
typedef LOKI_TYPELIST_4(unsigned char, unsigned short int,unsigned int, unsigned long int)
|
typedef LOKI_TYPELIST_4(unsigned char, unsigned short int,unsigned int, unsigned long int)
|
||||||
StdUnsignedInts;
|
StdUnsignedInts;
|
||||||
typedef LOKI_TYPELIST_4(signed char, short int,int, long int)
|
typedef LOKI_TYPELIST_4(signed char, short int,int, long int)
|
||||||
|
@ -72,7 +74,17 @@ namespace Loki
|
||||||
StdOtherInts;
|
StdOtherInts;
|
||||||
typedef LOKI_TYPELIST_3(float, double, long double)
|
typedef LOKI_TYPELIST_3(float, double, long double)
|
||||||
StdFloats;
|
StdFloats;
|
||||||
|
#else
|
||||||
|
typedef Loki::Seq<unsigned char, unsigned short int,unsigned int, unsigned long int>::Type
|
||||||
|
StdUnsignedInts;
|
||||||
|
typedef Loki::Seq<signed char, short int,int, long int>::Type
|
||||||
|
StdSignedInts;
|
||||||
|
typedef Loki::Seq<bool, char, wchar_t>::Type
|
||||||
|
StdOtherInts;
|
||||||
|
typedef Loki::Seq<float, double, long double>::Type
|
||||||
|
StdFloats;
|
||||||
|
|
||||||
|
#endif
|
||||||
template <typename U> struct AddPointer
|
template <typename U> struct AddPointer
|
||||||
{
|
{
|
||||||
typedef U* Result;
|
typedef U* Result;
|
||||||
|
|
|
@ -21,332 +21,8 @@
|
||||||
|
|
||||||
#include "NullType.h"
|
#include "NullType.h"
|
||||||
#include "TypeManip.h"
|
#include "TypeManip.h"
|
||||||
|
#include "TypelistMacros.h"
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// macros LOKI_TYPELIST_1, LOKI_TYPELIST_2, ... LOKI_TYPELIST_50
|
|
||||||
// Each takes a number of arguments equal to its numeric suffix
|
|
||||||
// The arguments are type names. LOKI_TYPELIST_NN generates a typelist containing
|
|
||||||
// all types passed as arguments, in that order.
|
|
||||||
// Example: LOKI_TYPELIST_2(char, int) generates a type containing char and int.
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_1(T1) ::Loki::Typelist<T1, ::Loki::NullType>
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_2(T1, T2) ::Loki::Typelist<T1, LOKI_TYPELIST_1(T2) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_3(T1, T2, T3) ::Loki::Typelist<T1, LOKI_TYPELIST_2(T2, T3) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_4(T1, T2, T3, T4) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_3(T2, T3, T4) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_5(T1, T2, T3, T4, T5) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_4(T2, T3, T4, T5) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_6(T1, T2, T3, T4, T5, T6) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_5(T2, T3, T4, T5, T6) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_7(T1, T2, T3, T4, T5, T6, T7) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_6(T2, T3, T4, T5, T6, T7) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_8(T1, T2, T3, T4, T5, T6, T7, T8) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_7(T2, T3, T4, T5, T6, T7, T8) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_9(T1, T2, T3, T4, T5, T6, T7, T8, T9) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_8(T2, T3, T4, T5, T6, T7, T8, T9) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_10(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_9(T2, T3, T4, T5, T6, T7, T8, T9, T10) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_11(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_10(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_12(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_11(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_13(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_12(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_14(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_13(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_15(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_14(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_16(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_15(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_17(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_16(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_18(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_17(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_19(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_18(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_20(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_19(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_21(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_20(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_22(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_21(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_23(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_22(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_24(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_23(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_25(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_24(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_26(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_25(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_27(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_26(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_28(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_27(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_29(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_28(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_30(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_29(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_31(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_30(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_32(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_31(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_33(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_32(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_34(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_33(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_35(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_34(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_36(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_35(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_37(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_36(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_38(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_37(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_39(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_38(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_40(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_39(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_41(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_40(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_42(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_41(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_43(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_42(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_44(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_43(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_45(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
|
||||||
T41, T42, T43, T44, T45) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_44(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
|
||||||
T41, T42, T43, T44, T45) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_46(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
|
||||||
T41, T42, T43, T44, T45, T46) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_45(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
|
||||||
T41, T42, T43, T44, T45, T46) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_47(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
|
||||||
T41, T42, T43, T44, T45, T46, T47) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_46(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
|
||||||
T41, T42, T43, T44, T45, T46, T47) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_48(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
|
||||||
T41, T42, T43, T44, T45, T46, T47, T48) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_47(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
|
||||||
T41, T42, T43, T44, T45, T46, T47, T48) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_49(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
|
||||||
T41, T42, T43, T44, T45, T46, T47, T48, T49) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_48(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
|
||||||
T41, T42, T43, T44, T45, T46, T47, T48, T49) >
|
|
||||||
|
|
||||||
#define LOKI_TYPELIST_50(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
|
||||||
T41, T42, T43, T44, T45, T46, T47, T48, T49, T50) \
|
|
||||||
::Loki::Typelist<T1, LOKI_TYPELIST_49(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
|
||||||
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
|
||||||
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
|
||||||
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
|
||||||
T41, T42, T43, T44, T45, T46, T47, T48, T49, T50) >
|
|
||||||
|
|
||||||
namespace Loki
|
namespace Loki
|
||||||
{
|
{
|
||||||
|
@ -535,9 +211,9 @@ namespace Loki
|
||||||
typedef NullType Result;
|
typedef NullType Result;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T> struct Append<NullType, T>
|
template <class T> struct Append<NullType, T>
|
||||||
{
|
{
|
||||||
typedef LOKI_TYPELIST_1(T) Result;
|
typedef Typelist<T,NullType> Result;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class Head, class Tail>
|
template <class Head, class Tail>
|
||||||
|
|
373
include/loki/TypelistMacros.h
Executable file
373
include/loki/TypelistMacros.h
Executable file
|
@ -0,0 +1,373 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// The Loki Library
|
||||||
|
// Copyright (c) 2001 by Andrei Alexandrescu
|
||||||
|
// This code accompanies the book:
|
||||||
|
// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
|
||||||
|
// Patterns Applied". Copyright (c) 2001. Addison-Wesley.
|
||||||
|
// Permission to use, copy, modify, distribute and sell this software for any
|
||||||
|
// purpose is hereby granted without fee, provided that the above copyright
|
||||||
|
// notice appear in all copies and that both that copyright notice and this
|
||||||
|
// permission notice appear in supporting documentation.
|
||||||
|
// The author or Addison-Welsey Longman make no representations about the
|
||||||
|
// suitability of this software for any purpose. It is provided "as is"
|
||||||
|
// without express or implied warranty.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//Reference
|
||||||
|
|
||||||
|
#ifndef LOKI_TYPELISTMACROS_INC_
|
||||||
|
#define LOKI_TYPELISTMACROS_INC_
|
||||||
|
|
||||||
|
//#define LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
|
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// macros LOKI_TYPELIST_1, LOKI_TYPELIST_2, ... LOKI_TYPELIST_50
|
||||||
|
// Each takes a number of arguments equal to its numeric suffix
|
||||||
|
// The arguments are type names. LOKI_TYPELIST_NN generates a typelist containing
|
||||||
|
// all types passed as arguments, in that order.
|
||||||
|
// Example: LOKI_TYPELIST_2(char, int) generates a type containing char and int.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_1(T1) ::Loki::Typelist<T1, ::Loki::NullType>
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_2(T1, T2) ::Loki::Typelist<T1, LOKI_TYPELIST_1(T2) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_3(T1, T2, T3) ::Loki::Typelist<T1, LOKI_TYPELIST_2(T2, T3) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_4(T1, T2, T3, T4) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_3(T2, T3, T4) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_5(T1, T2, T3, T4, T5) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_4(T2, T3, T4, T5) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_6(T1, T2, T3, T4, T5, T6) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_5(T2, T3, T4, T5, T6) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_7(T1, T2, T3, T4, T5, T6, T7) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_6(T2, T3, T4, T5, T6, T7) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_8(T1, T2, T3, T4, T5, T6, T7, T8) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_7(T2, T3, T4, T5, T6, T7, T8) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_9(T1, T2, T3, T4, T5, T6, T7, T8, T9) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_8(T2, T3, T4, T5, T6, T7, T8, T9) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_10(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_9(T2, T3, T4, T5, T6, T7, T8, T9, T10) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_11(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_10(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_12(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_11(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_13(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_12(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_14(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_13(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_15(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_14(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_16(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_15(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_17(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_16(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_18(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_17(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_19(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_18(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_20(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_19(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_21(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_20(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_22(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_21(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_23(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_22(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_24(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_23(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_25(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_24(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_26(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_25(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_27(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_26(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_28(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_27(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_29(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_28(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_30(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_29(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_31(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_30(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_32(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_31(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_33(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_32(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_34(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_33(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_35(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_34(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_36(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_35(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_37(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_36(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_38(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_37(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_39(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_38(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_40(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_39(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_41(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_40(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_42(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_41(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_43(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_42(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_44(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_43(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_45(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
||||||
|
T41, T42, T43, T44, T45) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_44(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
||||||
|
T41, T42, T43, T44, T45) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_46(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
||||||
|
T41, T42, T43, T44, T45, T46) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_45(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
||||||
|
T41, T42, T43, T44, T45, T46) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_47(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
||||||
|
T41, T42, T43, T44, T45, T46, T47) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_46(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
||||||
|
T41, T42, T43, T44, T45, T46, T47) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_48(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
||||||
|
T41, T42, T43, T44, T45, T46, T47, T48) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_47(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
||||||
|
T41, T42, T43, T44, T45, T46, T47, T48) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_49(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
||||||
|
T41, T42, T43, T44, T45, T46, T47, T48, T49) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_48(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
||||||
|
T41, T42, T43, T44, T45, T46, T47, T48, T49) >
|
||||||
|
|
||||||
|
#define LOKI_TYPELIST_50(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
||||||
|
T41, T42, T43, T44, T45, T46, T47, T48, T49, T50) \
|
||||||
|
::Loki::Typelist<T1, LOKI_TYPELIST_49(T2, T3, T4, T5, T6, T7, T8, T9, T10, \
|
||||||
|
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, \
|
||||||
|
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, \
|
||||||
|
T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, \
|
||||||
|
T41, T42, T43, T44, T45, T46, T47, T48, T49, T50) >
|
||||||
|
|
||||||
|
#endif //LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Change log:
|
||||||
|
// June 09, 2001: Fix bug in parameter list of macros LOKI_TYPELIST_23 to LOKI_TYPELIST_27
|
||||||
|
// (credit due to Dave Taylor)
|
||||||
|
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
|
||||||
|
// November 22, 2001: fixed bug in DerivedToFront
|
||||||
|
// (credit due to Gianni Luciani who noticed the bug first;
|
||||||
|
// Adam Wilkshire;
|
||||||
|
// Friedrik Hedman who fixed the bug but didn't send the fix;
|
||||||
|
// Kevin Cline who sent the first actual fix)
|
||||||
|
// May 13, 2002: LOKI_TYPELIST_46 called LOKI_TYPELIST_45 with only 44 parameters.
|
||||||
|
// Credit due to Robert Minsk
|
||||||
|
// September 16, 2002: Changed MostDerived to use the new SuperSubclass template
|
||||||
|
// (rather than the SUPERSUBCLASS macro).
|
||||||
|
// Minor fix in Reverse, adding support for empty lists, like all the other
|
||||||
|
// algorithms.
|
||||||
|
// Fixed DerivedToFront, to use Replace, rather than ReplaceAll. T.S.
|
||||||
|
// Oct 10, 2002: added MakeTypelist (SGB/MKH)
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#endif // LOKI_TYPELISTMACROS_INC_
|
|
@ -16,6 +16,11 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "loki/Factory.h"
|
#include "loki/Factory.h"
|
||||||
#include "loki/Functor.h"
|
#include "loki/Functor.h"
|
||||||
|
|
||||||
|
#ifdef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
#define USE_WQUENCE
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_SEQUENCE
|
#ifdef USE_SEQUENCE
|
||||||
#include "loki/Sequence.h"
|
#include "loki/Sequence.h"
|
||||||
using Loki::Seq;
|
using Loki::Seq;
|
||||||
|
@ -61,7 +66,7 @@ typedef SingletonHolder
|
||||||
#ifndef USE_SEQUENCE
|
#ifndef USE_SEQUENCE
|
||||||
Factory< AbstractProduct, int, LOKI_TYPELIST_2( int, int ) >
|
Factory< AbstractProduct, int, LOKI_TYPELIST_2( int, int ) >
|
||||||
#else
|
#else
|
||||||
Factory< AbstractProduct, int, Seq< int, int >::Type >
|
Factory< AbstractProduct, int, Seq< int, int > >
|
||||||
#endif
|
#endif
|
||||||
>
|
>
|
||||||
PFactory;
|
PFactory;
|
||||||
|
@ -149,7 +154,7 @@ public:
|
||||||
#ifndef USE_SEQUENCE
|
#ifndef USE_SEQUENCE
|
||||||
typedef Functor<Product*,LOKI_TYPELIST_2(int,int)> CreateFunctor;
|
typedef Functor<Product*,LOKI_TYPELIST_2(int,int)> CreateFunctor;
|
||||||
#else
|
#else
|
||||||
typedef Functor<Product*,Seq<int,int>::Type> CreateFunctor;
|
typedef Functor<Product*,Seq<int,int> > CreateFunctor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
@ -158,7 +163,7 @@ SingletonHolder
|
||||||
#ifndef USE_SEQUENCE
|
#ifndef USE_SEQUENCE
|
||||||
Factory< AbstractProduct, int,LOKI_TYPELIST_3(CreateFunctor,int,int) >
|
Factory< AbstractProduct, int,LOKI_TYPELIST_3(CreateFunctor,int,int) >
|
||||||
#else
|
#else
|
||||||
Factory< AbstractProduct, int,Seq<CreateFunctor,int,int>::Type >
|
Factory< AbstractProduct, int,Seq<CreateFunctor,int,int> >
|
||||||
#endif
|
#endif
|
||||||
>
|
>
|
||||||
PFactoryFunctorParm;
|
PFactoryFunctorParm;
|
||||||
|
@ -244,6 +249,9 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.4 2005/10/30 13:49:44 syntheticpp
|
||||||
|
// make disabling the TYPELIST macros possible
|
||||||
|
//
|
||||||
// Revision 1.3 2005/10/06 17:50:14 syntheticpp
|
// Revision 1.3 2005/10/06 17:50:14 syntheticpp
|
||||||
// adding template based list/sequence implementation, should replace LOKI_TYPELIST_, update some files
|
// adding template based list/sequence implementation, should replace LOKI_TYPELIST_, update some files
|
||||||
//
|
//
|
||||||
|
|
|
@ -73,9 +73,9 @@ Loki::OrderedStatic<1,L1> l1;
|
||||||
Loki::OrderedStatic<2,L2> l2;
|
Loki::OrderedStatic<2,L2> l2;
|
||||||
|
|
||||||
Loki::OrderedStatic<1, std::string, std::string(*)() > s1( &func );
|
Loki::OrderedStatic<1, std::string, std::string(*)() > s1( &func );
|
||||||
Loki::OrderedStatic<2, std::string, LOKI_TYPELIST_1(char *) > s2( "s2" );
|
Loki::OrderedStatic<2, std::string, Loki::Seq<char *> > s2( "s2" );
|
||||||
|
|
||||||
Loki::OrderedStatic<1, Loki::Functor<int>, LOKI_TYPELIST_1( int(*)() ) > f1(f);
|
Loki::OrderedStatic<1, Loki::Functor<int>, Loki::Seq<int(*)()> > f1(f);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,8 @@ class BadSoldier : public Soldier {};
|
||||||
class BadMonster : public Monster {};
|
class BadMonster : public Monster {};
|
||||||
class BadSuperMonster : public SuperMonster {};
|
class BadSuperMonster : public SuperMonster {};
|
||||||
|
|
||||||
|
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
typedef Loki::AbstractFactory<LOKI_TYPELIST_3(Soldier, Monster, SuperMonster)> AbstractEnemyFactory;
|
typedef Loki::AbstractFactory<LOKI_TYPELIST_3(Soldier, Monster, SuperMonster)> AbstractEnemyFactory;
|
||||||
|
|
||||||
typedef Loki::ConcreteFactory<AbstractEnemyFactory, Loki::OpNewFactoryUnit,
|
typedef Loki::ConcreteFactory<AbstractEnemyFactory, Loki::OpNewFactoryUnit,
|
||||||
|
@ -43,6 +45,18 @@ typedef Loki::ConcreteFactory<AbstractEnemyFactory, Loki::OpNewFactoryUnit,
|
||||||
typedef Loki::ConcreteFactory<AbstractEnemyFactory, Loki::OpNewFactoryUnit,
|
typedef Loki::ConcreteFactory<AbstractEnemyFactory, Loki::OpNewFactoryUnit,
|
||||||
LOKI_TYPELIST_3(BadSoldier, BadMonster, BadSuperMonster)> HardLevelEnemyFactory;
|
LOKI_TYPELIST_3(BadSoldier, BadMonster, BadSuperMonster)> HardLevelEnemyFactory;
|
||||||
|
|
||||||
|
#else // LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
|
typedef Loki::AbstractFactory<Seq<Soldier, Monster, SuperMonster>::Type > AbstractEnemyFactory;
|
||||||
|
|
||||||
|
typedef Loki::ConcreteFactory<AbstractEnemyFactory, Loki::OpNewFactoryUnit,
|
||||||
|
Seq<SillySoldier, SillyMonster, SillySuperMonster>::Type > EasyLevelEnemyFactory;
|
||||||
|
|
||||||
|
typedef Loki::ConcreteFactory<AbstractEnemyFactory, Loki::OpNewFactoryUnit,
|
||||||
|
Seq<BadSoldier, BadMonster, BadSuperMonster>::Type > HardLevelEnemyFactory;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
class AbstractFactoryTest : public Test
|
class AbstractFactoryTest : public Test
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -37,12 +37,23 @@ public:
|
||||||
TestFunctor testFunctor;
|
TestFunctor testFunctor;
|
||||||
TestClass testClass;
|
TestClass testClass;
|
||||||
|
|
||||||
Functor<void,LOKI_TYPELIST_1(bool &)> function(testFunction);
|
|
||||||
|
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
Functor<void,LOKI_TYPELIST_1(bool &)> function(testFunction);
|
||||||
Functor<void,LOKI_TYPELIST_1(bool &)> functor(testFunctor);
|
Functor<void,LOKI_TYPELIST_1(bool &)> functor(testFunctor);
|
||||||
Functor<void,LOKI_TYPELIST_1(bool &)> classFunctor(&testClass,&TestClass::member);
|
Functor<void,LOKI_TYPELIST_1(bool &)> classFunctor(&testClass,&TestClass::member);
|
||||||
Functor<void,LOKI_TYPELIST_1(bool &)> functorCopy(function);
|
Functor<void,LOKI_TYPELIST_1(bool &)> functorCopy(function);
|
||||||
Functor<void,NullType> bindFunctor(BindFirst(function,testResult));
|
Functor<void,NullType> bindFunctor(BindFirst(function,testResult));
|
||||||
Functor<void> chainFunctor(Chain(bindFunctor,bindFunctor));
|
Functor<void> chainFunctor(Chain(bindFunctor,bindFunctor));
|
||||||
|
#else
|
||||||
|
Functor<void,Seq<bool &> > function(testFunction);
|
||||||
|
Functor<void,Seq<bool &> > functor(testFunctor);
|
||||||
|
Functor<void,Seq<bool &> > classFunctor(&testClass,&TestClass::member);
|
||||||
|
Functor<void,Seq<bool &> > functorCopy(function);
|
||||||
|
//TODO:
|
||||||
|
//Functor<void,NullType> bindFunctor(BindFirst(function,testResult));
|
||||||
|
//Functor<void> chainFunctor(Chain(bindFunctor,bindFunctor));
|
||||||
|
#endif
|
||||||
|
|
||||||
testResult=false;
|
testResult=false;
|
||||||
function(testResult);
|
function(testResult);
|
||||||
|
@ -60,6 +71,7 @@ public:
|
||||||
functorCopy(testResult);
|
functorCopy(testResult);
|
||||||
bool functorCopyResult=testResult;
|
bool functorCopyResult=testResult;
|
||||||
|
|
||||||
|
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
testResult=false;
|
testResult=false;
|
||||||
bindFunctor();
|
bindFunctor();
|
||||||
bool bindFunctorResult=testResult;
|
bool bindFunctorResult=testResult;
|
||||||
|
@ -70,6 +82,10 @@ public:
|
||||||
|
|
||||||
r=functionResult && functorResult && classFunctorResult && functorCopyResult && bindFunctorResult &&
|
r=functionResult && functorResult && classFunctorResult && functorCopyResult && bindFunctorResult &&
|
||||||
chainFunctorResult;
|
chainFunctorResult;
|
||||||
|
#else
|
||||||
|
//TODO!
|
||||||
|
r=functionResult && functorResult && classFunctorResult && functorCopyResult;
|
||||||
|
#endif
|
||||||
|
|
||||||
testAssert("Functor",r,result);
|
testAssert("Functor",r,result);
|
||||||
|
|
||||||
|
|
|
@ -41,22 +41,22 @@ Test::tests_type Test::tests;
|
||||||
// is the header inclusion to execute the correspond
|
// is the header inclusion to execute the correspond
|
||||||
// unit test.
|
// unit test.
|
||||||
|
|
||||||
|
#include "SmallObjectTest.h"
|
||||||
|
#include "SingletonTest.h"
|
||||||
|
|
||||||
#include "ThreadsTest.h"
|
#include "ThreadsTest.h"
|
||||||
#include "TypelistTest.h"
|
#include "TypelistTest.h"
|
||||||
#include "SequenceTest.h"
|
#include "SequenceTest.h"
|
||||||
#include "TypeManipTest.h"
|
#include "TypeManipTest.h"
|
||||||
#include "TypeTraitsTest.h"
|
#include "TypeTraitsTest.h"
|
||||||
#include "TypeTraitsTest2.h"
|
#include "TypeTraitsTest2.h"
|
||||||
#include "SmallObjectTest.h"
|
|
||||||
#include "SingletonTest.h"
|
|
||||||
#include "SmartPtrTest.h"
|
#include "SmartPtrTest.h"
|
||||||
#include "FactoryTest.h"
|
#include "FactoryTest.h"
|
||||||
#include "FactoryParmTest.h"
|
#include "FactoryParmTest.h"
|
||||||
#include "AbstractFactoryTest.h"
|
#include "AbstractFactoryTest.h"
|
||||||
#include "AssocVectorTest.h"
|
|
||||||
#include "FunctorTest.h"
|
#include "FunctorTest.h"
|
||||||
#include "DataGeneratorsTest.h"
|
#include "DataGeneratorsTest.h"
|
||||||
|
//#include "AssocVectorTest.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -117,6 +117,9 @@ int main()
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.11 2005/10/30 13:49:44 syntheticpp
|
||||||
|
// make disabling the TYPELIST macros possible
|
||||||
|
//
|
||||||
// Revision 1.10 2005/10/24 20:51:38 syntheticpp
|
// Revision 1.10 2005/10/24 20:51:38 syntheticpp
|
||||||
// Table is out of date
|
// Table is out of date
|
||||||
//
|
//
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#define TYPELISTTEST_H
|
#define TYPELISTTEST_H
|
||||||
|
|
||||||
#include <loki/Typelist.h>
|
#include <loki/Typelist.h>
|
||||||
|
#include <loki/Sequence.h>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// TypelistTest
|
// TypelistTest
|
||||||
|
@ -33,13 +34,23 @@ public:
|
||||||
using namespace Loki;
|
using namespace Loki;
|
||||||
using namespace Loki::TL;
|
using namespace Loki::TL;
|
||||||
|
|
||||||
typedef LOKI_TYPELIST_1(char) CharList;
|
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
typedef LOKI_TYPELIST_1(char) CharList;
|
||||||
typedef LOKI_TYPELIST_3(char,int,double) CharIntDoubleList;
|
typedef LOKI_TYPELIST_3(char,int,double) CharIntDoubleList;
|
||||||
typedef LOKI_TYPELIST_4(char,int,double,char) CharIntDoubleCharList;
|
typedef LOKI_TYPELIST_4(char,int,double,char) CharIntDoubleCharList;
|
||||||
typedef LOKI_TYPELIST_3(Base,Derived1,Derived2) BaseDerived1Derived2List;
|
typedef LOKI_TYPELIST_3(Base,Derived1,Derived2) BaseDerived1Derived2List;
|
||||||
typedef LOKI_TYPELIST_3(Derived2,Derived1,Base) Derived2Derived1BaseList;
|
typedef LOKI_TYPELIST_3(Derived2,Derived1,Base) Derived2Derived1BaseList;
|
||||||
typedef LOKI_TYPELIST_4(Base,Derived1,Base,Derived2) BaseDerived1BaseDerived2List;
|
typedef LOKI_TYPELIST_4(Base,Derived1,Base,Derived2) BaseDerived1BaseDerived2List;
|
||||||
typedef LOKI_TYPELIST_4(Derived1,Base,Derived1,Derived2) Derived1BaseDerived1Derived2List;
|
typedef LOKI_TYPELIST_4(Derived1,Base,Derived1,Derived2) Derived1BaseDerived1Derived2List;
|
||||||
|
#else
|
||||||
|
typedef Seq<char>::Type CharList;
|
||||||
|
typedef Seq<char,int,double>::Type CharIntDoubleList;
|
||||||
|
typedef Seq<char,int,double,char>::Type CharIntDoubleCharList;
|
||||||
|
typedef Seq<Base,Derived1,Derived2>::Type BaseDerived1Derived2List;
|
||||||
|
typedef Seq<Derived2,Derived1,Base>::Type Derived2Derived1BaseList;
|
||||||
|
typedef Seq<Base,Derived1,Base,Derived2>::Type BaseDerived1BaseDerived2List;
|
||||||
|
typedef Seq<Derived1,Base,Derived1,Derived2>::Type Derived1BaseDerived1Derived2List;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool r;
|
bool r;
|
||||||
|
|
||||||
|
@ -84,6 +95,8 @@ public:
|
||||||
// Append, Erase, EraseAll, NoDuplicates, Replace, ReplaceAll, Reverse,
|
// Append, Erase, EraseAll, NoDuplicates, Replace, ReplaceAll, Reverse,
|
||||||
// MostDerived and DerivedToFront doesn't work on MSVC 6.0
|
// MostDerived and DerivedToFront doesn't work on MSVC 6.0
|
||||||
|
|
||||||
|
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
r=SameType<Append<NullType,NullType>::Result,NullType>::value &&
|
r=SameType<Append<NullType,NullType>::Result,NullType>::value &&
|
||||||
SameType<Append<NullType,char>::Result,LOKI_TYPELIST_1(char)>::value &&
|
SameType<Append<NullType,char>::Result,LOKI_TYPELIST_1(char)>::value &&
|
||||||
SameType<Append<NullType,CharList>::Result,CharList>::value &&
|
SameType<Append<NullType,CharList>::Result,CharList>::value &&
|
||||||
|
@ -162,7 +175,93 @@ public:
|
||||||
SameType<DerivedToFront<BaseDerived1BaseDerived2List>::Result,LOKI_TYPELIST_4(Derived2,Derived1,Base,Base)>::value &&
|
SameType<DerivedToFront<BaseDerived1BaseDerived2List>::Result,LOKI_TYPELIST_4(Derived2,Derived1,Base,Base)>::value &&
|
||||||
SameType<DerivedToFront<Derived1BaseDerived1Derived2List>::Result,LOKI_TYPELIST_4(Derived2,Derived1,Derived1,Base)>::value;
|
SameType<DerivedToFront<Derived1BaseDerived1Derived2List>::Result,LOKI_TYPELIST_4(Derived2,Derived1,Derived1,Base)>::value;
|
||||||
|
|
||||||
testAssert("DerivedToFront",r,result);
|
testAssert("DerivedToFront",r,result);
|
||||||
|
|
||||||
|
#else //LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
|
r=SameType<Append<NullType,NullType>::Result,NullType>::value &&
|
||||||
|
SameType<Append<NullType,char>::Result,Seq<char>::Type >::value &&
|
||||||
|
SameType<Append<NullType,CharList>::Result,CharList>::value &&
|
||||||
|
SameType<Append<CharList,NullType>::Result,CharList>::value &&
|
||||||
|
SameType<Append<CharList,int>::Result,Seq<char,int>::Type >::value &&
|
||||||
|
SameType<Append<CharList,CharIntDoubleList>::Result,Seq<char,char,int,double>::Type >::value;
|
||||||
|
|
||||||
|
testAssert("Append",r,result);
|
||||||
|
|
||||||
|
r=SameType<Erase<NullType,char>::Result,NullType>::value &&
|
||||||
|
SameType<Erase<CharList,char>::Result,NullType>::value &&
|
||||||
|
SameType<Erase<CharList,long>::Result,CharList>::value &&
|
||||||
|
SameType<Erase<CharIntDoubleList,int>::Result,Seq<char,double>::Type >::value &&
|
||||||
|
SameType<Erase<CharIntDoubleList,double>::Result,Seq<char,int>::Type >::value;
|
||||||
|
|
||||||
|
testAssert("Erase",r,result);
|
||||||
|
|
||||||
|
r=SameType<EraseAll<NullType,char>::Result,NullType>::value &&
|
||||||
|
SameType<EraseAll<CharList,char>::Result,NullType>::value &&
|
||||||
|
SameType<EraseAll<CharList,long>::Result,CharList>::value &&
|
||||||
|
SameType<EraseAll<CharIntDoubleList,int>::Result,Seq<char,double>::Type >::value &&
|
||||||
|
SameType<EraseAll<CharIntDoubleList,double>::Result,Seq<char,int>::Type >::value &&
|
||||||
|
SameType<EraseAll<CharIntDoubleCharList,char>::Result,Seq<int,double>::Type >::value &&
|
||||||
|
SameType<EraseAll<CharIntDoubleCharList,int>::Result,Seq<char,double,char>::Type >::value &&
|
||||||
|
SameType<EraseAll<CharIntDoubleCharList,double>::Result,Seq<char,int,char>::Type >::value;
|
||||||
|
|
||||||
|
testAssert("EraseAll",r,result);
|
||||||
|
|
||||||
|
r=SameType<NoDuplicates<NullType>::Result,NullType>::value &&
|
||||||
|
SameType<NoDuplicates<CharList>::Result,CharList>::value &&
|
||||||
|
SameType<NoDuplicates<CharIntDoubleList>::Result,CharIntDoubleList>::value &&
|
||||||
|
SameType<NoDuplicates<CharIntDoubleCharList>::Result,CharIntDoubleList>::value;
|
||||||
|
|
||||||
|
testAssert("NoDuplicates",r,result);
|
||||||
|
|
||||||
|
r=SameType<Replace<NullType,char,long>::Result,NullType>::value &&
|
||||||
|
SameType<Replace<CharList,char,long>::Result,Seq<long>::Type >::value &&
|
||||||
|
SameType<Replace<CharList,int,long>::Result,CharList>::value &&
|
||||||
|
SameType<Replace<CharIntDoubleList,char,long>::Result,Seq<long,int,double>::Type >::value &&
|
||||||
|
SameType<Replace<CharIntDoubleList,long,char[16]>::Result,CharIntDoubleList>::value &&
|
||||||
|
SameType<Replace<CharIntDoubleCharList,char,long>::Result,Seq<long,int,double,char>::Type >::value;
|
||||||
|
|
||||||
|
testAssert("Replace",r,result);
|
||||||
|
|
||||||
|
r=SameType<ReplaceAll<NullType,char,long>::Result,NullType>::value &&
|
||||||
|
SameType<ReplaceAll<CharList,char,long>::Result,Seq<long>::Type >::value &&
|
||||||
|
SameType<ReplaceAll<CharList,int,long>::Result,CharList>::value &&
|
||||||
|
SameType<ReplaceAll<CharIntDoubleList,char,long>::Result,Seq<long,int,double>::Type >::value &&
|
||||||
|
SameType<ReplaceAll<CharIntDoubleList,long,char[16]>::Result,CharIntDoubleList>::value &&
|
||||||
|
SameType<ReplaceAll<CharIntDoubleCharList,char,long>::Result,Seq<long,int,double,long>::Type >::value;
|
||||||
|
|
||||||
|
testAssert("ReplaceAll",r,result);
|
||||||
|
|
||||||
|
r=SameType<Reverse<NullType>::Result,NullType>::value &&
|
||||||
|
SameType<Reverse<CharList>::Result,CharList>::value &&
|
||||||
|
SameType<Reverse<CharIntDoubleList>::Result,Seq<double,int,char>::Type >::value;
|
||||||
|
|
||||||
|
testAssert("Reverse",r,result);
|
||||||
|
|
||||||
|
r=SameType<MostDerived<NullType,Base>::Result,Base>::value &&
|
||||||
|
SameType<MostDerived<BaseDerived1Derived2List,Base>::Result,Derived2>::value &&
|
||||||
|
SameType<MostDerived<BaseDerived1Derived2List,Derived1>::Result,Derived2>::value &&
|
||||||
|
SameType<MostDerived<BaseDerived1Derived2List,Derived2>::Result,Derived2>::value &&
|
||||||
|
SameType<MostDerived<Derived2Derived1BaseList,Base>::Result,Derived2>::value &&
|
||||||
|
SameType<MostDerived<Derived2Derived1BaseList,Derived1>::Result,Derived2>::value &&
|
||||||
|
SameType<MostDerived<Derived2Derived1BaseList,Derived2>::Result,Derived2>::value;
|
||||||
|
|
||||||
|
testAssert("MostDerived",r,result);
|
||||||
|
|
||||||
|
r=SameType<DerivedToFront<NullType>::Result,NullType>::value &&
|
||||||
|
SameType<DerivedToFront<CharList>::Result,CharList>::value &&
|
||||||
|
SameType<DerivedToFront<CharIntDoubleList>::Result,CharIntDoubleList>::value &&
|
||||||
|
SameType<DerivedToFront<CharIntDoubleCharList>::Result,CharIntDoubleCharList>::value &&
|
||||||
|
SameType<DerivedToFront<BaseDerived1Derived2List>::Result,Derived2Derived1BaseList>::value &&
|
||||||
|
SameType<DerivedToFront<Derived2Derived1BaseList>::Result,Derived2Derived1BaseList>::value &&
|
||||||
|
SameType<DerivedToFront<BaseDerived1BaseDerived2List>::Result,Seq<Derived2,Derived1,Base,Base>::Type >::value &&
|
||||||
|
SameType<DerivedToFront<Derived1BaseDerived1Derived2List>::Result,Seq<Derived2,Derived1,Derived1,Base>::Type >::value;
|
||||||
|
|
||||||
|
testAssert("DerivedToFront",r,result);
|
||||||
|
|
||||||
|
#endif //LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue