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

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

#include <parallelDataManagerVector.h>

+ Inheritance diagram for VdfParallelDataManagerVector:

Public Types

typedef
VdfParallelExecutorDataManager
< VdfParallelDataManagerVector
Base
 
typedef
Vdf_ParallelExecutorDataManagerTraits
< VdfParallelDataManagerVector >
::DataHandle 
DataHandle
 
- Public Types inherited from VdfParallelExecutorDataManager< VdfParallelDataManagerVector >
typedef
Vdf_ParallelExecutorDataManagerTraits
< VdfParallelDataManagerVector >
::DataHandle 
DataHandle
 
typedef
Vdf_ParallelExecutorDataManagerInterface
< VdfParallelDataManagerVector,
DataHandle
Base
 

Public Member Functions

 VdfParallelDataManagerVector ()
 
VDF_API ~VdfParallelDataManagerVector ()
 
VDF_API void Resize (const VdfNetwork &network)
 
bool IsValidDataHandle (const DataHandle handle) const
 
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) const
 
bool Untouch (const VdfId outputId)
 
VDF_API void ClearDataForOutput (const VdfId outputId)
 
VDF_API void Clear ()
 
bool IsEmpty () const
 
- Public Member Functions inherited from VdfParallelExecutorDataManager< VdfParallelDataManagerVector >
VdfVectorGetInputValue (const VdfConnection &connection, const VdfMask &mask) const
 
VdfVectorGetOutputValueForReading (const DataHandle dataHandle, const VdfMask &mask) const
 
VdfVectorGetOrCreateOutputValueForWriting (const VdfOutput &output, const DataHandle dataHandle) const
 
void SetOutputValue (const VdfOutput &output, const VdfVector &value, const VdfMask &mask)
 
bool TakeOutputValue (const VdfOutput &output, VdfVector *value, const VdfMask &mask)
 
void SetReferenceOutputValue (const VdfVector *sourceValue, const VdfId destOutputId) const
 
void DuplicateOutputData (const VdfOutput &sourceOutput, const VdfOutput &destOutput)
 
bool IsOutputInvalid (const VdfId outputId, const VdfMask &invalidationMask) const
 
bool InvalidateOutput (const VdfOutput &output, const VdfMask &invalidationMask)
 
void Touch (const VdfOutput &output) const
 
void UpdateInvalidationTimestamp (const VdfInvalidationTimestamp &timestamp)
 
const VdfInvalidationTimestampGetInvalidationTimestamp () const
 
bool HasInvalidationTimestampMismatch (const DataHandle &sourceHandle, const DataHandle &destHandle) const
 

Additional Inherited Members

- Static Public Member Functions inherited from VdfParallelExecutorDataManager< VdfParallelDataManagerVector >
static VdfVectorCreateOutputCache (const VdfOutput &output, VdfExecutorBufferData *bufferData)
 
static VdfVectorCreateOutputCache (const VdfOutput &output, VdfExecutorBufferData *bufferData, const VdfMask::Bits &bits)
 
- Protected Member Functions inherited from VdfParallelExecutorDataManager< VdfParallelDataManagerVector >
 VdfParallelExecutorDataManager ()
 
 ~VdfParallelExecutorDataManager ()
 
- Protected Member Functions inherited from Vdf_ParallelExecutorDataManagerInterface< VdfParallelDataManagerVector, Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandle >
 Vdf_ParallelExecutorDataManagerInterface ()
 
virtual ~Vdf_ParallelExecutorDataManagerInterface ()
 
void _Resize (const VdfNetwork &network)
 
bool _IsValidDataHandle (const Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandlehandle) const
 
Vdf_ParallelExecutorDataManagerTraits
< VdfParallelDataManagerVector >
::DataHandle 
_GetOrCreateDataHandle (const VdfId outputId) const
 
Vdf_ParallelExecutorDataManagerTraits
< VdfParallelDataManagerVector >
::DataHandle 
_GetDataHandle (const VdfId outputId) const
 
VdfExecutorBufferData_GetPrivateBufferData (const Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandlehandle) const
 
VdfExecutorBufferData_GetScratchBufferData (const Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandlehandle) const
 
VdfExecutorBufferData_GetPublicBufferData (const Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandlehandle) const
 
void _PublishPrivateBufferData (const Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandlehandle) const
 
void _PublishScratchBufferData (const Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandlehandle) const
 
VdfExecutorBufferData_GetTransferredBufferData (const Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandlehandle) const
 
bool _TransferBufferData (const Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandlehandle, VdfVector *value, const VdfMask &mask)
 
void _ResetTransferredBufferData (const Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandlehandle)
 
VdfExecutorInvalidationData_GetInvalidationData (const Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandlehandle) const
 
VdfInvalidationTimestamp _GetInvalidationTimestamp (const Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandlehandle) const
 
void _SetInvalidationTimestamp (const Vdf_ParallelExecutorDataManagerTraits< VdfParallelDataManagerVector >::DataHandlehandle, VdfInvalidationTimestamp ts)
 
bool _IsTouched (const VdfId outputId) const
 
void _Touch (const VdfId outputId) const
 
bool _Untouch (const VdfId outputId)
 
void _ClearDataForOutput (const VdfOutput &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

Constructor & Destructor Documentation

VdfParallelDataManagerVector::VdfParallelDataManagerVector ( )
inline

Constructor.

Definition at line 71 of file parallelDataManagerVector.h.

VDF_API VdfParallelDataManagerVector::~VdfParallelDataManagerVector ( )

Destructor.

Member Function Documentation

VDF_API void VdfParallelDataManagerVector::Clear ( )

Clears all the data from this manager.

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

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

DataHandle VdfParallelDataManagerVector::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.

VdfExecutorInvalidationData* VdfParallelDataManagerVector::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.

VdfInvalidationTimestamp VdfParallelDataManagerVector::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.

DataHandle VdfParallelDataManagerVector::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.

VdfExecutorBufferData* VdfParallelDataManagerVector::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.

VdfExecutorBufferData* VdfParallelDataManagerVector::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.

VdfExecutorBufferData* VdfParallelDataManagerVector::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.

VdfExecutorBufferData* VdfParallelDataManagerVector::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.

bool VdfParallelDataManagerVector::IsEmpty ( ) const
inline

Returns true if this data manager is empty.

Definition at line 288 of file parallelDataManagerVector.h.

bool VdfParallelDataManagerVector::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.

bool VdfParallelDataManagerVector::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.

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

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

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

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

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

bool VdfParallelDataManagerVector::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.

bool VdfParallelDataManagerVector::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: