Loading...
Searching...
No Matches
VdfWeightedIterator< IteratorType > Class Template Referencefinal

This iterator can be used to iterate through an input that is weighted by one or more weight vectors. More...

#include <weightedIterator.h>

+ Inheritance diagram for VdfWeightedIterator< IteratorType >:

Public Types

typedef IteratorType::value_type value_type
 Type of the elements this iterator gives access to.
 
typedef IteratorType::reference reference
 Type of a reference to a value of this iterator.
 

Public Member Functions

template<typename... Args>
 VdfWeightedIterator (const VdfContext &context, const TfToken &weightName, Args &&... args)
 Constructs a weighted iterator using a single weight name.
 
template<typename... Args>
 VdfWeightedIterator (const VdfContext &context, std::initializer_list< TfToken > weightNames, Args &&... args)
 Constructs a weighted iterator using an initializer list for weight names.
 
template<typename... Args>
 VdfWeightedIterator (const VdfContext &context, const std::vector< TfToken > &weightNames, Args &&... args)
 Constructs a weighted iterator using a vector for weight names.
 
 ~VdfWeightedIterator ()=default
 Destructor.
 
VdfWeightedIteratoroperator++ ()
 Increment operator to point to the next element.
 
reference operator* () const
 Returns reference to current element.
 
bool IsAtEnd () const
 Returns true if the iterator is done iterating and false otherwise.
 
int GetCurrentIndex () const
 Returns the current index for the current connection.
 
void AdvanceToEnd ()
 Advance the iterator to the end.
 
double GetWeight (size_t slot=0, double defWeight=0.0) const
 Returns the weight at the current element.
 
bool HasExplicitWeight (size_t slot) const
 Returns true if the weight at the current element is explicitly set at slot.
 
std::pair< bool, double > GetExplicitWeight (size_t slot=0, double defWeight=0.0) const
 Returns a pair (bool, double) indicating whether there is a weight explicitly present at the given slot and giving the weight or the given default weight as fallback.
 
size_t GetNumSlots () const
 Get the number of weight slots used.
 
size_t GetNumExplicitWeights (size_t slot=0) const
 Returns the # of explicit weights for slot.
 

Friends

int Vdf_GetIteratorIndex (const VdfWeightedIterator &it)
 

Additional Inherited Members

- Protected Member Functions inherited from VdfIterator
 ~VdfIterator ()=default
 Disallow destruction via base class pointers.
 
const VdfNode_GetNode (const VdfContext &context) const
 Returns the current node being run.
 
const VdfExecutorInterface_GetExecutor (const VdfContext &context) const
 Returns the executor for the given context.
 
VDF_API const VdfVector_GetInputValue (const VdfContext &context, const VdfConnection &connection, const VdfMask &mask) const
 Returns a vector for reading an input value.
 
VDF_API const VdfVector_GetRequiredInputValue (const VdfContext &context, const VdfConnection &connection, const VdfMask &mask) const
 Returns the cached output value for a given output, or issues an error message if a cache value is not available.
 
VDF_API const VdfOutput_GetRequiredOutputForWriting (const VdfContext &context, const TfToken &name) const
 Returns the output for writing based on the name provided.
 
VDF_API VdfVector_GetOutputValueForWriting (const VdfContext &context, const VdfOutput &output) const
 Returns a vector for writing an output value into.
 
VDF_API bool _GetOutputMasks (const VdfContext &context, const VdfOutput &output, const VdfMask **requestMask, const VdfMask **affectsMask) const
 Retrieves the request and affects masks of the given output.
 
VDF_API bool _IsRequiredInput (const VdfContext &context, const VdfConnection &connection) const
 Returns true when the connection is scheduled and required, and false otherwise.
 
VDF_API const VdfMask_GetRequestMask (const VdfContext &context, const VdfOutput &output) const
 Returns the request mask of output, if the output has been scheduled and NULL otherwise.
 
