fw4spl
DynamicTypeKeyTypeMapping.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "fwTools/DynamicTypeKeyTypeMapping.hpp"
8 
9 
10 namespace fwTools
11 {
12 /*
13  * @brief template specialization for defining KeyType mapping ( here DynamicType) with their value
14  * @auhtor Vincent Agnus
15  */
16 
17 
18 // FIX UNSIGNED
19 template<>
21 {
22  return key.isType<unsigned char>();
23 }
24 template<>
26 {
27  return key.isType<unsigned short>();
28 }
29 template<>
31 {
32  return key.isType<unsigned int>();
33 }
34 template<>
36 {
37  return key.isType<unsigned long>();
38 }
39 
40 // FIXED PRECISION SIGNED
41 template<>
43 {
44  return key.isType<signed char>();
45 }
46 template<>
48 {
49  return key.isType<signed short>();
50 }
51 template<>
53 {
54  return key.isType<signed int>();
55 }
56 
57 template<>
59 {
60  return key.isType<signed long>();
61 }
62 
63 
64 // FLOATING PRECISION
65 template<>
66 bool isMapping<float>(const DynamicType &key)
67 {
68  return key.isType<float>();
69 }
70 template<>
72 {
73  return key.isType<double>();
74 }
75 
76 // MISC
77 template<>
78 bool isMapping<std::string>(const DynamicType &key)
79 {
80  return key.isType<std::string>();
81 }
82 
83 
84 
85 } // end namespace fwTools {
86 
FWTOOLS_API bool isMapping< float >(const DynamicType &key)
Template specialization for defining KeyType mapping ( here DynamicType) with their value...
FWTOOLS_API bool isMapping< unsigned char >(const DynamicType &key)
Template specialization for defining KeyType mapping ( here DynamicType) with their value...
The namespace fwTools contains several tools like UUID, factory, dispatche, stringizer, macros, helper.
FWTOOLS_API bool isMapping< signed char >(const DynamicType &key)
Template specialization for defining KeyType mapping ( here DynamicType) with their value...
FWTOOLS_API bool isMapping< unsigned int >(const DynamicType &key)
Template specialization for defining KeyType mapping ( here DynamicType) with their value...
Class defining an elementary C++ type aka unsigned char, signed char, .... signed long...
Definition: DynamicType.hpp:31
FWTOOLS_API bool isMapping< signed long >(const DynamicType &key)
Template specialization for defining KeyType mapping ( here DynamicType) with their value...
FWTOOLS_API bool isMapping< double >(const DynamicType &key)
Template specialization for defining KeyType mapping ( here DynamicType) with their value...
FWTOOLS_API bool isMapping< signed int >(const DynamicType &key)
Template specialization for defining KeyType mapping ( here DynamicType) with their value...
FWTOOLS_API bool isMapping< signed short >(const DynamicType &key)
Template specialization for defining KeyType mapping ( here DynamicType) with their value...
FWTOOLS_API bool isMapping< unsigned long >(const DynamicType &key)
Template specialization for defining KeyType mapping ( here DynamicType) with their value...
FWTOOLS_API bool isMapping< unsigned short >(const DynamicType &key)
Template specialization for defining KeyType mapping ( here DynamicType) with their value...