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
35#ifndef vtkVariantCreate_h
36#define vtkVariantCreate_h
37
38#include <typeinfo> // for warnings
39
40template<typename T>
42{
43 vtkGenericWarningMacro(
44 << "Cannot convert unsupported type [" << typeid(T).name() << "] to vtkVariant. "
45 << "Create a vtkVariantCreate<> specialization to eliminate this warning."
46 );
47
48 return vtkVariant();
49}
50
51template<>
53{
54 return value;
55}
56
57template<>
59{
60 return value;
61}
62
63template<>
65{
66 return value;
67}
68
69template<>
71{
72 return value;
73}
74
75template<>
77{
78 return value;
79}
80
81template<>
83{
84 return value;
85}
86
87template<>
89{
90 return value;
91}
92
93template<>
95{
96 return value;
97}
98
99template<>
101{
102 return value;
103}
104
105template<>
107{
108 return value;
109}
110
111template<>
113{
114 return value;
115}
116
117template<>
119{
120 return value;
121}
122
123template<>
125{
126 return value;
127}
128
129template<>
131{
132 return value;
133}
134
135template<>
137{
138 return value;
139}
140
141#endif
142
143// VTK-HeaderTest-Exclude: vtkVariantCreate.h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
String class that stores Unicode text.
A atomic type representing the union of many types.
Definition: vtkVariant.h:76
@ value
Definition: vtkX3D.h:220
@ name
Definition: vtkX3D.h:219
vtkVariant vtkVariantCreate< vtkStdString >(const vtkStdString &value)
vtkVariant vtkVariantCreate< vtkUnicodeString >(const vtkUnicodeString &value)
vtkVariant vtkVariantCreate(const T &)
vtkVariant vtkVariantCreate< unsigned long >(const unsigned long &value)
vtkVariant vtkVariantCreate< float >(const float &value)
vtkVariant vtkVariantCreate< int >(const int &value)
vtkVariant vtkVariantCreate< unsigned short >(const unsigned short &value)
vtkVariant vtkVariantCreate< unsigned char >(const unsigned char &value)
vtkVariant vtkVariantCreate< unsigned int >(const unsigned int &value)
vtkVariant vtkVariantCreate< long >(const long &value)
vtkVariant vtkVariantCreate< double >(const double &value)
vtkVariant vtkVariantCreate< unsigned long long >(const unsigned long long &value)
vtkVariant vtkVariantCreate< short >(const short &value)
vtkVariant vtkVariantCreate< vtkVariant >(const vtkVariant &value)
vtkVariant vtkVariantCreate< long long >(const long long &value)
vtkVariant vtkVariantCreate< char >(const char &value)