VDF_API void _ForEachScheduledOutput (const VdfContext &context, const VdfNode &node, const VdfScheduledOutputCallback &callback) const
 Loops over each scheduled output of node and calls callback with the output and request mask in an efficient manner.
 

Detailed Description

template<class IteratorType>
class VdfWeightedIterator< IteratorType >

This iterator can be used to iterate through an input that is weighted by one or more weight vectors.

Definition at line 155 of file weightedIterator.h.

Member Typedef Documentation

◆ reference

typedef IteratorType::reference reference

Type of a reference to a value of this iterator.

Definition at line 165 of file weightedIterator.h.

◆ value_type

typedef IteratorType::value_type value_type

Type of the elements this iterator gives access to.

Definition at line 161 of file weightedIterator.h.

Constructor & Destructor Documentation

◆ VdfWeightedIterator() [1/3]

VdfWeightedIterator ( const VdfContext context,
const TfToken weightName,
Args &&...  args 
)
inline

Constructs a weighted iterator using a single weight name.

Definition at line 170 of file weightedIterator.h.

◆ VdfWeightedIterator() [2/3]

VdfWeightedIterator ( const VdfContext context,
std::initializer_list< TfToken weightNames,
Args &&...  args 
)
inline

Constructs a weighted iterator using an initializer list for weight names.

Definition at line 183 of file weightedIterator.h.

◆ VdfWeightedIterator() [3/3]

VdfWeightedIterator ( const VdfContext context,
const std::vector< TfToken > &  weightNames,
Args &&...  args 
)
inline

Constructs a weighted iterator using a vector for weight names.

Definition at line 194 of file weightedIterator.h.

◆ ~VdfWeightedIterator()

~VdfWeightedIterator ( )
default

Destructor.

Member Function Documentation

◆ AdvanceToEnd()

void AdvanceToEnd ( )
inline

Advance the iterator to the end.

Definition at line 234 of file weightedIterator.h.

◆ GetCurrentIndex()

int GetCurrentIndex ( ) const
inline

Returns the current index for the current connection.

This method should not generally be used.

Definition at line 228 of file weightedIterator.h.

◆ GetExplicitWeight()

std::pair< bool, double > GetExplicitWeight ( size_t  slot = 0,
double  defWeight = 0.0 
) const

Returns a pair (bool, double) indicating whether there is a weight explicitly present at the given slot and giving the weight or the given default weight as fallback.

Definition at line 508 of file weightedIterator.h.

◆ GetNumExplicitWeights()

size_t GetNumExplicitWeights ( size_t  slot = 0) const
inline

Returns the # of explicit weights for slot.

Definition at line 270 of file weightedIterator.h.

◆ GetNumSlots()

size_t GetNumSlots ( ) const
inline

Get the number of weight slots used.

Definition at line 264 of file weightedIterator.h.

◆ GetWeight()

double GetWeight ( size_t  slot = 0,
double  defWeight = 0.0 
) const
inline

Returns the weight at the current element.

If no weight is explicitly present at the given slot, defWeight (default is 0.0) is returned.

Definition at line 242 of file weightedIterator.h.

◆ HasExplicitWeight()

bool HasExplicitWeight ( size_t  slot) const
inline

Returns true if the weight at the current element is explicitly set at slot.

Definition at line 250 of file weightedIterator.h.

◆ IsAtEnd()

bool IsAtEnd ( ) const
inline

Returns true if the iterator is done iterating and false otherwise.

Definition at line 220 of file weightedIterator.h.

◆ operator*()

reference operator* ( ) const
inline

Returns reference to current element.

Definition at line 214 of file weightedIterator.h.

◆ operator++()

VdfWeightedIterator< IteratorType > & operator++

Increment operator to point to the next element.

Definition at line 409 of file weightedIterator.h.

Friends And Related Function Documentation

◆ Vdf_GetIteratorIndex

int Vdf_GetIteratorIndex ( const VdfWeightedIterator< IteratorType > &  it)
friend

Definition at line 282 of file weightedIterator.h.


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