Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
TypeList.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SKYFIRE_TYPELIST_H
7#define SKYFIRE_TYPELIST_H
8
9/*
10 @struct TypeList
11 TypeList is the most simple but yet the most powerfull class of all. It holds
12 at compile time the different type of objects in a linked list.
13 */
14
15class TypeNull;
16
17template<typename HEAD, typename TAIL>
19{
20 typedef HEAD Head;
21 typedef TAIL Tail;
22};
23
24// enough for now.. can be expand at any point in time as needed
25#define TYPELIST_1(T1) TypeList<T1, TypeNull>
26#define TYPELIST_2(T1, T2) TypeList<T1, TYPELIST_1(T2) >
27#define TYPELIST_3(T1, T2, T3) TypeList<T1, TYPELIST_2(T2, T3) >
28#define TYPELIST_4(T1, T2, T3, T4) TypeList<T1, TYPELIST_3(T2, T3, T4) >
29#define TYPELIST_5(T1, T2, T3, T4, T5) TypeList<T1, TYPELIST_4(T2, T3, T4, T5) >
30#endif
31
TAIL Tail
Definition TypeList.h:21
HEAD Head
Definition TypeList.h:20