Loading...
Searching...
No Matches
VdfExecutorDataManager< DerivedClass > Class Template Reference

This class provides functionality to manage the executor specific data associated with each output in the network. More...

#include <executorDataManager.h>

+ Inheritance diagram for VdfExecutorDataManager< DerivedClass >:

Public Types

typedef Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle DataHandle
 The data handle type defined via the specialized traits class.
 
typedef Vdf_ExecutorDataManagerInterface< DerivedClass, DataHandleBase
 The base class type.
 

Public Member Functions

Cache Management
const VdfVectorGetInputValue (const VdfConnection &connection, const VdfMask &mask) const
 Returns the input value flowing across the given connection with the given mask.
 
VdfVectorGetOutputValueForReading (const DataHandle handle, const VdfMask &mask) const
 Returns the cached value for a given output and mask.
 
VdfVectorGetOrCreateOutputValueForWriting (const VdfOutput &output, const DataHandle handle) const
 Returns a new or existing output value for writing data into.
 
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 ownership of value to the given output, returning true if the transfer of ownership succeeds.
 
void SetReferenceOutputValue (const VdfVector *sourceValue, const VdfId destOutputId) const
 Called to set destOutput's buffer output to be a reference to the sourceValue.
 
VdfVectorCreateOutputCache (const VdfOutput &output, VdfExecutorBufferData *bufferData) const
 Creates a new cache for an output, given the output data object.
 
void DuplicateOutputData (const VdfOutput &sourceOutput, const VdfOutput &destOutput)
 Duplicates the output data associated with sourceOutput and copies it to destOutput.
 
void SetComputedOutputMask (VdfExecutorBufferData *bufferData, const VdfMask &mask)
 Marks the output whose data is bufferData as computed for the entries in mask.
 
Invalidation
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 (VdfInvalidationTimestamp timestamp)
 Increments the the current invalidation timestamp on this executor.
 
VdfInvalidationTimestamp GetInvalidationTimestamp () 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 sourceData and destData do not match, i.e.
 
Buffer Passing
VdfVectorPassBuffer (const VdfOutput &fromOutput, VdfExecutorBufferData *fromBuffer, const VdfOutput &toOutput, VdfExecutorBufferData *toBuffer, const VdfMask &keepMask)
 This method is called to pass a buffer from fromOutput to toOutput.
 

Protected Member Functions

 VdfExecutorDataManager ()
 Constructor.
 
 ~VdfExecutorDataManager ()=default
 Prevent destruction via base class pointers (static polymorphism only).
 
- Protected Member Functions inherited from Vdf_ExecutorDataManagerInterface< DerivedClass, Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle >
 Vdf_ExecutorDataManagerInterface ()=default
 Allow construction via derived classes, only.
 
 ~Vdf_ExecutorDataManagerInterface ()=default
 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 Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle handle) const
 Returns true if the given data handle is valid, i.e.
 
Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle _GetOrCreateDataHandle (const VdfId outputId) const
 Returns an existing data handle, or creates a new one for the given outputId.
 
Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle _GetDataHandle (const VdfId outputId) const
 Returns an existing data handle for the given outputId.
 
VdfExecutorBufferData_GetBufferData (const Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle handle) const
 Returns the VdfExecutorBufferData associated with the given handle.
 
VdfExecutorInvalidationData * _GetInvalidationData (const Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle handle) const
 Returns the VdfExecutorInvalidationData associated with the given handle.
 
VdfInvalidationTimestamp _GetInvalidationTimestamp (const Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle handle) const
 Returns the VdfInvalidationTimestamp associated with the given handle.
 
void _SetInvalidationTimestamp (const Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle handle, VdfInvalidationTimestamp ts)
 Sets the invalidation timestamp for the give data handle.
 
VdfSMBLData_GetSMBLData (const Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle handle) const
 Returns an existing VdfSMBLData associated with the given handle.
 
VdfSMBLData_GetOrCreateSMBLData (const Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle handle) const
 Returns an existing VdfSMBLData associated with the given handle or creates a new one of none exists.
 
bool _IsTouched (const Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle handle) const
 Returns true if the data at the given handle has been touched by evaluation.
 
void _Touch (const Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle handle) const
 Marks the data at the given handle as having been touched by evaluation.
 
bool _Untouch (const Vdf_ExecutorDataManagerTraits< DerivedClass >::DataHandle handle)
 Marks the data at the given handle as not having been touched by evaluation.
 
void _ClearDataForOutput (const VdfOutput &output)
 Clears the executor data for a specific output.
 

Detailed Description

template<typename DerivedClass>
class VdfExecutorDataManager< DerivedClass >

This class provides functionality to manage the executor specific data associated with each output in the network.

The data manager implementations use static polymorphism to dispatch the API on VdfExecutorDataManager. See Vdf_ExecutorDataManagerInterface for which methods are expected to be implemented by the derived classes.

Definition at line 47 of file executorDataManager.h.

Member Typedef Documentation

◆ Base

The base class type.

Definition at line 64 of file executorDataManager.h.

◆ DataHandle

typedef Vdf_ExecutorDataManagerTraits<DerivedClass>::DataHandle DataHandle

The data handle type defined via the specialized traits class.

Definition at line 58 of file executorDataManager.h.

Constructor & Destructor Documentation

◆ VdfExecutorDataManager()

VdfExecutorDataManager ( )
inlineprotected

Constructor.

Note that the invalidation timestamp is initialized to be ahead of the initial timestamp in the VdfExecutorData. This is to allow the executor to correctly identify when data has never been invalidated before.

Definition at line 215 of file executorDataManager.h.

◆ ~VdfExecutorDataManager()

~VdfExecutorDataManager ( )
protecteddefault

Prevent destruction via base class pointers (static polymorphism only).

Member Function Documentation

◆ CreateOutputCache()

VdfVector * CreateOutputCache ( const VdfOutput output,
VdfExecutorBufferData bufferData 
) const

Creates a new cache for an output, given the output data object.

Definition at line 400 of file executorDataManager.h.

◆ DuplicateOutputData()

void DuplicateOutputData ( const VdfOutput sourceOutput,
const VdfOutput destOutput 
)

Duplicates the output data associated with sourceOutput and copies it to destOutput.

Definition at line 415 of file executorDataManager.h.

◆ GetInputValue()

const VdfVector * GetInputValue ( const VdfConnection connection,
const VdfMask mask 
) const

Returns the input value flowing across the given connection with the given mask.

If the the cache is not valid, or if the cache does not contain all the elements in mask, returns NULL. If no output data exists for output, it will not be created.

Definition at line 237 of file executorDataManager.h.

◆ GetInvalidationTimestamp()

VdfInvalidationTimestamp GetInvalidationTimestamp ( ) const
inline

Returns the current invalidation timestamp on this executor.

Definition at line 176 of file executorDataManager.h.

◆ GetOrCreateOutputValueForWriting()

VdfVector * GetOrCreateOutputValueForWriting ( const VdfOutput output,
const DataHandle  handle 
) const

Returns a new or existing output value for writing data into.

Definition at line 289 of file executorDataManager.h.

◆ GetOutputValueForReading()

VdfVector * GetOutputValueForReading ( const DataHandle  handle,
const VdfMask mask 
) const

Returns the cached value for a given output and mask.

If the the cache is not valid, or if the cache does not contain all the elements in mask, returns NULL. If no output data exists for output, it will not be created.

Definition at line 258 of file executorDataManager.h.

◆ HasInvalidationTimestampMismatch()

bool HasInvalidationTimestampMismatch ( const DataHandle  sourceHandle,
const DataHandle  destHandle 
) const

Returns true, if the invalidation timestamps between sourceData and destData do not match, i.e.

the source output should be mung buffer locked.

Definition at line 609 of file executorDataManager.h.

◆ InvalidateOutput()

bool InvalidateOutput ( const VdfOutput output,
const VdfMask invalidationMask 
)

Marks output as invalid.

Returns true if there was anything to invalidate and false if the output was already invalid.

Definition at line 483 of file executorDataManager.h.

◆ IsOutputInvalid()

bool IsOutputInvalid ( const VdfId  outputId,
const VdfMask invalidationMask 
) const

Returns true if the output is already invalid for the given invalidationMask.

Definition at line 460 of file executorDataManager.h.

◆ PassBuffer()

VdfVector * PassBuffer ( const VdfOutput fromOutput,
VdfExecutorBufferData fromBuffer,
const VdfOutput toOutput,
VdfExecutorBufferData toBuffer,
const VdfMask keepMask 
)

This method is called to pass a buffer from fromOutput to toOutput.

The keepMask is the mask of elements that fromOutput should keep after the pass.

Returns the cache data that ends up in toOutput.

Definition at line 558 of file executorDataManager.h.

◆ SetComputedOutputMask()

void SetComputedOutputMask ( VdfExecutorBufferData bufferData,
const VdfMask mask 
)
inline

Marks the output whose data is bufferData as computed for the entries in mask.

Definition at line 136 of file executorDataManager.h.

◆ SetOutputValue()

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.

If the output already contains data, it will be merged with the new data as indicated by value and mask.

Definition at line 310 of file executorDataManager.h.

◆ SetReferenceOutputValue()

void SetReferenceOutputValue ( const VdfVector sourceValue,
const VdfId  destOutputId 
) const

Called to set destOutput's buffer output to be a reference to the sourceValue.

Definition at line 385 of file executorDataManager.h.

◆ TakeOutputValue()

bool TakeOutputValue ( const VdfOutput output,
VdfVector value,
const VdfMask mask 
)

Transfers ownership of value to the given output, returning true if the transfer of ownership succeeds.

If successful, the data manager assumes responsibility for the lifetime of value.

Definition at line 354 of file executorDataManager.h.

◆ Touch()

void Touch ( const VdfOutput output) const

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

Definition at line 551 of file executorDataManager.h.

◆ UpdateInvalidationTimestamp()

void UpdateInvalidationTimestamp ( VdfInvalidationTimestamp  timestamp)
inline

Increments the the current invalidation timestamp on this executor.

Definition at line 170 of file executorDataManager.h.


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