Loading...
Searching...
No Matches
layerStackIdentifier.h
Go to the documentation of this file.
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 PXR_USD_PCP_LAYER_STACK_IDENTIFIER_H
25#define PXR_USD_PCP_LAYER_STACK_IDENTIFIER_H
26
28
29#include "pxr/pxr.h"
30#include "pxr/usd/pcp/api.h"
31#include "pxr/usd/pcp/expressionVariablesSource.h"
32
35
36#include <iosfwd>
37
38PXR_NAMESPACE_OPEN_SCOPE
39
40SDF_DECLARE_HANDLES(SdfLayer);
41
49public:
51
53 PCP_API
55
58 PCP_API
60 const SdfLayerHandle& rootLayer,
61 const SdfLayerHandle& sessionLayer = TfNullPtr,
65
66 // XXX: Allow assignment because there are clients using this
67 // as a member that themselves want to be assignable.
68 PCP_API
70
71 // Validity.
72 PCP_API
73 explicit operator bool() const;
74
75 // Comparison.
76 PCP_API
77 bool operator==(const This &rhs) const;
78 bool operator!=(const This &rhs) const
79 {
80 return !(rhs == *this);
81 }
82
83 PCP_API
84 bool operator<(const This &rhs) const;
85 bool operator<=(const This& rhs) const
86 {
87 return !(rhs < *this);
88 }
89 bool operator>(const This& rhs) const
90 {
91 return rhs < *this;
92 }
93 bool operator>=(const This& rhs) const
94 {
95 return !(*this < rhs);
96 }
97
98 // Hashing.
99 struct Hash {
100 size_t operator()(const This & x) const
101 {
102 return x.GetHash();
103 }
104 };
105 size_t GetHash() const
106 {
107 return _hash;
108 }
109
110public:
112 const SdfLayerHandle rootLayer;
113
115 const SdfLayerHandle sessionLayer;
116
119
123
124private:
125 size_t _ComputeHash() const;
126
127private:
128 const size_t _hash;
129};
130
131template <typename HashState>
132inline void
133TfHashAppend(HashState& h, const PcpLayerStackIdentifier& x)
134{
135 h.Append(x.GetHash());
136}
137
138inline
139size_t
141{
142 return TfHash{}(x);
143}
144
145PCP_API
146std::ostream& operator<<(std::ostream&, const PcpLayerStackIdentifier&);
147
151PCP_API
152std::ostream& PcpIdentifierFormatBaseName(std::ostream&);
153
157PCP_API
158std::ostream& PcpIdentifierFormatRealPath(std::ostream&);
159
164PCP_API
165std::ostream& PcpIdentifierFormatIdentifier(std::ostream&);
166
167PXR_NAMESPACE_CLOSE_SCOPE
168
169#endif // PXR_USD_PCP_LAYER_STACK_IDENTIFIER_H
An asset resolver context allows clients to provide additional data to the resolver for use during re...
Represents the layer stack associated with a set of expression variables.
Arguments used to identify a layer stack.
PCP_API PcpLayerStackIdentifier(const SdfLayerHandle &rootLayer, const SdfLayerHandle &sessionLayer=TfNullPtr, const ArResolverContext &pathResolverContext=ArResolverContext(), const PcpExpressionVariablesSource &expressionVariablesOverrideSource=PcpExpressionVariablesSource())
Construct with given pointers.
const ArResolverContext pathResolverContext
The path resolver context used for resolving asset paths. (optional)
const PcpExpressionVariablesSource expressionVariablesOverrideSource
The source for expression variables that compose over the expression variables in this layer stack.
PCP_API PcpLayerStackIdentifier()
Construct with all empty pointers.
const SdfLayerHandle rootLayer
The root layer.
const SdfLayerHandle sessionLayer
The session layer (optional).
A scene description container that can combine with other such containers to form simple component as...
Definition: layer.h:100
A user-extensible hashing mechanism for use with runtime hash tables.
Definition: hash.h:477
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
size_t hash_value(const half h)
Overload hash_value for half.
Definition: half.h:45
PCP_API std::ostream & PcpIdentifierFormatBaseName(std::ostream &)
Manipulator to cause the next PcpLayerStackIdentifier written to the ostream to write the base name o...
PCP_API std::ostream & PcpIdentifierFormatRealPath(std::ostream &)
Manipulator to cause the next PcpLayerStackIdentifier written to the ostream to write the real path o...
PCP_API std::ostream & PcpIdentifierFormatIdentifier(std::ostream &)
Manipulator to cause the next PcpLayerStackIdentifier written to the ostream to write the identifier ...