HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Vdf_ParallelExecutorDataVector Class Reference

This is a data container for executor data managers that uses data stored in vectors indexed by output ids. Methods on this container are thread-safe unless otherwise called out in their documentation. More...

#include <parallelExecutorDataVector.h>

Public Types

using DataHandle = size_t
 

Public Member Functions

 Vdf_ParallelExecutorDataVector ()
 
VDF_API ~Vdf_ParallelExecutorDataVector ()
 
VDF_API void Resize (const VdfNetwork &network)
 
DataHandle GetOrCreateDataHandle (const VdfId outputId) const
 
DataHandle GetDataHandle (const VdfId outputId) const
 
VdfExecutorBufferDataGetPrivateBufferData (const DataHandle handle) const
 
VdfExecutorBufferDataGetScratchBufferData (const DataHandle handle) const
 
VdfExecutorBufferDataGetPublicBufferData (const DataHandle handle) const
 
void PublishPrivateBufferData (const DataHandle handle) const
 
void PublishScratchBufferData (const DataHandle handle) const
 
VdfExecutorBufferDataGetTransferredBufferData (const DataHandle handle) const
 
bool TransferBufferData (const DataHandle handle, VdfVector *value, const VdfMask &mask)
 
void ResetTransferredBufferData (const DataHandle handle)
 
VdfExecutorInvalidationDataGetInvalidationData (const DataHandle handle) const
 
VdfInvalidationTimestamp GetInvalidationTimestamp (const DataHandle handle) const
 
void SetInvalidationTimestamp (const DataHandle handle, VdfInvalidationTimestamp timestamp)
 
bool IsTouched (const VdfId outputId) const
 
void Touch (const VdfId outputId)
 
bool Untouch (const VdfId outputId)
 
size_t GetNumData () const
 
VDF_API void Reset (const DataHandle handle, const VdfId outputId) const
 
VDF_API void Clear ()
 

Static Public Attributes

static const size_t InvalidHandle = size_t(-1)
 

Detailed Description

This is a data container for executor data managers that uses data stored in vectors indexed by output ids. Methods on this container are thread-safe unless otherwise called out in their documentation.

Definition at line 40 of file parallelExecutorDataVector.h.

Member Typedef Documentation

The data handle type is an index into the internal data vector.

Definition at line 46 of file parallelExecutorDataVector.h.

Constructor & Destructor Documentation

Vdf_ParallelExecutorDataVector::Vdf_ParallelExecutorDataVector ( )
inline

Constructor.

Definition at line 54 of file parallelExecutorDataVector.h.

VDF_API Vdf_ParallelExecutorDataVector::~Vdf_ParallelExecutorDataVector ( )

Destructor.

Member Function Documentation

VDF_API void Vdf_ParallelExecutorDataVector::Clear ( )

Clears all the data from this manager.

This method is not thread-safe. It must be invoked during quiescent state only.

Vdf_ParallelExecutorDataVector::DataHandle Vdf_ParallelExecutorDataVector::GetDataHandle ( const VdfId  outputId) const
inline

Returns an existing data handle for the given output. This method will return an invalid data handle, if no handle has been created for the given output.

Definition at line 657 of file parallelExecutorDataVector.h.

VdfExecutorInvalidationData* Vdf_ParallelExecutorDataVector::GetInvalidationData ( const DataHandle  handle) const
inline

Returns the VdfExecutorInvalidationData associated with the given handle.

Note it is undefined behavior to call this method with an invalid data handle.

Definition at line 185 of file parallelExecutorDataVector.h.

VdfInvalidationTimestamp Vdf_ParallelExecutorDataVector::GetInvalidationTimestamp ( const DataHandle  handle) const
inline

Returns the VdfInvalidationTimestamp associated with the given handle.

Note it is undefined behavior to call this method with an invalid data handle.

Definition at line 196 of file parallelExecutorDataVector.h.

size_t Vdf_ParallelExecutorDataVector::GetNumData ( ) const
inline

Returns the number of outputs that have data associated with them.

This method is thread-safe, but elements accounted for may still be under construction!

Definition at line 268 of file parallelExecutorDataVector.h.

Vdf_ParallelExecutorDataVector::DataHandle Vdf_ParallelExecutorDataVector::GetOrCreateDataHandle ( const VdfId  outputId) const
inline

Returns an existing data handle, or creates a new one for the given output.

This method is guaranteed to return a valid data handle.

Definition at line 616 of file parallelExecutorDataVector.h.

VdfExecutorBufferData* Vdf_ParallelExecutorDataVector::GetPrivateBufferData ( const DataHandle  handle) const
inline

Returns the VdfExecutorBufferData associated with the given handle.

