24 #ifndef PXR_USD_SDF_REFERENCE_H 25 #define PXR_USD_SDF_REFERENCE_H 30 #include "pxr/usd/sdf/api.h" 33 #include "pxr/usd/sdf/path.h" 36 #include "pxr/base/vt/value.h" 38 #include <boost/operators.hpp> 44 PXR_NAMESPACE_OPEN_SCOPE
48 typedef std::vector<SdfReference> SdfReferenceVector;
86 const std::string &assetPath = std::string(),
122 _primPath = primPath;
134 _layerOffset = layerOffset;
146 _customData = customData;
157 _customData.
swap(customData);
166 friend inline size_t hash_value(
const SdfReference &r) {
187 return lhs._assetPath == rhs._assetPath &&
188 lhs._primPath == rhs._primPath;
197 return lhs._assetPath < rhs._assetPath ||
198 (lhs._assetPath == rhs._assetPath &&
199 lhs._primPath < rhs._primPath);
205 std::string _assetPath;
228 const SdfReferenceVector &references,
232 SDF_API std::ostream &
operator<<( std::ostream &out,
235 PXR_NAMESPACE_CLOSE_SCOPE
237 #endif // PXR_USD_SDF_REFERENCE_H SDF_API bool operator<(const SdfReference &rhs) const
Returns whether this reference is less than rhs.
SDF_API bool operator==(const SdfReference &rhs) const
Returns whether this reference equals rhs.
const SdfLayerOffset & GetLayerOffset() const
Returns the layer offset associated with the reference.
SDF_API std::ostream & operator<<(std::ostream &out, const SdfReference &reference)
Writes the string representation of SdfReference to out.
void SetCustomData(const VtDictionary &customData)
Sets the custom data associated with the reference.
VT_API void swap(VtDictionary &dict)
Swaps the contents of two VtDictionaries.
void SetLayerOffset(const SdfLayerOffset &layerOffset)
Sets a new layer offset.
A map with string keys and VtValue values.
void SetAssetPath(const std::string &assetPath)
Sets the asset path for the root layer of the referenced layer stack.
Struct that defines equality of SdfReferences based on their identity (the asset path and prim path).
static size_t Combine(Args &&... args)
Produce a hash code by combining the hash codes of several objects.
const std::string & GetAssetPath() const
Returns the asset path to the root layer of the referenced layer stack.
const std::string & GetAssetPath() const &
Return the asset path.
Struct that defines a strict weak ordering of SdfReferences based on their identity (the asset path a...
A path value used to locate objects in layers or scenegraphs.
void SetPrimPath(const SdfPath &primPath)
Sets the path of the referenced prim.
Represents a reference and all its meta data.
void SwapCustomData(VtDictionary &customData)
Swaps the custom data dictionary for this reference.
const VtDictionary & GetCustomData() const
Returns the custom data associated with the reference.
Contains an asset path and an optional resolved path.
const SdfPath & GetPrimPath() const
Returns the path of the referenced prim.
SDF_API int SdfFindReferenceByIdentity(const SdfReferenceVector &references, const SdfReference &referenceId)
Convenience function to find the index of the reference in references that has the same identity as t...
SDF_API bool IsInternal() const
Returns true in the case of an internal reference.
Represents a time offset and scale between layers.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
SDF_API SdfReference(const std::string &assetPath=std::string(), const SdfPath &primPath=SdfPath(), const SdfLayerOffset &layerOffset=SdfLayerOffset(), const VtDictionary &customData=VtDictionary())
Creates a reference with all its meta data.