24 #ifndef PXR_IMAGING_HD_DATASOURCELOCATOR_H 25 #define PXR_IMAGING_HD_DATASOURCELOCATOR_H 32 #include "pxr/imaging/hd/api.h" 34 PXR_NAMESPACE_OPEN_SCOPE
176 return _tokens == rhs._tokens;
180 return _tokens != rhs._tokens;
187 inline bool IsEmpty()
const {
188 return _tokens.
empty();
195 std::string
GetString(
const char *delimiter =
"/")
const;
197 template <
class HashState>
199 h.AppendContiguous(myObj._tokens.
data(), myObj._tokens.
size());
202 inline size_t Hash()
const;
210 HdDataSourceLocator::Hash()
const 246 const std::initializer_list<const HdDataSourceLocator> &l);
274 return _locators == rhs._locators;
278 return !(*
this == rhs);
284 const_iterator
begin()
const;
286 const_iterator end()
const;
338 PXR_NAMESPACE_CLOSE_SCOPE
340 #endif // PXR_IMAGING_HD_DATASOURCELOCATOR_H HD_API bool Contains(const HdDataSourceLocator &locator) const
True if the set (closed under descendancy) contains the given locator.
HD_API bool Intersects(const HdDataSourceLocator &other) const
Returns true if and only if either of the two locators is a prefix of the other one - in the sense of...
bool empty() const
Returns true if this vector is empty.
value_type * data()
Direct access to the underlying array.
HD_API HdDataSourceLocatorSet ReplacePrefix(const HdDataSourceLocator &oldPrefix, const HdDataSourceLocator &newPrefix) const
Returns a lexicographically sorted locator set wherein locators in this set that have oldPrefix as a ...
HD_API const TfToken & GetLastElement() const
Returns the last element, or empty token if none.
HD_API HdDataSourceLocator RemoveLastElement() const
Returns a copy of this data source locator with the last element removed.
HD_API HdDataSourceLocator ReplacePrefix(const HdDataSourceLocator &oldPrefix, const HdDataSourceLocator &newPrefix) const
Returns a copy of this data source locator with oldPrefix replaced by newPrefix.
HD_API HdDataSourceLocator RemoveFirstElement() const
Returns a copy of this data source locator with the first element removed.
HD_API const TfToken & GetFirstElement() const
Returns the first element, or empty token if none.
A user-extensible hashing mechanism for use with runtime hash tables.
HD_API void append(const HdDataSourceLocator &locator)
append() is semantically equivalent to insert(), but works much faster if locator would be added to t...
HD_API HdDataSourceLocator()
Creates an empty locator.
HD_API HdDataSourceLocator GetCommonPrefix(const HdDataSourceLocator &other) const
Returns a data source locator that represents the common prefix between this data source and other.
Token for efficient comparison, assignment, and hashing of known strings.
Represents an object that can identify the location of a data source.
HD_API bool operator<(const HdDataSourceLocator &rhs) const
Lexicographic order. If y has x as prefix, x < y.
HD_API const_iterator begin() const
Iterates through minimal, lexicographically sorted list of data source locators generating this set.
Represents a set of data source locators closed under descendancy.
HD_API const TfToken & GetElement(size_t i) const
Returns the element (token) at index i.
HD_API std::string GetString(const char *delimiter="/") const
Returns a string representation of this data source locator with the given delimiter inserted between...
HD_API HdDataSourceLocator Prepend(const TfToken &name) const
Prepends name to this data source locator.
HD_API size_t GetElementCount() const
Returns the number of elements (tokens) in this data source.
static HD_API const HdDataSourceLocator & EmptyLocator()
Returns a common empty locator.
size_type size() const
Returns the current size of the vector.
HD_API bool HasPrefix(const HdDataSourceLocator &prefix) const
Returns true if and only if this data source locator has prefix as a prefix.
HD_API HdDataSourceLocator Append(const TfToken &name) const
Appends name to this data source locator.
HD_API bool Intersects(const HdDataSourceLocator &locator) const
True if and only if locator or any of its descendants is in the set (closed under descendancy).
HD_API bool IsEmpty() const
True if and only if this set contains no data source locator.
HdDataSourceLocatorSet & operator=(HdDataSourceLocatorSet &&rhs)=default
Move assignment operator.
HD_API HdDataSourceLocator ReplaceLastElement(const TfToken &name) const
Returns a copy of this data source locator with the last element replaced by the one given by name.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...