VTK
vtkVariantCreate.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkVariantCreate.h
5 
6 -------------------------------------------------------------------------
7  Copyright 2008 Sandia Corporation.
8  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9  the U.S. Government retains certain rights in this software.
10 -------------------------------------------------------------------------
11 
12  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13  All rights reserved.
14  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
15 
16  This software is distributed WITHOUT ANY WARRANTY; without even
17  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18  PURPOSE. See the above copyright notice for more information.
19 
20 =========================================================================*/
21 
32 #ifndef vtkVariantCreate_h
33 #define vtkVariantCreate_h
34 
35 #include <typeinfo> // for warnings
36 
37 template<typename T>
39 {
40  vtkGenericWarningMacro(
41  << "Cannot convert unsupported type [" << typeid(T).name() << "] to vtkVariant. "
42  << "Create a vtkVariantCreate<> specialization to eliminate this warning."
43  );
44 
45  return vtkVariant();
46 }
47 
48 template<>
50 {
51  return value;
52 }
53 
54 template<>
55 inline vtkVariant vtkVariantCreate<unsigned char>(const unsigned char& value)
56 {
57  return value;
58 }
59 
60 template<>
62 {
63  return value;
64 }
65 
66 template<>
67 inline vtkVariant vtkVariantCreate<unsigned short>(const unsigned short& value)
68 {
69  return value;
70 }
71 
72 template<>
74 {
75  return value;
76 }
77 
78 template<>
79 inline vtkVariant vtkVariantCreate<unsigned int>(const unsigned int& value)
80 {
81  return value;
82 }
83 
84 template<>
86 {
87  return value;
88 }
89 
90 template<>
91 inline vtkVariant vtkVariantCreate<unsigned long>(const unsigned long& value)
92 {
93  return value;
94 }
95 
96 template<>
98 {
99  return value;
100 }
101 
102 template<>
103 inline vtkVariant vtkVariantCreate<unsigned long long>(const unsigned long long& value)
104 {
105  return value;
106 }
107 
108 template<>
110 {
111  return value;
112 }
113 
114 template<>
116 {
117  return value;
118 }
119 
120 template<>
122 {
123  return value;
124 }
125 
126 template<>
128 {
129  return value;
130 }
131 
132 template<>
134 {
135  return value;
136 }
137 
138 #endif
139 
140 // VTK-HeaderTest-Exclude: vtkVariantCreate.h
vtkX3D::value
Definition: vtkX3D.h:220
vtkVariantCreate< double >
vtkVariant vtkVariantCreate< double >(const double &value)
Definition: vtkVariantCreate.h:115
vtkVariantCreate
vtkVariant vtkVariantCreate(const T &)
Definition: vtkVariantCreate.h:38
vtkVariantCreate< short >
vtkVariant vtkVariantCreate< short >(const short &value)
Definition: vtkVariantCreate.h:61
vtkVariantCreate< unsigned int >
vtkVariant vtkVariantCreate< unsigned int >(const unsigned int &value)
Definition: vtkVariantCreate.h:79
vtkVariantCreate< int >
vtkVariant vtkVariantCreate< int >(const int &value)
Definition: vtkVariantCreate.h:73
vtkVariantCreate< vtkUnicodeString >
vtkVariant vtkVariantCreate< vtkUnicodeString >(const vtkUnicodeString &value)
Definition: vtkVariantCreate.h:127
vtkVariantCreate< unsigned short >
vtkVariant vtkVariantCreate< unsigned short >(const unsigned short &value)
Definition: vtkVariantCreate.h:67
vtkVariantCreate< vtkStdString >
vtkVariant vtkVariantCreate< vtkStdString >(const vtkStdString &value)
Definition: vtkVariantCreate.h:121
vtkVariantCreate< unsigned long long >
vtkVariant vtkVariantCreate< unsigned long long >(const unsigned long long &value)
Definition: vtkVariantCreate.h:103
vtkUnicodeString
String class that stores Unicode text.
Definition: vtkUnicodeString.h:69
vtkVariant
A atomic type representing the union of many types.
Definition: vtkVariant.h:65
vtkX3D::name
Definition: vtkX3D.h:219
vtkVariantCreate< float >
vtkVariant vtkVariantCreate< float >(const float &value)
Definition: vtkVariantCreate.h:109
vtkVariantCreate< unsigned long >
vtkVariant vtkVariantCreate< unsigned long >(const unsigned long &value)
Definition: vtkVariantCreate.h:91
vtkVariantCreate< char >
vtkVariant vtkVariantCreate< char >(const char &value)
Definition: vtkVariantCreate.h:49
vtkVariantCreate< long >
vtkVariant vtkVariantCreate< long >(const long &value)
Definition: vtkVariantCreate.h:85
vtkVariantCreate< long long >
vtkVariant vtkVariantCreate< long long >(const long long &value)
Definition: vtkVariantCreate.h:97
vtkVariantCreate< unsigned char >
vtkVariant vtkVariantCreate< unsigned char >(const unsigned char &value)
Definition: vtkVariantCreate.h:55
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
vtkVariantCreate< vtkVariant >
vtkVariant vtkVariantCreate< vtkVariant >(const vtkVariant &value)
Definition: vtkVariantCreate.h:133