Loading...
Searching...
No Matches
HdDataSourceLocatorSet Class Reference

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.
 
HdDataSourceLocatorSetoperator= (HdDataSourceLocatorSet &&rhs)=default
 Move assignment operator.
 
HdDataSourceLocatorSetoperator= (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 HdDataSourceLocatorSetUniversalSet ()
 The set containing everything.
 

Detailed Description

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 250 of file dataSourceLocator.h.

Member Typedef Documentation

◆ const_iterator

using const_iterator = typename _Locators::const_iterator

Definition at line 255 of file dataSourceLocator.h.

Constructor & Destructor Documentation

◆ HdDataSourceLocatorSet() [1/3]

The empty set.

Definition at line 258 of file dataSourceLocator.h.

◆ HdDataSourceLocatorSet() [2/3]

Copy Ctor.

◆ HdDataSourceLocatorSet() [3/3]

Move Ctor.

Member Function Documentation

◆ append()

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.

◆ begin()

HD_API const_iterator begin ( ) const

Iterates through minimal, lexicographically sorted list of data source locators generating this set.

◆ Contains()

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.

◆ insert() [1/2]

HD_API void insert ( const HdDataSourceLocatorSet & locatorSet)

Changes this set to be the union of this set and the given set.

◆ insert() [2/2]

HD_API void insert ( HdDataSourceLocatorSet && locatorSet)

Changes this set to be the union of this set and the given set.

◆ Intersection()

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 }.

◆ Intersects() [1/2]

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.

◆ Intersects() [2/2]

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.

◆ IsEmpty()

HD_API bool IsEmpty ( ) const

True if and only if this set contains no data source locator.

◆ operator!=()

bool operator!= ( const HdDataSourceLocatorSet & rhs) const
inline

Definition at line 305 of file dataSourceLocator.h.

◆ operator=() [1/2]

HdDataSourceLocatorSet & operator= ( const HdDataSourceLocatorSet & rhs)
default

Copy assignment operator.

◆ operator=() [2/2]

HdDataSourceLocatorSet & operator= ( HdDataSourceLocatorSet && rhs)
default

Move assignment operator.

◆ operator==()

bool operator== ( const HdDataSourceLocatorSet & rhs) const
inline

Definition at line 301 of file dataSourceLocator.h.

◆ ReplacePrefix()

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.

◆ UniversalSet()

static HD_API const HdDataSourceLocatorSet & UniversalSet ( )
static

The set containing everything.


The documentation for this class was generated from the following file: