fw4spl
StringKeyTypeMapping.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/StringKeyTypeMapping.hpp"
8 
9 namespace fwTools
10 {
11 
12 /*
13  * @brief template specialization for defining KeyType mapping ( here std::string) with their value
14  * @auhtor Vincent Agnus
15  */
16 
17 
18 // FIX UNSIGNED
19 template<>
20 bool isMapping<unsigned char>(const std::string &key)
21 {
22  return key=="unsigned char";
23 }
24 template<>
25 bool isMapping<unsigned short>(const std::string &key)
26 {
27  return key=="unsigned short";
28 }
29 template<>
30 bool isMapping<unsigned int>(const std::string &key)
31 {
32  return key=="unsigned int";
33 }
34 template<>
35 bool isMapping<unsigned long>(const std::string &key)
36 {
37  return key=="unsigned long";
38 }
39 
40 // FIXED PRECISION SIGNED
41 template<>
42 bool isMapping<signed char>(const std::string &key)
43 {
44  return key=="signed char";
45 }
46 template<>
47 bool isMapping<signed short>(const std::string &key)
48 {
49  return key=="signed short";
50 }
51 template<>
52 bool isMapping<signed int>(const std::string &key)
53 {
54  return key=="signed int";
55 }
56 
57 template<>
58 bool isMapping<signed long>(const std::string &key)
59 {
60  return key=="signed long";
61 }
62 
63 
64 // FLOATING PRECISION
65 template<>
66 bool isMapping<float>(const std::string &key)
67 {
68  return key=="float";
69 }
70 template<>
71 bool isMapping<double>(const std::string &key)
72 {
73  return key=="double";
74 }
75 
76 // MISC
77 template<>
78 bool isMapping<std::string>(const std::string &key)
79 {
80  return key=="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...
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...