Loading...
Searching...
No Matches
VdfParallelDataManagerVector Class Reference

This is a data manager for executors that uses data stored in a vector indexed by output ids. More...

#include <parallelDataManagerVector.h>

+ Inheritance diagram for VdfParallelDataManagerVector:

Public Types

typedef VdfParallelExecutorDataManager< VdfParallelDataManagerVectorBase
 The base class.
 
typedef Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandle DataHandle
 The data handle type from the type traits class.
 
- Public Types inherited from VdfParallelExecutorDataManager< VdfParallelDataManagerVector >
typedef Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandle DataHandle
 The data handle type defined via the specialized traits class.
 
typedef Vdf_ParallelExecutorDataManagerInterface< VdfParallelDataManagerVector, DataHandleBase
 The base class type.
 

Public Member Functions

 VdfParallelDataManagerVector ()
 Constructor.
 
VDF_API ~VdfParallelDataManagerVector ()
 Destructor.
 
VDF_API void Resize (const VdfNetwork &network)
 Resize the data manager to accommodate the given network.
 
bool IsValidDataHandle (const DataHandle handle) const
 Returns true if the given data handle is valid, i.e.
 
DataHandle GetOrCreateDataHandle (const VdfId outputId) const
 Returns an existing data handle, or creates a new one for the given outputId.
 
DataHandle GetDataHandle (const VdfId outputId) const
 Returns an existing data handle for the given outputId.
 
VdfExecutorBufferDataGetPrivateBufferData (const DataHandle handle) const
 Returns the VdfExecutorBufferData associated with the given handle.
 
VdfExecutorBufferDataGetScratchBufferData (const DataHandle handle) const
 Returns the VdfExecutorBufferData associated with the given handle.
 
VdfExecutorBufferDataGetPublicBufferData (const DataHandle handle) const
 Returns the VdfExecutorBufferData associated with the given handle.
 
void PublishPrivateBufferData (const DataHandle handle) const
 Publishes the private VdfExecutorBufferData, and retains the previously public VdfExecutorBufferData.
 
void PublishScratchBufferData (const DataHandle handle) const
 Publishes the scratch VdfExecutorBufferData, and retains the previously public VdfExecutorBufferData.
 
VdfExecutorBufferDataGetTransferredBufferData (const DataHandle handle) const
 Returns the transferred VdfExecutorBufferData associated with the given handle.
 
bool TransferBufferData (const DataHandle handle, VdfVector *value, const VdfMask &mask)
 Transfers ownership of the value to the output associated with handle.
 
void ResetTransferredBufferData (const DataHandle handle)
 Resets the transferred buffer associated with the given handle.
 
VdfExecutorInvalidationData * GetInvalidationData (const DataHandle handle) const
 Returns the VdfExecutorInvalidationData associated with the given handle.
 
VdfInvalidationTimestamp GetInvalidationTimestamp (const DataHandle handle) const
 Returns the VdfInvalidationTimestamp associated with the given handle.
 
void SetInvalidationTimestamp (const DataHandle handle, VdfInvalidationTimestamp timestamp)
 Sets the invalidation timestamp for the give data handle.
 
bool IsTouched (const VdfId outputId) const
 Returns true if the data at the given outputId has been touched by evaluation.
 
void Touch (const VdfId outputId) const
 Marks the data at the given outputId as having been touched by evaluation.
 
bool Untouch (const VdfId outputId)
 Marks the data at the given outputId as not having been touched by evaluation.
 
VDF_API void ClearDataForOutput (const VdfId outputId)
 Clears the executor data for a specific output.
 
VDF_API void Clear ()
 Clears all the data from this manager.
 
bool IsEmpty () const
 Returns true if this data manager is empty.
 
- Public Member Functions inherited from VdfParallelExecutorDataManager< VdfParallelDataManagerVector >
VdfVectorGetInputValue (const VdfConnection &connection, const VdfMask &mask) const
 Returns the input value flowing across the given connection with the given mask.
 
VdfVectorGetOutputValueForReading (const DataHandle dataHandle, const VdfMask &mask) const
 Returns the cached value for a given output and mask.
 
VdfVectorGetOrCreateOutputValueForWriting (const VdfOutput &output, const DataHandle dataHandle) const
 Returns a new or existing output value.
 
void SetOutputValue (const VdfOutput &output, const VdfVector &value, const VdfMask &mask)
 Sets the cached value for a given output, creating the output cache if necessary.
 
bool TakeOutputValue (const VdfOutput &output, VdfVector *value, const VdfMask &mask)
 Transfers the ownership of value to the given output.
 
void SetReferenceOutputValue (const VdfVector *sourceValue, const VdfId destOutputId) const
 Called to set destOutput's buffer output to be a reference to the sourceValue.
 
void DuplicateOutputData (const VdfOutput &sourceOutput, const VdfOutput &destOutput)
 Duplicates the output data associated with sourceOutput and copies it to destOutput.
 
bool IsOutputInvalid (const VdfId outputId, const VdfMask &invalidationMask) const
 Returns true if the output is already invalid for the given invalidationMask.
 
bool InvalidateOutput (const VdfOutput &output, const VdfMask &invalidationMask)
 Marks output as invalid.
 
void Touch (const VdfOutput &output) const
 Marks the data at the given output as having been touched by evaluation.
 
void UpdateInvalidationTimestamp (const VdfInvalidationTimestamp &timestamp)
 Increments the the current invalidation timestamp on this executor.
 
const VdfInvalidationTimestampGetInvalidationTimestamp () const
 Returns the current invalidation timestamp on this executor.
 
bool HasInvalidationTimestampMismatch (const DataHandle &sourceHandle, const DataHandle &destHandle) const
 Returns true, if the invalidation timestamps between sourceExecutorData and destExecutorData do not match, i.e.
 

Additional Inherited Members

- Static Public Member Functions inherited from VdfParallelExecutorDataManager< VdfParallelDataManagerVector >
static VdfVectorCreateOutputCache (const VdfOutput &output, VdfExecutorBufferData *bufferData)
 Creates a new cache for an output, given the output data object.
 
static VdfVectorCreateOutputCache (const VdfOutput &output, VdfExecutorBufferData *bufferData, const VdfMask::Bits &bits)
 Creates a new cache for an output, given the output data object.
 
- Protected Member Functions inherited from VdfParallelExecutorDataManager< VdfParallelDataManagerVector >
 VdfParallelExecutorDataManager ()
 Constructor.
 
 ~VdfParallelExecutorDataManager ()
 Prevent destruction via base class pointers (static polymorphism only).
 
- Protected Member Functions inherited from Vdf_ParallelExecutorDataManagerInterface< DerivedClass, DataHandle >
 Vdf_ParallelExecutorDataManagerInterface ()
 Allow construction via derived classes, only.
 
virtual ~Vdf_ParallelExecutorDataManagerInterface ()
 Prevent destruction via base class pointers (static polymorphism only).
 
void _Resize (const VdfNetwork &network)
 Resize the data manager to accommodate all the outputs in the given network.
 
bool _IsValidDataHandle (const DataHandle handle) const
 Returns true if the given data handle is valid, i.e.
 
DataHandle _GetOrCreateDataHandle (const VdfId outputId) const
 Returns an existing data handle, or creates a new one for the given outputId.
 
DataHandle _GetDataHandle (const VdfId outputId) const
 Returns an existing data handle for the given outputId.
 
VdfExecutorBufferData_GetPrivateBufferData (const DataHandle handle) const
 Returns the private VdfExecutorBufferData associated with the given handle.
 
VdfExecutorBufferData_GetScratchBufferData (const DataHandle handle) const
 Returns the scratch VdfExecutorBufferData associated with the given handle.
 
VdfExecutorBufferData_GetPublicBufferData (const DataHandle handle) const
 Returns the public VdfExecutorBufferData associated with the given handle.
 
void _PublishPrivateBufferData (const DataHandle handle) const
 Publishes the private VdfExecutorBufferData, and retains the previously public VdfExecutorBufferData as private data.
 
void _PublishScratchBufferData (const DataHandle handle) const
 Publishes the scratch VdfExecutorBufferData, and retains the previously public VdfExecutorBufferData as scratch data.
 
VdfExecutorBufferData_GetTransferredBufferData (const DataHandle handle) const
 Returns the transferred VdfExecutorBufferData associated with the given handle.
 
bool _TransferBufferData (const DataHandle handle, VdfVector *value, const VdfMask &mask)
 Transfers ownership of the value to the output associated with handle.
 
void _ResetTransferredBufferData (const DataHandle handle)
 Resets the transferred buffer associated with the given handle.
 
VdfExecutorInvalidationData * _GetInvalidationData (const DataHandle handle) const
 Returns the VdfExecutorInvalidationData associated with the given handle.
 
VdfInvalidationTimestamp _GetInvalidationTimestamp (const DataHandle handle) const
 Returns the VdfInvalidationTimestamp associated with the given handle.
 
void _SetInvalidationTimestamp (const DataHandle handle, VdfInvalidationTimestamp ts)
 Sets the invalidation timestamp for the give data handle.
 