Note it is undefined behavior to call this method with an invalid data handle.

Definition at line 90 of file parallelExecutorDataVector.h.

VdfExecutorBufferData* Vdf_ParallelExecutorDataVector::GetPublicBufferData ( const DataHandle  handle) const
inline

Returns the VdfExecutorBufferData associated with the given handle.

Note it is undefined behavior to call this method with an invalid data handle.

Definition at line 110 of file parallelExecutorDataVector.h.

VdfExecutorBufferData* Vdf_ParallelExecutorDataVector::GetScratchBufferData ( const DataHandle  handle) const
inline

Returns the VdfExecutorBufferData associated with the given handle.

Note it is undefined behavior to call this method with an invalid data handle.

Definition at line 100 of file parallelExecutorDataVector.h.

VdfExecutorBufferData* Vdf_ParallelExecutorDataVector::GetTransferredBufferData ( const DataHandle  handle) const
inline

Returns the transferred VdfExecutorBufferData associated with the given handle. This method will return nullptr, if no value has been written back to this output.

Note it is undefined behavior to call this method with an invalid data handle.

Definition at line 144 of file parallelExecutorDataVector.h.

bool Vdf_ParallelExecutorDataVector::IsTouched ( const VdfId  outputId) const
inline

Returns true if the data at the given output has been touched by evaluation.

Definition at line 217 of file parallelExecutorDataVector.h.

void Vdf_ParallelExecutorDataVector::PublishPrivateBufferData ( const DataHandle  handle) const
inline

Publishes the private VdfExecutorBufferData, and retains the previously public VdfExecutorBufferData. After this method returns, clients are no longer allowed to modify the private or the public buffers.

Note it is undefined behavior to call this method with an invalid data handle.

Definition at line 122 of file parallelExecutorDataVector.h.

void Vdf_ParallelExecutorDataVector::PublishScratchBufferData ( const DataHandle  handle) const
inline

Publishes the scratch VdfExecutorBufferData, and retains the previously public VdfExecutorBufferData. After this method returns, clients are no longer allowed to modify the scratch or the public buffers.

Note it is undefined behavior to call this method with an invalid data handle.

Definition at line 133 of file parallelExecutorDataVector.h.

VDF_API void Vdf_ParallelExecutorDataVector::Reset ( const DataHandle  handle,
const VdfId  outputId 
) const

Resets the output data at the given data handle to a newly constructed state. The output with outputId is the new owner of the output data.

void Vdf_ParallelExecutorDataVector::ResetTransferredBufferData ( const DataHandle  handle)
inline

Resets the transferred buffer associated with the given handle. If any value has previously been written back to this output, its storage will be freed.

Note it is undefined behavior to call this method with an invalid data handle.

Definition at line 175 of file parallelExecutorDataVector.h.

VDF_API void Vdf_ParallelExecutorDataVector::Resize ( const VdfNetwork network)

Resize the data manager to accommodate the given network.

This method is not thread-safe. It can only be called during quiescent state.

void Vdf_ParallelExecutorDataVector::SetInvalidationTimestamp ( const DataHandle  handle,
VdfInvalidationTimestamp  timestamp 
)
inline

Sets the invalidation timestamp for the give data handle.

Note it is undefined behavior to call this method with an invalid data handle.

This method is not thread-safe.

Definition at line 208 of file parallelExecutorDataVector.h.

void Vdf_ParallelExecutorDataVector::Touch ( const VdfId  outputId)
inline

Marks the data at the given output as having been touched by evaluation.

Definition at line 230 of file parallelExecutorDataVector.h.

bool Vdf_ParallelExecutorDataVector::TransferBufferData ( const DataHandle  handle,
VdfVector value,
const VdfMask mask 
)
inline

Transfers ownership of the value to the output associated with handle. Returns true if the transfer of ownership was successful. If the transfer of ownership was successful, the responsibility of lifetime management for value transfers to this data manager. Otherwise, the call site maintains this responsibility.

Note that only one value can be transferred to each output. Subsequent attempts to transfer will fail for that output.

Note it is undefined behavior to call this method with an invalid data handle.

Definition at line 161 of file parallelExecutorDataVector.h.

bool Vdf_ParallelExecutorDataVector::Untouch ( const VdfId  outputId)
inline

Marks the data at the given handle as not having been touched by evaluation. Returns true if the data has previously been touched.

Note it is undefined behavior to call this method with an invalid data handle.

Definition at line 251 of file parallelExecutorDataVector.h.

Member Data Documentation

const size_t Vdf_ParallelExecutorDataVector::InvalidHandle = size_t(-1)
static

This sentinel index denotes an invalid handle.

Definition at line 50 of file parallelExecutorDataVector.h.


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