|
Represents a set of data source locators closed under descendancy. More...
#include <dataSourceLocator.h>
Public Types | |
using | const_iterator = typename _Locators::const_iterator |
Public Member Functions | |
HdDataSourceLocatorSet () | |
The empty set. | |
HD_API | HdDataSourceLocatorSet (const HdDataSourceLocator &locator) |
HD_API | HdDataSourceLocatorSet (const std::initializer_list< const HdDataSourceLocator > &l) |
HdDataSourceLocatorSet (const HdDataSourceLocatorSet &rhs)=default | |
Copy Ctor. | |
HdDataSourceLocatorSet (HdDataSourceLocatorSet &&rhs)=default | |
Move Ctor. | |
HdDataSourceLocatorSet & | operator= (HdDataSourceLocatorSet &&rhs)=default |
Move assignment operator. | |
HdDataSourceLocatorSet & | operator= (const HdDataSourceLocatorSet &rhs)=default |
Copy assignment operator. | |
HD_API void | insert (const HdDataSourceLocator &locator) |
HD_API void | insert (const HdDataSourceLocatorSet &locatorSet) |
Changes this set to be the union of this set and the given set. | |
HD_API void | insert (HdDataSourceLocatorSet &&locatorSet) |
Changes this set to be the union of this set and the given set. | |
HD_API void | append (const HdDataSourceLocator &locator) |
append() is semantically equivalent to insert(), but works much faster if locator would be added to the end of the set, lexicographically. | |
bool | operator== (const HdDataSourceLocatorSet &rhs) const |
bool | operator!= (const HdDataSourceLocatorSet &rhs) const |
HD_API const_iterator | begin () const |
Iterates through minimal, lexicographically sorted list of data source locators generating this set. | |
HD_API const_iterator | end () const |
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 | Intersects (const HdDataSourceLocatorSet &locatorSet) const |
True if and only if the two sets (closed under descendancy) intersect. | |
HD_API bool | IsEmpty () const |
True if and only if this set contains no data source locator. | |
HD_API bool | Contains (const HdDataSourceLocator &locator) const |
True if the set (closed under descendancy) contains the given locator. | |
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 prefix use newPrefix instead. | |
HD_API IntersectionView | Intersection (const HdDataSourceLocator &locator) const |
Returns intersection with a locator as a range-like object so that it can be used in a for-loop. | |
Static Public Member Functions | |
static HD_API const HdDataSourceLocatorSet & | UniversalSet () |
The set containing everything. | |
Represents a set of data source locators closed under descendancy.
That is, if a data source locator x is in the set (that is HdDataSourceLocatorSet::Contains returns true), then every data source locator y that has x as a prefix is implicitly also assumed to be in the set.
In particular, the data source locator set <x, y> generated by x and y is equivalent to (and will be simplified to) just <x> if x is a prefix of y.
Note that HdDataSourceLocatorSet{HdDataSourceLocator()} is the universal set containing every data source locator.
Definition at line 219 of file dataSourceLocator.h.
using const_iterator = typename _Locators::const_iterator |
Definition at line 224 of file dataSourceLocator.h.
|
inlineexplicit |
The empty set.
Definition at line 227 of file dataSourceLocator.h.
|
default |
Copy Ctor.
|
default |
Move Ctor.
HD_API void append | ( | const HdDataSourceLocator & | locator | ) |
append() is semantically equivalent to insert(), but works much faster if locator
would be added to the end of the set, lexicographically.
HD_API const_iterator begin | ( | ) | const |
Iterates through minimal, lexicographically sorted list of data source locators generating this set.
HD_API bool Contains | ( | const HdDataSourceLocator & | locator | ) | const |
True if the set (closed under descendancy) contains the given locator.
In other words, a prefix of the locator is a generator of the set in the sense of HdDataSourceLocator::HasPrefix.
HD_API void insert | ( | const HdDataSourceLocatorSet & | locatorSet | ) |
Changes this set to be the union of this set and the given set.
HD_API void insert | ( | HdDataSourceLocatorSet && | locatorSet | ) |
Changes this set to be the union of this set and the given set.
HD_API IntersectionView Intersection | ( | const HdDataSourceLocator & | locator | ) | const |
Returns intersection with a locator as a range-like object so that it can be used in a for-loop.
Every element in the intersection has locator as a prefix.
Examples: Intersection of { primvars:color } with primvars is { primvars:color }. Intersection of { primvars:color } with primvars:color:interpolation is { primvars:color:interpolation }.
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).
In other words, true if and only if there is a generator of this set that intersects the given locator in the sense of HdDataSourceLocator::Intersects.
HD_API bool Intersects | ( | const HdDataSourceLocatorSet & | locatorSet | ) | const |
True if and only if the two sets (closed under descendancy) intersect.
In other words, true if and only if there is a generator x in this set and a generator y in the given set such that x and y intersect in the sense of HdDataSourceLocator::Intersects. That is, one of the two sets contains a prefix of the other set.
HD_API bool IsEmpty | ( | ) | const |
True if and only if this set contains no data source locator.
|
inline |
Definition at line 274 of file dataSourceLocator.h.
|
default |
Copy assignment operator.
|
default |
Move assignment operator.
|
inline |
Definition at line 270 of file dataSourceLocator.h.
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 prefix use newPrefix
instead.
The returned set is closed under descendancy and may have equal or fewer data source locators as a result.
|
static |
The set containing everything.