This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
site.h
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_USD_PCP_SITE_H
8#define PXR_USD_PCP_SITE_H
9
10#include "pxr/pxr.h"
11#include "pxr/usd/pcp/api.h"
13#include "pxr/usd/sdf/path.h"
14#include "pxr/usd/sdf/types.h"
16
17#include <iosfwd>
18
19PXR_NAMESPACE_OPEN_SCOPE
20
23
29{
30public:
31 PcpLayerStackIdentifier layerStackIdentifier;
32 SdfPath path;
33
34 PCP_API
35 PcpSite();
36
37 PCP_API
38 PcpSite( const PcpLayerStackIdentifier &, const SdfPath & path );
39 PCP_API
40 PcpSite( const PcpLayerStackPtr &, const SdfPath & path );
41 PCP_API
42 PcpSite( const SdfLayerHandle &, const SdfPath & path );
43 PCP_API
44 PcpSite( const PcpLayerStackSite & );
45
46 PCP_API
47 bool operator==(const PcpSite &rhs) const;
48
49 bool operator!=(const PcpSite &rhs) const {
50 return !(*this == rhs);
51 }
52
53 PCP_API
54 bool operator<(const PcpSite &rhs) const;
55
56 bool operator<=(const PcpSite &rhs) const {
57 return !(rhs < *this);
58 }
59
60 bool operator>(const PcpSite &rhs) const {
61 return rhs < *this;
62 }
63
64 bool operator>=(const PcpSite &rhs) const {
65 return !(*this < rhs);
66 }
67
68 struct Hash {
69 PCP_API
70 size_t operator()(const PcpSite &) const;
71 };
72};
73
79{
80public:
81 PcpLayerStackRefPtr layerStack;
82 SdfPath path;
83
84 PCP_API
86
87 PCP_API
88 PcpLayerStackSite( const PcpLayerStackRefPtr &, const SdfPath & path );
89
90 PCP_API
91 bool operator==(const PcpLayerStackSite &rhs) const;
92
93 bool operator!=(const PcpLayerStackSite &rhs) const {
94 return !(*this == rhs);
95 }
96
97 PCP_API
98 bool operator<(const PcpLayerStackSite &rhs) const;
99
100 bool operator<=(const PcpLayerStackSite &rhs) const {
101 return !(rhs < *this);
102 }
103
104 bool operator>(const PcpLayerStackSite &rhs) const {
105 return rhs < *this;
106 }
107
108 bool operator>=(const PcpLayerStackSite &rhs) const {
109 return !(*this < rhs);
110 }
111
112
113 struct Hash {
114 PCP_API
115 size_t operator()(const PcpLayerStackSite &) const;
116 };
117};
118
119PCP_API
120std::ostream& operator<<(std::ostream&, const PcpSite&);
121PCP_API
122std::ostream& operator<<(std::ostream&, const PcpLayerStackSite&);
123
124static inline
125size_t
126hash_value(const PcpSite& site)
127{
128 return PcpSite::Hash()(site);
129}
130
131static inline
132size_t
133hash_value(const PcpLayerStackSite& site)
134{
135 return PcpLayerStackSite::Hash()(site);
136}
137
138PXR_NAMESPACE_CLOSE_SCOPE
139
140#endif // PXR_USD_PCP_SITE_H
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:50
Arguments used to identify a layer stack.
A site specifies a path in a layer stack of scene description.
Definition: site.h:79
A site specifies a path in a layer stack of scene description.
Definition: site.h:29
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Standard pointer typedefs.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:72
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:28
Basic Sdf data types.