HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
site.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_SITE_H
25 #define PXR_USD_PCP_SITE_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/usd/pcp/api.h"
30 #include "pxr/usd/sdf/path.h"
31 #include "pxr/usd/sdf/types.h"
33 
34 #include <iosfwd>
35 
37 
39 class PcpLayerStackSite;
40 
41 /// \class PcpSite
42 ///
43 /// A site specifies a path in a layer stack of scene description.
44 ///
45 class PcpSite
46 {
47 public:
50 
51  PCP_API
52  PcpSite();
53 
54  PCP_API
55  PcpSite( const PcpLayerStackIdentifier &, const SdfPath & path );
56  PCP_API
57  PcpSite( const PcpLayerStackPtr &, const SdfPath & path );
58  PCP_API
59  PcpSite( const SdfLayerHandle &, const SdfPath & path );
60  PCP_API
61  PcpSite( const PcpLayerStackSite & );
62 
63  PCP_API
64  bool operator==(const PcpSite &rhs) const;
65 
66  bool operator!=(const PcpSite &rhs) const {
67  return !(*this == rhs);
68  }
69 
70  PCP_API
71  bool operator<(const PcpSite &rhs) const;
72 
73  bool operator<=(const PcpSite &rhs) const {
74  return !(rhs < *this);
75  }
76 
77  bool operator>(const PcpSite &rhs) const {
78  return rhs < *this;
79  }
80 
81  bool operator>=(const PcpSite &rhs) const {
82  return !(*this < rhs);
83  }
84 
85  struct Hash {
86  PCP_API
87  size_t operator()(const PcpSite &) const;
88  };
89 };
90 
91 /// \class PcpLayerStackSite
92 ///
93 /// A site specifies a path in a layer stack of scene description.
94 ///
96 {
97 public:
98  PcpLayerStackRefPtr layerStack;
100 
101  PCP_API
103 
104  PCP_API
105  PcpLayerStackSite( const PcpLayerStackRefPtr &, const SdfPath & path );
106 
107  PCP_API
108  bool operator==(const PcpLayerStackSite &rhs) const;
109 
110  bool operator!=(const PcpLayerStackSite &rhs) const {
111  return !(*this == rhs);
112  }
113 
114  PCP_API
115  bool operator<(const PcpLayerStackSite &rhs) const;
116 
117  bool operator<=(const PcpLayerStackSite &rhs) const {
118  return !(rhs < *this);
119  }
120 
121  bool operator>(const PcpLayerStackSite &rhs) const {
122  return rhs < *this;
123  }
124 
125  bool operator>=(const PcpLayerStackSite &rhs) const {
126  return !(*this < rhs);
127  }
128 
129 
130  struct Hash {
131  PCP_API
132  size_t operator()(const PcpLayerStackSite &) const;
133  };
134 };
135 
136 PCP_API
137 std::ostream& operator<<(std::ostream&, const PcpSite&);
138 PCP_API
139 std::ostream& operator<<(std::ostream&, const PcpLayerStackSite&);
140 
141 static inline
142 size_t
143 hash_value(const PcpSite& site)
144 {
145  return PcpSite::Hash()(site);
146 }
147 
148 static inline
149 size_t
150 hash_value(const PcpLayerStackSite& site)
151 {
152  return PcpLayerStackSite::Hash()(site);
153 }
154 
156 
157 #endif // PXR_USD_PCP_SITE_H
bool operator>=(const PcpLayerStackSite &rhs) const
Definition: site.h:125
bool operator>=(const PcpSite &rhs) const
Definition: site.h:81
PcpLayerStackIdentifier layerStackIdentifier
Definition: site.h:48
STATIC_INLINE size_t Hash(const char *s, size_t len)
Definition: farmhash.h:2038
PCP_API size_t operator()(const PcpLayerStackSite &) const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
Definition: site.h:45
PCP_API std::ostream & operator<<(std::ostream &, const PcpSite &)
PcpLayerStackRefPtr layerStack
Definition: site.h:98
PCP_API bool operator<(const PcpSite &rhs) const
PCP_API bool operator==(const PcpLayerStackSite &rhs) const
bool operator!=(const PcpLayerStackSite &rhs) const
Definition: site.h:110
PCP_API PcpSite()
bool operator<=(const PcpSite &rhs) const
Definition: site.h:73
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_AND_REF_PTRS(PcpLayerStack)
bool operator<=(const PcpLayerStackSite &rhs) const
Definition: site.h:117
PCP_API PcpLayerStackSite()
PCP_API bool operator<(const PcpLayerStackSite &rhs) const
Definition: path.h:291
SdfPath path
Definition: site.h:99
PCP_API bool operator==(const PcpSite &rhs) const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
PCP_API size_t operator()(const PcpSite &) const
bool operator!=(const PcpSite &rhs) const
Definition: site.h:66
SdfPath path
Definition: site.h:49
bool operator>(const PcpSite &rhs) const
Definition: site.h:77
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
bool operator>(const PcpLayerStackSite &rhs) const
Definition: site.h:121
size_t hash_value(const CH_ChannelRef &ref)
#define PCP_API
Definition: api.h:40