replace tabs space
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@334 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
570f0ed652
commit
7fe4c81ff0
28 changed files with 799 additions and 778 deletions
|
@ -30,12 +30,12 @@ Example Use
|
|||
|
||||
template<typename T>
|
||||
struct ExtractDataType
|
||||
{
|
||||
some_type operator()()
|
||||
{
|
||||
return create_value_from_type<T>;
|
||||
}
|
||||
};
|
||||
{
|
||||
some_type operator()()
|
||||
{
|
||||
return create_value_from_type<T>;
|
||||
}
|
||||
};
|
||||
|
||||
Loki::IterateTypes<parameter_tl, ExtractDataType> gendata;
|
||||
std::vector<some_type> stuff;
|
||||
|
@ -43,24 +43,24 @@ gendata(std::back_inserter(stuff));
|
|||
*******************************************************************************/
|
||||
namespace Loki
|
||||
{
|
||||
namespace TL
|
||||
{
|
||||
template<typename T>
|
||||
struct nameof_type
|
||||
{
|
||||
const char* operator()()
|
||||
{
|
||||
return typeid(T).name();
|
||||
}
|
||||
};
|
||||
template<typename T>
|
||||
struct sizeof_type
|
||||
{
|
||||
size_t operator()()
|
||||
{
|
||||
return sizeof(T);
|
||||
}
|
||||
};
|
||||
namespace TL
|
||||
{
|
||||
template<typename T>
|
||||
struct nameof_type
|
||||
{
|
||||
const char* operator()()
|
||||
{
|
||||
return typeid(T).name();
|
||||
}
|
||||
};
|
||||
template<typename T>
|
||||
struct sizeof_type
|
||||
{
|
||||
size_t operator()()
|
||||
{
|
||||
return sizeof(T);
|
||||
}
|
||||
};
|
||||
template <class TList, template <class> class GenFunc>
|
||||
struct IterateTypes;
|
||||
|
||||
|
@ -75,8 +75,8 @@ namespace Loki
|
|||
void operator()(II ii)
|
||||
{
|
||||
head.operator()(ii);
|
||||
tail.operator()(ii);
|
||||
}
|
||||
tail.operator()(ii);
|
||||
}
|
||||
};
|
||||
|
||||
template <class AtomicType, template <class> class GenFunc>
|
||||
|
@ -99,13 +99,13 @@ namespace Loki
|
|||
{}
|
||||
};
|
||||
|
||||
template<typename Types, template <class> class UnitFunc, typename II>
|
||||
void iterate_types(II ii)
|
||||
{
|
||||
Loki::TL::IterateTypes<Types, UnitFunc> it;
|
||||
it(ii);
|
||||
}
|
||||
}//ns TL
|
||||
template<typename Types, template <class> class UnitFunc, typename II>
|
||||
void iterate_types(II ii)
|
||||
{
|
||||
Loki::TL::IterateTypes<Types, UnitFunc> it;
|
||||
it(ii);
|
||||
}
|
||||
}//ns TL
|
||||
}//ns Loki
|
||||
|
||||
#endif //DATAGENERATORS_H
|
||||
|
|
|
@ -682,7 +682,7 @@ template <typename AP, typename Id, typename P1 >
|
|||
Parm6, Parm7, Parm8, Parm9,Parm10,
|
||||
Parm11,Parm12,Parm13,Parm14,Parm15 )
|
||||
= 0;
|
||||
};
|
||||
};
|
||||
|
||||
#endif //LOKI_DISABLE_TYPELIST_MACROS
|
||||
|
||||
|
@ -1036,6 +1036,9 @@ template <typename AP, typename Id, typename P1 >
|
|||
#endif // FACTORY_INC_
|
||||
|
||||
// $Log$
|
||||
// Revision 1.9 2005/10/30 14:03:23 syntheticpp
|
||||
// replace tabs space
|
||||
//
|
||||
// Revision 1.8 2005/10/30 13:49:44 syntheticpp
|
||||
// make disabling the TYPELIST macros possible
|
||||
//
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
namespace Loki
|
||||
{
|
||||
|
||||
template<class R>
|
||||
struct Function;
|
||||
template<class R>
|
||||
struct Function;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Function allows a boost/TR1 like usage of Functor.
|
||||
|
@ -27,311 +27,311 @@ namespace Loki
|
|||
// e.g. Functor<int,LOKI_TYPELIST_2(int,int)> becomes Function<int(int,int)>
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<class R>
|
||||
struct Function<R()> : public Functor<R>
|
||||
{
|
||||
typedef Functor<R> FBase;
|
||||
template<class R>
|
||||
struct Function<R()> : public Functor<R>
|
||||
{
|
||||
typedef Functor<R> FBase;
|
||||
|
||||
Function() : FBase() {}
|
||||
Function() : FBase() {}
|
||||
|
||||
Function(const Function& func) : FBase()
|
||||
{
|
||||
if( !func.empty())
|
||||
FBase::operator=(func);
|
||||
}
|
||||
|
||||
// emptiness
|
||||
template<class R2>
|
||||
Function(Function<R2()> func) : FBase()
|
||||
{
|
||||
if(!func.empty())
|
||||
FBase::operator=(func);
|
||||
}
|
||||
|
||||
// clear by '= 0'
|
||||
Function(const int i) : FBase()
|
||||
{
|
||||
if(i==0)
|
||||
FBase::clear();
|
||||
else
|
||||
throw std::runtime_error("Loki::Function(const int i): i!=0");
|
||||
}
|
||||
|
||||
template<class Func>
|
||||
Function(Func func) : FBase(func) {}
|
||||
Function(const Function& func) : FBase()
|
||||
{
|
||||
if( !func.empty())
|
||||
FBase::operator=(func);
|
||||
}
|
||||
|
||||
// emptiness
|
||||
template<class R2>
|
||||
Function(Function<R2()> func) : FBase()
|
||||
{
|
||||
if(!func.empty())
|
||||
FBase::operator=(func);
|
||||
}
|
||||
|
||||
// clear by '= 0'
|
||||
Function(const int i) : FBase()
|
||||
{
|
||||
if(i==0)
|
||||
FBase::clear();
|
||||
else
|
||||
throw std::runtime_error("Loki::Function(const int i): i!=0");
|
||||
}
|
||||
|
||||
template<class Func>
|
||||
Function(Func func) : FBase(func) {}
|
||||
|
||||
template<class Host, class Func>
|
||||
Function(const Host& host, const Func& func) : FBase(host,func) {}
|
||||
template<class Host, class Func>
|
||||
Function(const Host& host, const Func& func) : FBase(host,func) {}
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// macros for the repetitions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define LOKI_FUNCTION_BODY \
|
||||
\
|
||||
Function() : FBase() {} \
|
||||
\
|
||||
Function(const Function& func) : FBase() \
|
||||
{ \
|
||||
if( !func.empty()) \
|
||||
FBase::operator=(func); \
|
||||
} \
|
||||
\
|
||||
Function(const int i) : FBase() \
|
||||
{ \
|
||||
if(i==0) \
|
||||
FBase::clear(); \
|
||||
else \
|
||||
throw std::runtime_error( \
|
||||
"Loki::Function(const int i): i!=0"); \
|
||||
} \
|
||||
\
|
||||
template<class Func> \
|
||||
Function(Func func) : FBase(func) {} \
|
||||
\
|
||||
template<class Host, class Func> \
|
||||
Function(const Host& host, const Func& func): FBase(host,func) {}
|
||||
#define LOKI_FUNCTION_BODY \
|
||||
\
|
||||
Function() : FBase() {} \
|
||||
\
|
||||
Function(const Function& func) : FBase() \
|
||||
{ \
|
||||
if( !func.empty()) \
|
||||
FBase::operator=(func); \
|
||||
} \
|
||||
\
|
||||
Function(const int i) : FBase() \
|
||||
{ \
|
||||
if(i==0) \
|
||||
FBase::clear(); \
|
||||
else \
|
||||
throw std::runtime_error( \
|
||||
"Loki::Function(const int i): i!=0"); \
|
||||
} \
|
||||
\
|
||||
template<class Func> \
|
||||
Function(Func func) : FBase(func) {} \
|
||||
\
|
||||
template<class Host, class Func> \
|
||||
Function(const Host& host, const Func& func): FBase(host,func) {}
|
||||
|
||||
|
||||
#define LOKI_FUNCTION_R2_CTOR_BODY \
|
||||
\
|
||||
: FBase() \
|
||||
{ \
|
||||
if(!func.empty()) \
|
||||
FBase::operator=(func); \
|
||||
}
|
||||
|
||||
#define LOKI_FUNCTION_R2_CTOR_BODY \
|
||||
\
|
||||
: FBase() \
|
||||
{ \
|
||||
if(!func.empty()) \
|
||||
FBase::operator=(func); \
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// repetitions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<class R,class P01>
|
||||
struct Function<R(P01)>
|
||||
: public Loki::Functor<R, Seq<P01> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01> > FBase;
|
||||
|
||||
template<class R2,class Q01>
|
||||
Function(Function<R2(Q01)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R,class P01>
|
||||
struct Function<R(P01)>
|
||||
: public Loki::Functor<R, Seq<P01> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01> > FBase;
|
||||
|
||||
template<class R2,class Q01>
|
||||
Function(Function<R2(Q01)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R,class P01,class P02>
|
||||
struct Function<R(P01,P02)>
|
||||
: public Functor<R, Seq<P01,P02> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01,P02> > FBase;
|
||||
template<class R,class P01,class P02>
|
||||
struct Function<R(P01,P02)>
|
||||
: public Functor<R, Seq<P01,P02> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01,P02> > FBase;
|
||||
|
||||
template<class R2,class Q01, class Q02>
|
||||
Function(Function<R2(Q01,Q02)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R2,class Q01, class Q02>
|
||||
Function(Function<R2(Q01,Q02)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R,class P01,class P02, class P03>
|
||||
struct Function<R(P01,P02,P03)>
|
||||
: public Functor<R, Seq<P01,P02,P03> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01,P02,P03> > FBase;
|
||||
template<class R,class P01,class P02, class P03>
|
||||
struct Function<R(P01,P02,P03)>
|
||||
: public Functor<R, Seq<P01,P02,P03> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01,P02,P03> > FBase;
|
||||
|
||||
template<class R2,class Q01, class Q02,class Q03>
|
||||
Function(Function<R2(Q01,Q02,Q03)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R2,class Q01, class Q02,class Q03>
|
||||
Function(Function<R2(Q01,Q02,Q03)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R,class P01,class P02, class P03,class P04>
|
||||
struct Function<R(P01,P02,P03,P04)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01,P02,P03,P04> > FBase;
|
||||
template<class R,class P01,class P02, class P03,class P04>
|
||||
struct Function<R(P01,P02,P03,P04)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01,P02,P03,P04> > FBase;
|
||||
|
||||
template<class R2,class Q01,class Q02, class Q03,class Q04>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R2,class Q01,class Q02, class Q03,class Q04>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R,class P01,class P02, class P03,class P04,class P05>
|
||||
struct Function<R(P01,P02,P03,P04,P05)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01,P02,P03,P04,P05> > FBase;
|
||||
template<class R,class P01,class P02, class P03,class P04,class P05>
|
||||
struct Function<R(P01,P02,P03,P04,P05)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01,P02,P03,P04,P05> > FBase;
|
||||
|
||||
template<class R2,class Q01,class Q02, class Q03,class Q04,class Q05>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R2,class Q01,class Q02, class Q03,class Q04,class Q05>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06> > FBase;
|
||||
|
||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||
class Q06>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06> > FBase;
|
||||
|
||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||
class Q06>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07> > FBase;
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||
class Q06,class Q07>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09,class P10>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09,class Q10>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09,Q10)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09,class P10>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09,class Q10>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09,Q10)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09,class P10,
|
||||
class P11>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||
class Q11>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09,Q10,Q11)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09,class P10,
|
||||
class P11>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||
class Q11>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09,Q10,Q11)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09,class P10,
|
||||
class P11,class P12>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||
class Q11,class Q12>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09,Q10,Q11)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09,class P10,
|
||||
class P11,class P12>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||
class Q11,class Q12>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09,Q10,Q11)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09,class P10,
|
||||
class P11,class P12, class P13>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||
class Q11,class Q12, class Q13>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09,Q10,Q11,Q12,Q13)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09,class P10,
|
||||
class P11,class P12, class P13>
|
||||
struct Function<R(P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||
class Q11,class Q12, class Q13>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09,Q10,Q11,Q12,Q13)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09,class P10,
|
||||
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)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||
class Q11,class Q12, class Q13,class Q14>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09,Q10,Q11,Q12,Q13,Q14)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09,class P10,
|
||||
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)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||
class Q11,class Q12, class Q13,class Q14>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09,Q10,Q11,Q12,Q13,Q14)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09,class P10,
|
||||
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)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14,P15> >
|
||||
{
|
||||
typedef Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14,P15> > FBase;
|
||||
template<class R, class P01,class P02, class P03,class P04,class P05,
|
||||
class P06,class P07, class P08,class P09,class P10,
|
||||
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)>
|
||||
: public Functor<R, Seq<P01,P02,P03,P04,P05,P06,P07,P08,P09,P10,P11,P12,P13,P14,P15> >
|
||||
{
|
||||
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,
|
||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||
class Q11,class Q12, class Q13,class Q14,class Q15>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09,Q10,Q11,Q12,Q13,Q14,Q15)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
template<class R2, class Q01,class Q02, class Q03,class Q04,class Q05,
|
||||
class Q06,class Q07, class Q08,class Q09,class Q10,
|
||||
class Q11,class Q12, class Q13,class Q14,class Q15>
|
||||
Function(Function<R2(Q01,Q02,Q03,Q04,Q05,Q06,Q07,Q08,Q09,Q10,Q11,Q12,Q13,Q14,Q15)> func)
|
||||
LOKI_FUNCTION_R2_CTOR_BODY
|
||||
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
LOKI_FUNCTION_BODY
|
||||
};
|
||||
|
||||
}// namespace Loki
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ namespace Loki
|
|||
virtual R operator()() = 0;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// class template FunctorImpl
|
||||
// Specialization for 1 parameter
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1111,12 +1111,12 @@ namespace Loki
|
|||
|
||||
#ifdef LOKI_ENABLE_FUNCTION
|
||||
|
||||
class bad_function_call : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
bad_function_call() : std::runtime_error("bad_function_call in Loki::Functor")
|
||||
{}
|
||||
};
|
||||
class bad_function_call : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
bad_function_call() : std::runtime_error("bad_function_call in Loki::Functor")
|
||||
{}
|
||||
};
|
||||
|
||||
#define LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL if(empty()) throw bad_function_call();
|
||||
|
||||
|
@ -1195,100 +1195,100 @@ namespace Loki
|
|||
|
||||
#ifdef LOKI_ENABLE_FUNCTION
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return spImpl_.get() == 0;
|
||||
}
|
||||
bool empty() const
|
||||
{
|
||||
return spImpl_.get() == 0;
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
spImpl_.reset(0);
|
||||
}
|
||||
void clear()
|
||||
{
|
||||
spImpl_.reset(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
ResultType operator()() const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)();
|
||||
}
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)();
|
||||
}
|
||||
|
||||
ResultType operator()(Parm1 p1) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1);
|
||||
}
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1);
|
||||
}
|
||||
|
||||
ResultType operator()(Parm1 p1, Parm2 p2) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2);
|
||||
}
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2);
|
||||
}
|
||||
|
||||
ResultType operator()(Parm1 p1, Parm2 p2, Parm3 p3) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3);
|
||||
}
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3);
|
||||
}
|
||||
|
||||
ResultType operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4);
|
||||
}
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4);
|
||||
}
|
||||
|
||||
ResultType operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5);
|
||||
}
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5);
|
||||
}
|
||||
|
||||
ResultType operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5,
|
||||
Parm6 p6) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6);
|
||||
}
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6);
|
||||
}
|
||||
|
||||
ResultType operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5,
|
||||
Parm6 p6, Parm7 p7) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7);
|
||||
}
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7);
|
||||
}
|
||||
|
||||
ResultType operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5,
|
||||
Parm6 p6, Parm7 p7, Parm8 p8) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7, p8);
|
||||
}
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7, p8);
|
||||
}
|
||||
|
||||
ResultType operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5,
|
||||
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7, p8, p9);
|
||||
}
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7, p8, p9);
|
||||
}
|
||||
|
||||
ResultType operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5,
|
||||
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
|
||||
}
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
|
||||
}
|
||||
|
||||
ResultType operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5,
|
||||
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10, Parm11 p11) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
|
||||
}
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
|
||||
}
|
||||
|
||||
ResultType operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5,
|
||||
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10, Parm11 p11,
|
||||
Parm12 p12) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11,
|
||||
p12);
|
||||
}
|
||||
|
@ -1297,7 +1297,7 @@ namespace Loki
|
|||
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10, Parm11 p11,
|
||||
Parm12 p12, Parm13 p13) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11,
|
||||
p12, p13);
|
||||
}
|
||||
|
@ -1306,7 +1306,7 @@ namespace Loki
|
|||
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10, Parm11 p11,
|
||||
Parm12 p12, Parm13 p13, Parm14 p14) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11,
|
||||
p12, p13, p14);
|
||||
}
|
||||
|
@ -1315,7 +1315,7 @@ namespace Loki
|
|||
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10, Parm11 p11,
|
||||
Parm12 p12, Parm13 p13, Parm14 p14, Parm15 p15) const
|
||||
{
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
LOKI_FUNCTION_THROW_BAD_FUNCTION_CALL
|
||||
return (*spImpl_)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11,
|
||||
p12, p13, p14, p15);
|
||||
}
|
||||
|
|
|
@ -37,18 +37,18 @@ namespace Loki
|
|||
namespace Private
|
||||
{
|
||||
template <class SomeLhs, class SomeRhs,
|
||||
class Executor, typename ResultType>
|
||||
class Executor, typename ResultType>
|
||||
struct InvocationTraits
|
||||
{
|
||||
static ResultType
|
||||
DoDispatch(SomeLhs& lhs, SomeRhs& rhs,
|
||||
Executor& exec, Int2Type<false>)
|
||||
DoDispatch(SomeLhs& lhs, SomeRhs& rhs,
|
||||
Executor& exec, Int2Type<false>)
|
||||
{
|
||||
return exec.Fire(lhs, rhs);
|
||||
}
|
||||
static ResultType
|
||||
DoDispatch(SomeLhs& lhs, SomeRhs& rhs,
|
||||
Executor& exec, Int2Type<true>)
|
||||
DoDispatch(SomeLhs& lhs, SomeRhs& rhs,
|
||||
Executor& exec, Int2Type<true>)
|
||||
{
|
||||
return exec.Fire(rhs, lhs);
|
||||
}
|
||||
|
@ -157,15 +157,15 @@ namespace Loki
|
|||
|
||||
// Non-inline to reduce compile time overhead...
|
||||
template <class BaseLhs, class BaseRhs,
|
||||
typename ResultType, typename CallbackType>
|
||||
typename ResultType, typename CallbackType>
|
||||
void BasicDispatcher<BaseLhs,BaseRhs,ResultType,CallbackType>
|
||||
::DoAdd(TypeInfo lhs, TypeInfo rhs, CallbackType fun)
|
||||
::DoAdd(TypeInfo lhs, TypeInfo rhs, CallbackType fun)
|
||||
{
|
||||
callbackMap_[KeyType(lhs, rhs)] = fun;
|
||||
}
|
||||
|
||||
template <class BaseLhs, class BaseRhs,
|
||||
typename ResultType, typename CallbackType>
|
||||
typename ResultType, typename CallbackType>
|
||||
bool BasicDispatcher<BaseLhs,BaseRhs,ResultType,CallbackType>
|
||||
::DoRemove(TypeInfo lhs, TypeInfo rhs)
|
||||
{
|
||||
|
@ -173,11 +173,11 @@ namespace Loki
|
|||
}
|
||||
|
||||
template <class BaseLhs, class BaseRhs,
|
||||
typename ResultType, typename CallbackType>
|
||||
typename ResultType, typename CallbackType>
|
||||
ResultType BasicDispatcher<BaseLhs,BaseRhs,ResultType,CallbackType>
|
||||
::Go(BaseLhs& lhs, BaseRhs& rhs)
|
||||
{
|
||||
typename MapType::key_type k(typeid(lhs),typeid(rhs));
|
||||
typename MapType::key_type k(typeid(lhs),typeid(rhs));
|
||||
typename MapType::iterator i = callbackMap_.find(k);
|
||||
if (i == callbackMap_.end())
|
||||
{
|
||||
|
@ -222,7 +222,7 @@ namespace Loki
|
|||
namespace Private
|
||||
{
|
||||
template <class BaseLhs, class BaseRhs,
|
||||
class SomeLhs, class SomeRhs,
|
||||
class SomeLhs, class SomeRhs,
|
||||
typename ResultType,
|
||||
class CastLhs, class CastRhs,
|
||||
ResultType (*Callback)(SomeLhs&, SomeRhs&)>
|
||||
|
@ -266,13 +266,13 @@ namespace Loki
|
|||
ResultType (*callback)(SomeLhs&, SomeRhs&)>
|
||||
void Add()
|
||||
{
|
||||
typedef Private::FnDispatcherHelper<
|
||||
BaseLhs, BaseRhs,
|
||||
SomeLhs, SomeRhs,
|
||||
ResultType,
|
||||
CastingPolicy<SomeLhs,BaseLhs>,
|
||||
CastingPolicy<SomeRhs,BaseRhs>,
|
||||
callback> Local;
|
||||
typedef Private::FnDispatcherHelper<
|
||||
BaseLhs, BaseRhs,
|
||||
SomeLhs, SomeRhs,
|
||||
ResultType,
|
||||
CastingPolicy<SomeLhs,BaseLhs>,
|
||||
CastingPolicy<SomeRhs,BaseRhs>,
|
||||
callback> Local;
|
||||
|
||||
Add<SomeLhs, SomeRhs>(&Local::Trampoline);
|
||||
}
|
||||
|
@ -282,13 +282,13 @@ namespace Loki
|
|||
bool symmetric>
|
||||
void Add(bool = true) // [gcc] dummy bool
|
||||
{
|
||||
typedef Private::FnDispatcherHelper<
|
||||
BaseLhs, BaseRhs,
|
||||
SomeLhs, SomeRhs,
|
||||
ResultType,
|
||||
CastingPolicy<SomeLhs,BaseLhs>,
|
||||
CastingPolicy<SomeRhs,BaseRhs>,
|
||||
callback> Local;
|
||||
typedef Private::FnDispatcherHelper<
|
||||
BaseLhs, BaseRhs,
|
||||
SomeLhs, SomeRhs,
|
||||
ResultType,
|
||||
CastingPolicy<SomeLhs,BaseLhs>,
|
||||
CastingPolicy<SomeRhs,BaseRhs>,
|
||||
callback> Local;
|
||||
|
||||
Add<SomeLhs, SomeRhs>(&Local::Trampoline);
|
||||
if (symmetric)
|
||||
|
@ -316,11 +316,11 @@ namespace Loki
|
|||
|
||||
namespace Private
|
||||
{
|
||||
template <class BaseLhs, class BaseRhs,
|
||||
class SomeLhs, class SomeRhs,
|
||||
typename ResultType,
|
||||
class CastLhs, class CastRhs,
|
||||
class Fun, bool SwapArgs>
|
||||
template <class BaseLhs, class BaseRhs,
|
||||
class SomeLhs, class SomeRhs,
|
||||
typename ResultType,
|
||||
class CastLhs, class CastRhs,
|
||||
class Fun, bool SwapArgs>
|
||||
class FunctorDispatcherHelper
|
||||
{
|
||||
Fun fun_;
|
||||
|
@ -365,33 +365,33 @@ namespace Loki
|
|||
void Add(const Fun& fun)
|
||||
{
|
||||
typedef Private::FunctorDispatcherHelper<
|
||||
BaseLhs, BaseRhs,
|
||||
SomeLhs, SomeRhs,
|
||||
ResultType,
|
||||
CastingPolicy<SomeLhs, BaseLhs>,
|
||||
CastingPolicy<SomeRhs, BaseRhs>,
|
||||
Fun, false> Adapter;
|
||||
BaseLhs, BaseRhs,
|
||||
SomeLhs, SomeRhs,
|
||||
ResultType,
|
||||
CastingPolicy<SomeLhs, BaseLhs>,
|
||||
CastingPolicy<SomeRhs, BaseRhs>,
|
||||
Fun, false> Adapter;
|
||||
|
||||
backEnd_.template Add<SomeLhs, SomeRhs>(FunctorType(Adapter(fun)));
|
||||
}
|
||||
}
|
||||
template <class SomeLhs, class SomeRhs, bool symmetric, class Fun>
|
||||
void Add(const Fun& fun)
|
||||
{
|
||||
Add<SomeLhs,SomeRhs>(fun);
|
||||
Add<SomeLhs,SomeRhs>(fun);
|
||||
|
||||
if (symmetric)
|
||||
{
|
||||
// Note: symmetry only makes sense where BaseLhs==BaseRhs
|
||||
typedef Private::FunctorDispatcherHelper<
|
||||
BaseLhs, BaseLhs,
|
||||
SomeLhs, SomeRhs,
|
||||
ResultType,
|
||||
CastingPolicy<SomeLhs, BaseLhs>,
|
||||
CastingPolicy<SomeRhs, BaseLhs>,
|
||||
Fun, true> AdapterR;
|
||||
if (symmetric)
|
||||
{
|
||||
// Note: symmetry only makes sense where BaseLhs==BaseRhs
|
||||
typedef Private::FunctorDispatcherHelper<
|
||||
BaseLhs, BaseLhs,
|
||||
SomeLhs, SomeRhs,
|
||||
ResultType,
|
||||
CastingPolicy<SomeLhs, BaseLhs>,
|
||||
CastingPolicy<SomeRhs, BaseLhs>,
|
||||
Fun, true> AdapterR;
|
||||
|
||||
backEnd_.template Add<SomeRhs, SomeLhs>(FunctorType(AdapterR(fun)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class SomeLhs, class SomeRhs>
|
||||
|
|
|
@ -165,7 +165,7 @@ namespace Loki
|
|||
};
|
||||
|
||||
template<unsigned int L, class T, typename P1>
|
||||
class OrderedStatic<L, T, Loki::Seq<P1> > : public Private::OrderedStaticBase<T>
|
||||
class OrderedStatic<L, T, Loki::Seq<P1> > : public Private::OrderedStaticBase<T>
|
||||
{
|
||||
public:
|
||||
OrderedStatic(P1 p) : Private::OrderedStaticBase<T>(L), para_(p)
|
||||
|
|
|
@ -319,7 +319,7 @@ private:
|
|||
#ifdef _MSC_VER
|
||||
const int stored = _snprintf(resultBuf,
|
||||
#else
|
||||
const int stored = snprintf(resultBuf,
|
||||
const int stored = snprintf(resultBuf,
|
||||
#endif
|
||||
sizeof(resultBuf) / sizeof(Char), fmtBuf, n);
|
||||
if (stored < 0) {
|
||||
|
@ -408,14 +408,14 @@ private:
|
|||
}
|
||||
|
||||
void ParseDecimalUInt(unsigned int& dest) {
|
||||
if (!std::isdigit(*format_, std::locale())) return;
|
||||
if (!std::isdigit(*format_, std::locale())) return;
|
||||
unsigned int r = 0;
|
||||
do {
|
||||
// TODO: inefficient - rewrite
|
||||
r *= 10;
|
||||
r += *format_ - '0';
|
||||
++format_;
|
||||
} while (std::isdigit(*format_, std::locale()));
|
||||
} while (std::isdigit(*format_, std::locale()));
|
||||
dest = r;
|
||||
}
|
||||
|
||||
|
|
|
@ -309,7 +309,7 @@ namespace Loki
|
|||
std::size_t objectAlignSize,
|
||||
template <class> class LifetimePolicy
|
||||
>
|
||||
class SmallObjectBase
|
||||
class SmallObjectBase
|
||||
{
|
||||
|
||||
#if (LOKI_MAX_SMALL_OBJECT_SIZE != 0) && (LOKI_DEFAULT_CHUNK_SIZE != 0) && (LOKI_DEFAULT_OBJECT_ALIGNMENT != 0)
|
||||
|
@ -324,7 +324,7 @@ namespace Loki
|
|||
/// Defines singleton made from allocator.
|
||||
typedef Loki::SingletonHolder< MyAllocator, Loki::CreateStatic,
|
||||
LifetimePolicy, ThreadingModel > MyAllocatorSingleton;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/// Throwing single-object new throws bad_alloc when allocation fails.
|
||||
|
@ -513,6 +513,9 @@ namespace Loki
|
|||
// Nov. 26, 2004: re-implemented by Rich Sposato.
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.18 2005/10/30 14:03:23 syntheticpp
|
||||
// replace tabs space
|
||||
//
|
||||
// Revision 1.17 2005/10/29 08:10:13 syntheticpp
|
||||
// #undef LOKI_SMALL_OBJECT_USE_NEW_ARRAY when using a Microsoft compiler
|
||||
//
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace Loki
|
|||
{
|
||||
Lock() {}
|
||||
explicit Lock(const SingleThreaded&) {}
|
||||
explicit Lock(const SingleThreaded*) {}
|
||||
explicit Lock(const SingleThreaded*) {}
|
||||
};
|
||||
|
||||
typedef Host VolatileType;
|
||||
|
@ -125,9 +125,9 @@ namespace Loki
|
|||
pthread_mutex_unlock(&atomic_mutex_)
|
||||
|
||||
#define LOKI_THREADS_ATOMIC_FUNCTIONS \
|
||||
private: \
|
||||
static pthread_mutex_t atomic_mutex_; \
|
||||
public: \
|
||||
private: \
|
||||
static pthread_mutex_t atomic_mutex_; \
|
||||
public: \
|
||||
static IntType AtomicIncrement(volatile IntType& lval) \
|
||||
{ LOKI_THREADS_ATOMIC( lval++ ); return lval; } \
|
||||
\
|
||||
|
@ -184,7 +184,7 @@ namespace Loki
|
|||
LOKI_THREADS_MUTEX_LOCK(&host_.mtx_);
|
||||
}
|
||||
|
||||
explicit Lock(const ObjectLevelLockable* host) : host_(*host)
|
||||
explicit Lock(const ObjectLevelLockable* host) : host_(*host)
|
||||
{
|
||||
LOKI_THREADS_MUTEX_LOCK(&host_.mtx_);
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ namespace Loki
|
|||
}
|
||||
|
||||
private:
|
||||
Lock();
|
||||
Lock();
|
||||
Lock(const Lock&);
|
||||
Lock& operator=(const Lock&);
|
||||
const ObjectLevelLockable& host_;
|
||||
|
@ -210,7 +210,7 @@ namespace Loki
|
|||
};
|
||||
|
||||
#if defined(_PTHREAD_H)
|
||||
template <class Host>
|
||||
template <class Host>
|
||||
pthread_mutex_t ObjectLevelLockable<Host>::atomic_mutex_(PTHREAD_MUTEX_INITIALIZER);
|
||||
#endif
|
||||
|
||||
|
@ -264,7 +264,7 @@ namespace Loki
|
|||
LOKI_THREADS_MUTEX_LOCK(&initializer_.mtx_);
|
||||
}
|
||||
|
||||
explicit Lock(const ClassLevelLockable*)
|
||||
explicit Lock(const ClassLevelLockable*)
|
||||
{
|
||||
assert(initializer_.init_);
|
||||
LOKI_THREADS_MUTEX_LOCK(&initializer_.mtx_);
|
||||
|
@ -290,7 +290,7 @@ namespace Loki
|
|||
};
|
||||
|
||||
#if defined(_PTHREAD_H)
|
||||
template <class Host>
|
||||
template <class Host>
|
||||
pthread_mutex_t ClassLevelLockable<Host>::atomic_mutex_(PTHREAD_MUTEX_INITIALIZER);
|
||||
#endif
|
||||
|
||||
|
@ -314,6 +314,9 @@ namespace Loki
|
|||
#endif
|
||||
|
||||
// $Log$
|
||||
// Revision 1.16 2005/10/30 14:03:23 syntheticpp
|
||||
// replace tabs space
|
||||
//
|
||||
// Revision 1.15 2005/10/24 20:35:12 syntheticpp
|
||||
// small changes for Threads; add compile test for Threads.h
|
||||
//
|
||||
|
|
|
@ -226,7 +226,7 @@ struct SuperSubclassStrict
|
|||
template<>
|
||||
struct SuperSubclassStrict<void, void>
|
||||
{
|
||||
enum { value = false };
|
||||
enum { value = false };
|
||||
};
|
||||
|
||||
template<class U>
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace Loki
|
|||
|
||||
namespace Private
|
||||
{
|
||||
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||
typedef LOKI_TYPELIST_4(unsigned char, unsigned short int,unsigned int, unsigned long int)
|
||||
StdUnsignedInts;
|
||||
typedef LOKI_TYPELIST_4(signed char, short int,int, long int)
|
||||
|
@ -75,7 +75,7 @@ namespace Loki
|
|||
typedef LOKI_TYPELIST_3(float, double, long double)
|
||||
StdFloats;
|
||||
#else
|
||||
typedef Loki::Seq<unsigned char, unsigned short int,unsigned int, unsigned long int>::Type
|
||||
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;
|
||||
|
|
|
@ -211,7 +211,7 @@ namespace Loki
|
|||
typedef NullType Result;
|
||||
};
|
||||
|
||||
template <class T> struct Append<NullType, T>
|
||||
template <class T> struct Append<NullType, T>
|
||||
{
|
||||
typedef Typelist<T,NullType> Result;
|
||||
};
|
||||
|
|
|
@ -158,7 +158,7 @@ struct DefaultCatchAll
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define LOKI_DEFINE_VISITABLE() \
|
||||
virtual ReturnType Accept(::Loki::BaseVisitor& guest) \
|
||||
virtual ReturnType Accept(::Loki::BaseVisitor& guest) \
|
||||
{ return AcceptImpl(*this, guest); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue