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 
40 template<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 
51 template<>
53 {
54  return value;
55 }
56 
57 template<>
58 inline vtkVariant vtkVariantCreate<unsigned char>(const unsigned char& value)
59 {
60  return value;
61 }
62 
63 template<>
65 {
66  return value;
67 }
68 
69 template<>
70 inline vtkVariant vtkVariantCreate<unsigned short>(const unsigned short& value)
71 {
72  return value;
73 }
74 
75 template<>
77 {
78  return value;
79 }
80 
81 template<>
82 inline vtkVariant vtkVariantCreate<unsigned int>(const unsigned int& value)
83 {
84  return value;
85 }
86 
87 template<>
89 {
90  return value;
91 }
92 
93 template<>
94 inline vtkVariant vtkVariantCreate<unsigned long>(const unsigned long& value)
95 {
96  return value;
97 }
98 
99 template<>
101 {
102  return value;
103 }
104 
105 template<>
106 inline vtkVariant vtkVariantCreate<unsigned long long>(const unsigned long long& value)
107 {
108  return value;
109 }
110 
111 template<>
113 {
114  return value;
115 }
116 
117 template<>
119 {
120  return value;
121 }
122 
123 template<>
125 {
126  return value;
127 }
128 
129 template<>
131 {
132  return value;
133 }
134 
135 template<>
137 {
138  return value;
139 }
140 
141 #endif
142 
143 // VTK-HeaderTest-Exclude: vtkVariantCreate.h
vtkX3D::value
Definition: vtkX3D.h:220
vtkVariantCreate< double >
vtkVariant vtkVariantCreate< double >(const double &value)
Definition: vtkVariantCreate.h:118
vtkVariantCreate
vtkVariant vtkVariantCreate(const T &)
Definition: vtkVariantCreate.h:41
vtkVariantCreate< short >
vtkVariant vtkVariantCreate< short >(const short &value)
Definition: vtkVariantCreate.h:64
vtkVariantCreate< unsigned int >
vtkVariant vtkVariantCreate< unsigned int >(const unsigned int &value)
Definition: vtkVariantCreate.h:82
vtkVariantCreate< int >
vtkVariant vtkVariantCreate< int >(const int &value)
Definition: vtkVariantCreate.h:76
vtkVariantCreate< vtkUnicodeString >
vtkVariant vtkVariantCreate< vtkUnicodeString >(const vtkUnicodeString &value)
Definition: vtkVariantCreate.h:130
vtkVariantCreate< unsigned short >
vtkVariant vtkVariantCreate< unsigned short >(const unsigned short &value)
Definition: vtkVariantCreate.h:70
vtkVariantCreate< vtkStdString >
vtkVariant vtkVariantCreate< vtkStdString >(const vtkStdString &value)
Definition: vtkVariantCreate.h:124
vtkVariantCreate< unsigned long long >
vtkVariant vtkVariantCreate< unsigned long long >(const unsigned long long &value)
Definition: vtkVariantCreate.h:106
vtkUnicodeString
String class that stores Unicode text.
Definition: vtkUnicodeString.h:72
vtkVariant
A atomic type representing the union of many types.
Definition: vtkVariant.h:71
vtkX3D::name
Definition: vtkX3D.h:219
vtkVariantCreate< float >
vtkVariant vtkVariantCreate< float >(const float &value)
Definition: vtkVariantCreate.h:112
vtkVariantCreate< unsigned long >
vtkVariant vtkVariantCreate< unsigned long >(const unsigned long &value)
Definition: vtkVariantCreate.h:94
vtkVariantCreate< char >
vtkVariant vtkVariantCreate< char >(const char &value)
Definition: vtkVariantCreate.h:52
vtkVariantCreate< long >
vtkVariant vtkVariantCreate< long >(const long &value)
Definition: vtkVariantCreate.h:88
vtkVariantCreate< long long >
vtkVariant vtkVariantCreate< long long >(const long long &value)
Definition: vtkVariantCreate.h:100
vtkVariantCreate< unsigned char >
vtkVariant vtkVariantCreate< unsigned char >(const unsigned char &value)
Definition: vtkVariantCreate.h:58
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:40
vtkVariantCreate< vtkVariant >
vtkVariant vtkVariantCreate< vtkVariant >(const vtkVariant &value)
Definition: vtkVariantCreate.h:136