Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# KeosTypelist.h

Go to the documentation of this file.

    00001 /*
    00002  * This source file is part of KEOS (Free 3D Engine)
    00003  * For the latest info, see http://www.keosengine.org/
    00004  * E-mails : thierry.vouriot@keosengine.org, yeri@keosengine.org
    00005  *
    00006  * This program is free software; you can redistribute it and/or modify it under
    00007  * the terms of the GNU Lesser General Public License as published by the Free Software
    00008  * Foundation; either version 2 of the License, or (at your option) any later
    00009  * version.
    00010  *
    00011  * This program is distributed in the hope that it will be useful, but WITHOUT
    00012  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    00013  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    00014  *
    00015  * You should have received a copy of the GNU Lesser General Public License along with
    00016  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    00017  * Place - Suite 330, Boston, MA 02111-1307, USA, or go to
    00018  * http://www.gnu.org/copyleft/lesser.txt.
    00019  *
    00020  */
    00021 #ifndef KEOS_TYPELIST_H
    00022 #define KEOS_TYPELIST_H
    00023
    00024 namespace Keos
    00025 {
    00027     template <class T1, class T2>
    00028     struct TypeList
    00029     {
    00030         typedef T1 Head;
    00031         typedef T2 Tail;
    00032     };
    00033
    00035     struct NullType {};
    00036
    00037     // Macros to build typelists
    00038     #define TYPELIST_1(t1)                                 TypeList<t1, NullType>
    00039     #define TYPELIST_2(t1, t2)                             TypeList<t1, TYPELIST_1(t2) >
    00040     #define TYPELIST_3(t1, t2, t3)                         TypeList<t1, TYPELIST_2(t2, t3) >
    00041     #define TYPELIST_4(t1, t2, t3, t4)                     TypeList<t1, TYPELIST_3(t2, t3, t4) >
    00042     #define TYPELIST_5(t1, t2, t3, t4, t5)                 TypeList<t1, TYPELIST_4(t2, t3, t4, t5) >
    00043     #define TYPELIST_6(t1, t2, t3, t4, t5, t6)             TypeList<t1, TYPELIST_5(t2, t3, t4, t5, t6) >
    00044     #define TYPELIST_7(t1, t2, t3, t4, t5, t6, t7)         TypeList<t1, TYPELIST_6(t2, t3, t4, t5, t6, t7) >
    00045     #define TYPELIST_8(t1, t2, t3, t4, t5, t6, t7, t8)     TypeList<t1, TYPELIST_7(t2, t3, t4, t5, t6, t7, t8) >
    00046     #define TYPELIST_9(t1, t2, t3, t4, t5, t6, t7, t8, t9) TypeList<t1, TYPELIST_8(t2, t3, t4, t5, t6, t7, t8, t9) >
    00047
    00048 } // namespace Keos
    00049
    00050
    00051 #endif // KEOS_TYPELIST_H