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 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 
20 
22 class PcpLayerStackSite;
23 
24 /// \class PcpSite
25 ///
26 /// A site specifies a path in a layer stack of scene description.
27 ///
28 class PcpSite
29 {
30 public:
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 
74 /// \class PcpLayerStackSite
75 ///
76 /// A site specifies a path in a layer stack of scene description.
77 ///
79 {
80 public:
81  PcpLayerStackRefPtr layerStack;
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 
119 PCP_API
120 std::ostream& operator<<(std::ostream&, const PcpSite&);
121 PCP_API
122 std::ostream& operator<<(std::ostream&, const PcpLayerStackSite&);
123 
124 static inline
125 size_t
126 hash_value(const PcpSite& site)
127 {
128  return PcpSite::Hash()(site);
129 }
130 
131 static inline
132 size_t
133 hash_value(const PcpLayerStackSite& site)
134 {
135  return PcpLayerStackSite::Hash()(site);
136 }
137 
139 
140 #endif // PXR_USD_PCP_SITE_H
bool operator>=(const PcpLayerStackSite &rhs) const
Definition: site.h:108
bool operator>=(const PcpSite &rhs) const
Definition: site.h:64
PcpLayerStackIdentifier layerStackIdentifier
Definition: site.h:31
STATIC_INLINE size_t Hash(const char *s, size_t len)
Definition: farmhash.h:2099
PCP_API size_t operator()(const PcpLayerStackSite &) const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
Definition: site.h:28
PCP_API std::ostream & operator<<(std::ostream &, const PcpSite &)
PcpLayerStackRefPtr layerStack
Definition: site.h:81
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:93
PCP_API PcpSite()
bool operator<=(const PcpSite &rhs) const
Definition: site.h:56
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_AND_REF_PTRS(PcpLayerStack)
bool operator<=(const PcpLayerStackSite &rhs) const
Definition: site.h:100
PCP_API PcpLayerStackSite()
PCP_API bool operator<(const PcpLayerStackSite &rhs) const
Definition: path.h:273
SdfPath path
Definition: site.h:82
PCP_API bool operator==(const PcpSite &rhs) const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
PCP_API size_t operator()(const PcpSite &) const
bool operator!=(const PcpSite &rhs) const
Definition: site.h:49
SdfPath path
Definition: site.h:32
bool operator>(const PcpSite &rhs) const
Definition: site.h:60
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
bool operator>(const PcpLayerStackSite &rhs) const
Definition: site.h:104
size_t hash_value(const CH_ChannelRef &ref)
#define PCP_API
Definition: api.h:23