All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
valueTypePrivate.h
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef SDF_VALUETYPEPRIVATE_H
25 #define SDF_VALUETYPEPRIVATE_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/usd/sdf/valueTypeName.h"
29 #include "pxr/base/tf/enum.h"
30 #include "pxr/base/tf/type.h"
31 #include "pxr/base/vt/value.h"
32 #include <vector>
33 
34 PXR_NAMESPACE_OPEN_SCOPE
35 
36 class Sdf_ValueTypeImpl;
37 
38 struct Sdf_ValueTypePrivate {
39 public:
40  struct Empty { };
41 
42  // Represents a type/role pair.
43  struct CoreType {
44  CoreType() { }
45  CoreType(Empty);
46 
47  TfType type;
48  std::string cppTypeName;
49  TfToken role;
51  VtValue value;
52  TfEnum unit;
53 
54  // All type names aliasing this type/role pair in registration order.
55  // The first alias is the "fundamental" type name.
56  std::vector<TfToken> aliases;
57  };
58 
60  static SdfValueTypeName MakeValueTypeName(const Sdf_ValueTypeImpl* impl);
61 
63  static const Sdf_ValueTypeImpl* GetEmptyTypeName();
64 };
65 
67 class Sdf_ValueTypeImpl {
68 public:
69  Sdf_ValueTypeImpl();
70 
71  const Sdf_ValueTypePrivate::CoreType* type;
72  TfToken name;
73  const Sdf_ValueTypeImpl* scalar;
74  const Sdf_ValueTypeImpl* array;
75 };
76 
77 PXR_NAMESPACE_CLOSE_SCOPE
78 
79 #endif // SDF_VALUETYPEPRIVATE_H
An enum class that records both enum type and enum value.
Definition: enum.h:140
Represents a value type name, i.e.
Definition: valueTypeName.h:83
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
TfType represents a dynamic runtime type.
Definition: type.h:70
Represents the shape of a value type (or that of an element in an array).
Definition: valueTypeName.h:46
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182