7#ifndef PXR_EXEC_VDF_NODE_SET_H
8#define PXR_EXEC_VDF_NODE_SET_H
14#include "pxr/exec/vdf/api.h"
17#include "pxr/base/tf/bits.h"
19PXR_NAMESPACE_OPEN_SCOPE
60 return index < _bits.
GetSize() ? _bits.
IsSet(index) :
false;
92 const_iterator
end()
const {
99 lhs._bits.
Swap(rhs._bits);
107 void _Grow(
size_t size);
121 if (index >= _bits.
GetSize()) {
129PXR_NAMESPACE_CLOSE_SCOPE
Fast bit array that keeps track of the number of bits set and can find the next set in a timely manne...
size_t GetSize() const
Returns the size of the bit array, ie.
void Swap(TfBits &rhs)
Provides a fast swap.
void Set(size_t index)
Sets bit # index to one.
bool IsSet(size_t index) const
Returns true, if bit # index is set.
AllSetView GetAllSetView() const
Returns an iteratable view for the bits that steps over all set bits.
size_t GetNumSet() const
Returns the number of bits currently set in this array.
This is the base class for all nodes in a VdfNetwork.
static VdfIndex GetIndexFromId(const VdfId id)
Get the node index from the node id.
VdfId GetId() const
Returns the unique id of this node in its network.
Class that efficiently stores a set of VdfNodes.
bool Contains(const VdfIndex index) const
Returns true if the node with the given index is in the set.
size_t GetSize() const
Get the number of elements contained in this set.
VdfNodeSet()=default
Default constructor.
const_iterator begin() const
Returns an iterator at the beginning of the iterable range.
VDF_API bool Remove(const VdfNode &node)
Removes node from the set.
TfBits::View< TfBits::AllSet >::const_iterator iterator
Iterator types.
bool IsEmpty() const
Is this set empty?
VDF_API void Insert(const VdfNodeSet &rhs)
Inserts another nodeSet into this set.
const_iterator end() const
Returns an iterator at the end of the iterable range.
VDF_API void Clear()
Clears the node set.
friend void swap(VdfNodeSet &lhs, VdfNodeSet &rhs)
Swaps two VdfNodeSet instances.
void Insert(const VdfNode &node)
Inserts node into the set.
bool Contains(const VdfNode &node) const
Returns true if node is in the set.
uint32_t VdfIndex
The index type for Vdf objects.