#ifndef __JTOOLS__JMAPLIST__ #define __JTOOLS__JMAPLIST__ #include "JLang/JNullType.hh" #include "JTools/JDistance.hh" /** * \author mdejong */ namespace JTOOLS {} namespace JPP { using namespace JTOOLS; } namespace JTOOLS { using JLANG::JNullType; /** * Map list. */ template class JHead_t, class JTail_t = JNullType> struct JMapList { typedef JMapList head_list; //!< first N-1 maps typedef typename JTail_t::tail_type tail_type; //!< last map }; /** * Terminator class of map list. */ template class JHead_t> struct JMapList { typedef JNullType head_list; //!< first N-1 maps typedef JMapList tail_type; //!< last map }; /** * Length of map list. */ template struct JMapLength {}; /** * Recursive length of map list. */ template class JHead_t, class JTail_t> struct JMapLength< JMapList > { enum { value = 1 + JMapLength::value }; }; /** * Terminator class of length of map list. */ template class JHead_t> struct JMapLength< JMapList > { enum { value = 1 }; }; /** * Auxiliary class for no map definition. * This class can be used to terminate a map list, define a default template argument, etc. */ template > struct JNullMap {}; /** * Auxiliary class for recursive map list generation. * This class accepts up to 26 map types. */ template class A = JNullMap, template class B = JNullMap, template class C = JNullMap, template class D = JNullMap, template class E = JNullMap, template class F = JNullMap, template class G = JNullMap, template class H = JNullMap, template class I = JNullMap, template class J = JNullMap, template class K = JNullMap, template class L = JNullMap, template class M = JNullMap, template class N = JNullMap, template class O = JNullMap, template class P = JNullMap, template class Q = JNullMap, template class R = JNullMap, template class S = JNullMap, template class T = JNullMap, template class U = JNullMap, template class V = JNullMap, template class W = JNullMap, template class X = JNullMap, template class Y = JNullMap, template class Z = JNullMap> struct JMAPLIST { typedef JMapList::maplist> maplist; //!< Map list }; /** * Template specialisation to terminate recursive map list generation. */ template class A> struct JMAPLIST { typedef JMapList maplist; //!< Map list }; } #endif