/*
 * This source file is part of KEOS (Free 3D Engine)
 * For the latest info, see http://www.keosengine.org/
 * E-mails : thierry.vouriot@keosengine.org, yeri@keosengine.org
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place - Suite 330, Boston, MA 02111-1307, USA, or go to
 * http://www.gnu.org/copyleft/lesser.txt.
 *
 */
#ifndef KEOS_TYPELIST_H
#define KEOS_TYPELIST_H

namespace Keos
{
    //! TypeList struct
    template <class T1, class T2>
    struct TypeList
    {
        typedef T1 Head;
        typedef T2 Tail;
    };

    //! List end marker
    struct NullType {};

    // Macros to build typelists
    #define TYPELIST_1(t1)                                 TypeList<t1, NullType>
    #define TYPELIST_2(t1, t2)                             TypeList<t1, TYPELIST_1(t2) >
    #define TYPELIST_3(t1, t2, t3)                         TypeList<t1, TYPELIST_2(t2, t3) >
    #define TYPELIST_4(t1, t2, t3, t4)                     TypeList<t1, TYPELIST_3(t2, t3, t4) >
    #define TYPELIST_5(t1, t2, t3, t4, t5)                 TypeList<t1, TYPELIST_4(t2, t3, t4, t5) >
    #define TYPELIST_6(t1, t2, t3, t4, t5, t6)             TypeList<t1, TYPELIST_5(t2, t3, t4, t5, t6) >
    #define TYPELIST_7(t1, t2, t3, t4, t5, t6, t7)         TypeList<t1, TYPELIST_6(t2, t3, t4, t5, t6, t7) >
    #define TYPELIST_8(t1, t2, t3, t4, t5, t6, t7, t8)     TypeList<t1, TYPELIST_7(t2, t3, t4, t5, t6, t7, t8) >
    #define TYPELIST_9(t1, t2, t3, t4, t5, t6, t7, t8, t9) TypeList<t1, TYPELIST_8(t2, t3, t4, t5, t6, t7, t8, t9) >

} // namespace Keos


#endif // KEOS_TYPELIST_H