bool _IsTouched (const VdfId outputId) const
 Returns true if the data at the given output has been touched by evaluation.
 
void _Touch (const VdfId outputId) const
 Marks the data at the given output as having been touched by evaluation.
 
bool _Untouch (const VdfId outputId)
 Marks the data at the given output as not having been touched by evaluation.
 
void _ClearDataForOutput (const VdfOutput &output)
 Clears the executor data for a specific output.
 

Detailed Description

This is a data manager for executors that uses data stored in a vector indexed by output ids.

Note that all methods on this data manager are thread-safe unless specifically called out to not be thread-safe in their documentation.

Definition at line 51 of file parallelDataManagerVector.h.

Member Typedef Documentation

◆ Base

◆ DataHandle

The data handle type from the type traits class.

Definition at line 67 of file parallelDataManagerVector.h.

Constructor & Destructor Documentation

◆ VdfParallelDataManagerVector()

Constructor.

Definition at line 71 of file parallelDataManagerVector.h.

◆ ~VdfParallelDataManagerVector()

Destructor.

Member Function Documentation

◆ Clear()

VDF_API void Clear ( )

Clears all the data from this manager.

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

◆ ClearDataForOutput()

VDF_API void ClearDataForOutput ( const VdfId  outputId)

Clears the executor data for a specific output.

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

◆ GetDataHandle()

DataHandle GetDataHandle ( const VdfId  outputId) const
inline

Returns an existing data handle for the given outputId.

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

Definition at line 113 of file parallelDataManagerVector.h.

◆ GetInvalidationData()

VdfExecutorInvalidationData * 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 218 of file parallelDataManagerVector.h.

◆ GetInvalidationTimestamp()

VdfInvalidationTimestamp 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 233 of file parallelDataManagerVector.h.

◆ GetOrCreateDataHandle()

DataHandle GetOrCreateDataHandle ( const VdfId  outputId) const
inline

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

This method is guaranteed to return a valid data handle.

This method is not thread-safe when invoken with the same output parameter from multiple threads. It is safe to call this method with concurrently, with different output parameters.

Definition at line 105 of file parallelDataManagerVector.h.

◆ GetPrivateBufferData()

VdfExecutorBufferData * 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 124 of file parallelDataManagerVector.h.

◆ GetPublicBufferData()

VdfExecutorBufferData * 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 142 of file parallelDataManagerVector.h.

◆ GetScratchBufferData()

VdfExecutorBufferData * 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 133 of file parallelDataManagerVector.h.

◆ GetTransferredBufferData()

VdfExecutorBufferData * 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 177 of file parallelDataManagerVector.h.

◆ IsEmpty()

bool IsEmpty ( ) const
inline

Returns true if this data manager is empty.

Definition at line 288 of file parallelDataManagerVector.h.

◆ IsTouched()

bool IsTouched ( const VdfId  outputId) const
inline

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

Definition at line 252 of file parallelDataManagerVector.h.

◆ IsValidDataHandle()

bool IsValidDataHandle ( const DataHandle  handle) const
inline

Returns true if the given data handle is valid, i.e.

it is valid to ask for data for this given handle.

Note that attempting to resolve data at an invalid handle results in undefined behavior.

Definition at line 92 of file parallelDataManagerVector.h.

◆ PublishPrivateBufferData()

void PublishPrivateBufferData ( const DataHandle  handle) const
inline

Publishes the private VdfExecutorBufferData, and retains the previously public VdfExecutorBufferData.

After this method returns, clients may still read from the private data, but are no longer allowed to mutate it.

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

Definition at line 154 of file parallelDataManagerVector.h.

◆ PublishScratchBufferData()

void PublishScratchBufferData ( const DataHandle  handle) const
inline

Publishes the scratch VdfExecutorBufferData, and retains the previously public VdfExecutorBufferData.

After this method returns, clients may still read from the scratch data, but are no longer allowed to mutate it.

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

Definition at line 166 of file parallelDataManagerVector.h.

◆ ResetTransferredBufferData()

void 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 208 of file parallelDataManagerVector.h.

◆ Resize()

VDF_API void 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.

◆ SetInvalidationTimestamp()

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

Definition at line 243 of file parallelDataManagerVector.h.

◆ Touch()

void Touch ( const VdfId  outputId) const
inline

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

Definition at line 259 of file parallelDataManagerVector.h.

◆ TransferBufferData()

bool 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 194 of file parallelDataManagerVector.h.

◆ Untouch()

bool Untouch ( const VdfId  outputId)
inline

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

Returns true if the data has previously been touched.

Definition at line 266 of file parallelDataManagerVector.h.


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