7#ifndef PXR_USD_SDF_REFERENCE_H
8#define PXR_USD_SDF_REFERENCE_H
13#include "pxr/usd/sdf/api.h"
16#include "pxr/usd/sdf/path.h"
19#include "pxr/base/vt/value.h"
25PXR_NAMESPACE_OPEN_SCOPE
29typedef std::vector<SdfReference> SdfReferenceVector;
67 const std::string &assetPath = std::string(),
103 _primPath = primPath;
115 _layerOffset = layerOffset;
127 _customData = customData;
138 _customData.
swap(customData);
147 friend inline size_t hash_value(
const SdfReference &r) {
161 return !(*
this == rhs);
175 return !(rhs < *
this);
180 return !(*
this < rhs);
188 return lhs._assetPath == rhs._assetPath &&
189 lhs._primPath == rhs._primPath;
198 return lhs._assetPath < rhs._assetPath ||
199 (lhs._assetPath == rhs._assetPath &&
200 lhs._primPath < rhs._primPath);
206 std::string _assetPath;
229 const SdfReferenceVector &references,
236PXR_NAMESPACE_CLOSE_SCOPE
Contains an asset path and optional evaluated and resolved paths.
const std::string & GetAssetPath() const &
Return the asset path.
Represents a time offset and scale between layers.
A path value used to locate objects in layers or scenegraphs.
Represents a reference and all its meta data.
const VtDictionary & GetCustomData() const
Returns the custom data associated with the reference.
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.
SDF_API bool operator<(const SdfReference &rhs) const
Returns whether this reference is less than rhs.
const SdfLayerOffset & GetLayerOffset() const
Returns the layer offset associated with the reference.
void SwapCustomData(VtDictionary &customData)
Swaps the custom data dictionary for this reference.
void SetPrimPath(const SdfPath &primPath)
Sets the path of the referenced prim.
void SetLayerOffset(const SdfLayerOffset &layerOffset)
Sets a new layer offset.
void SetAssetPath(const std::string &assetPath)
Sets the asset path for the root layer of the referenced layer stack.
const std::string & GetAssetPath() const
Returns the asset path to the root layer of the referenced layer stack.
bool operator>(const SdfReference &rhs) const
void SetCustomData(const VtDictionary &customData)
Sets the custom data associated with the reference.
bool operator!=(const SdfReference &rhs) const
SDF_API void SetCustomData(const std::string &name, const VtValue &value)
Sets a custom data entry for the reference.
const SdfPath & GetPrimPath() const
Returns the path of the referenced prim.
bool operator>=(const SdfReference &rhs) const
SDF_API bool IsInternal() const
Returns true in the case of an internal reference.
bool operator<=(const SdfReference &rhs) const
SDF_API bool operator==(const SdfReference &rhs) const
Returns whether this reference equals rhs.
static size_t Combine(Args &&... args)
Produce a hash code by combining the hash codes of several objects.
A map with string keys and VtValue values.
VT_API void swap(VtDictionary &dict)
Swaps the contents of two VtDictionaries.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
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 std::ostream & operator<<(std::ostream &out, const SdfReference &reference)
Writes the string representation of SdfReference to out.
Struct that defines equality of SdfReferences based on their identity (the asset path and prim path).
Struct that defines a strict weak ordering of SdfReferences based on their identity (the asset path a...