![]() |
|
This is a data container for executor data managers that uses data stored in vectors indexed by output ids. More...
#include <parallelExecutorDataVector.h>
Public Types | |
| using | DataHandle = size_t |
| The data handle type is an index into the internal data vector. | |
Public Member Functions | |
| Vdf_ParallelExecutorDataVector () | |
| Constructor. | |
| VDF_API | ~Vdf_ParallelExecutorDataVector () |
| Destructor. | |
| VDF_API void | Resize (const VdfNetwork &network) |
| Resize the data manager to accommodate the given network. | |
| DataHandle | GetOrCreateDataHandle (const VdfId outputId) const |
Returns an existing data handle, or creates a new one for the given output. | |
| DataHandle | GetDataHandle (const VdfId outputId) const |
Returns an existing data handle for the given output. | |
| VdfExecutorBufferData * | GetPrivateBufferData (const DataHandle handle) const |
Returns the VdfExecutorBufferData associated with the given handle. | |
| VdfExecutorBufferData * | GetScratchBufferData (const DataHandle handle) const |
Returns the VdfExecutorBufferData associated with the given handle. | |
| VdfExecutorBufferData * | GetPublicBufferData (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. | |
| 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 timestamp) |
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) |
Marks the data at the given output as having been touched by evaluation. | |
| bool | Untouch (const VdfId outputId) |
Marks the data at the given handle as not having been touched by evaluation. | |
| size_t | GetNumData () const |
| Returns the number of outputs that have data associated with them. | |
| VDF_API void | Reset (const DataHandle handle, const VdfId outputId) const |
Resets the output data at the given data handle to a newly constructed state. | |
| VDF_API void | Clear () |
| Clears all the data from this manager. | |
Static Public Attributes | |
| static const size_t | InvalidHandle = size_t(-1) |
| This sentinel index denotes an invalid handle. | |
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.
| using DataHandle = size_t |
The data handle type is an index into the internal data vector.
Definition at line 46 of file parallelExecutorDataVector.h.
|
inline |
Constructor.
Definition at line 54 of file parallelExecutorDataVector.h.
| VDF_API ~Vdf_ParallelExecutorDataVector | ( | ) |
Destructor.
| 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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
inline |
Returns true if the data at the given output has been touched by evaluation.
Definition at line 217 of file parallelExecutorDataVector.h.
|
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.
|
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 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.
|
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 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.
|
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.
|
inline |
Marks the data at the given output as having been touched by evaluation.
Definition at line 230 of file parallelExecutorDataVector.h.
|
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.
|
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.
|
static |
This sentinel index denotes an invalid handle.
Definition at line 50 of file parallelExecutorDataVector.h.