CLAM-Development  1.4.0
TypeInfo.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
3  * UNIVERSITAT POMPEU FABRA
4  *
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
22 #ifndef _TYPEINFO_H_
23 #define _TYPEINFO_H_
24 
25 //class StaticTrue {};
26 //class StaticFalse {};
27 #include "StaticBool.hxx"
28 
29 namespace CLAM {
30  bool SameType(const std::type_info & type1, const std::type_info & type2);
31 
33  public:
37  };
38 
41  public:
43  };
44 
46  public:
48  };
49 
50  // Default TypeInfo definition
51  template <typename T> class TypeInfo : public DefaultTypeInfo {};
52 
53  // A short for defining a class belonging to a TypeInfo group
54 #define CLAM_TYPEINFOGROUP(GROUP, TYPE) \
55  template <> class TypeInfo< TYPE > : public GROUP {};
56 
57  CLAM_TYPEINFOGROUP(BasicCTypeInfo, char);
58  CLAM_TYPEINFOGROUP(BasicCTypeInfo, unsigned char);
59  CLAM_TYPEINFOGROUP(BasicCTypeInfo, signed char);
60  CLAM_TYPEINFOGROUP(BasicCTypeInfo, const char);
61  CLAM_TYPEINFOGROUP(BasicCTypeInfo, const unsigned char);
62  CLAM_TYPEINFOGROUP(BasicCTypeInfo, const signed char);
63  CLAM_TYPEINFOGROUP(BasicCTypeInfo, char *);
64  CLAM_TYPEINFOGROUP(BasicCTypeInfo, unsigned char *);
65  CLAM_TYPEINFOGROUP(BasicCTypeInfo, signed char *);
66  CLAM_TYPEINFOGROUP(BasicCTypeInfo, const char *);
67  CLAM_TYPEINFOGROUP(BasicCTypeInfo, const unsigned char *);
68  CLAM_TYPEINFOGROUP(BasicCTypeInfo, const signed char *);
69 
70  CLAM_TYPEINFOGROUP(BasicCTypeInfo, void *);
71  CLAM_TYPEINFOGROUP(BasicCTypeInfo, short int);
72  CLAM_TYPEINFOGROUP(BasicCTypeInfo, short unsigned int);
73  CLAM_TYPEINFOGROUP(BasicCTypeInfo, int);
74  CLAM_TYPEINFOGROUP(BasicCTypeInfo, unsigned int);
75  CLAM_TYPEINFOGROUP(BasicCTypeInfo, long);
76  CLAM_TYPEINFOGROUP(BasicCTypeInfo, unsigned long);
77  CLAM_TYPEINFOGROUP(BasicCTypeInfo, bool);
78  CLAM_TYPEINFOGROUP(BasicCTypeInfo, double);
79  CLAM_TYPEINFOGROUP(BasicCTypeInfo, float);
80 
81 }
82 
83 
84 #endif//_TYPEINFO_H_
85 
86