|
HDK
|
#include <node.h>
Inheritance diagram for VdfNode:Classes | |
| class | InputMapIterator |
| class | OutputMapIterator |
Static Public Member Functions | |
| static VdfIndex | GetIndexFromId (const VdfId id) |
| static VdfVersion | GetVersionFromId (const VdfId id) |
Static Protected Member Functions | |
| template<typename BaseClassType , typename ClassType > | |
| static size_t | _GetMemoryUsage (const ClassType &c, size_t dynamicSize) |
Friends | |
| class | VdfNetwork |
This is the base class for all nodes in a VdfNetwork.
| VDF_API VdfNode::VdfNode | ( | VdfNetwork * | network, |
| const VdfInputSpecs & | inputSpecs, | ||
| const VdfOutputSpecs & | outputSpecs | ||
| ) |
Constructs a node in network with the inputs described by inputSpecs and outputs described by outputSpecs.
|
protected |
Protected constructor.
Can be used by derived classes that want to manage their own storage for input/output specs.
The derived constructor should call _InitializeInputAndOutputSpecs because this version of the constructor won't do it.
|
protectedvirtual |
Protected Destructor.
Only the network is allowed to destroy nodes.
|
protectedvirtual |
Gets an input/output specs pointer that the node can use. This is virtual so that a derived class may specify exactly where the storage comes from. This function is not called during performance-critical code-paths.
Reimplemented in VdfExtensibleNode.
|
protected |
Builds inputs from the supplied input specs and appends them to the already-existing set of inputs, if any.
Pointers to the newly-created VdfInputs are appended to resultingInputs, if resultingInputs is not NULL.
|
protected |
Builds outputs from the supplied output specs and appends them to the already-existing set of outputs, if any.
Pointers to the newly-created VdfOutputs are appended to resultingInputs, if resultingOutputs is not NULL.
Clears the input/output specs pointer.
This can be used in the destructor of derived classes to avoid having their own storage for the input/output specs go through the default destruction pattern of the base class.
|
protectedvirtual |
Returns a mask that indicates which elements of the data that flows along inputConnection are needed to compute the data flowing out as indicated by maskedOutput.
This is only called from ComputeInputDependencyMask(), to handle non-associated inputs.
The default implementation returns the connection mask on inputConnection, indicating that all elements are required. Derived classes can override this method in order to make the resulting dependencies more sparse.
This method should always return a mask that is a subset of the connection mask on inputConnection or an empty mask to indicate no dependencies.
Derived classes must ensure that this method is thread safe, in the sense that _ComputeInputDependencyMask() may be called simultaneously on a single node.
Reimplemented in VdfTestUtils::DependencyCallbackNode.
|
protectedvirtual |
Vectorized version of _ComputeInputDependencyMask.
Unlike _ComputeInputDependencyMask, non-trivial derived nodes do not have to implement this function.
Additional parameter skipAssociatedInputs can control if associated inputs should be considered.
|
protectedvirtual |
Vectorized version of _ComputeOutputDependencyMasks.
Unlike _ComputeDependencyMasks, non-trivial derived nodes do not have to implement this function. If a derived node is capable of supporting this vectorized API, then it can override this function.
|
protectedvirtual |
Returns a mask that indicates which elements of the data that flows along output depend on the elements indicated by inputDependencyMask that flow in via inputConnection.
This is only called from ComputeOutputDependencyMask(), to handle non-associated inputs.
The default implementation does the following:
output has an affects mask, the affects mask is returned, indicating that all affected elements depend on the input.Derived classes can override this method in order to make the resulting dependencies more sparse.
Derived classes must ensure that this method is thread safe, in the sense that _ComputeOutputDependencyMask() may be called simultaneously on a single node.
Reimplemented in VdfTestUtils::DependencyCallbackNode.
|
protectedvirtual |
Vectorized version of _ComputeOutputDependencyMask.
Unlike _ComputeDependencyMask, non-trivial derived nodes do not have to implement this function. If a derived node is capable of supporting this vectorized API, then it must return true. The base class returns false, meaning this is not implemented.
|
protectedvirtual |
Notifies a node that one connection has been added.
atIndex will either contain the atIndex parameter passed to VdfNetwork's Connect() method, which specifies at what index a new connection has been inserted, or VdfNetwork::AppendConnection if the new connection was appended.
|
inlinestaticprotected |
|
protected |
Initializes the input/output specs pointer for this node.
Only to be called from constructors of derived classes that want to manage their own storage for the input/output specs.
Can be overridden by derived classes to facilitate equality comparision.
The default implementation will always return false. Note that all connector specs, etc. are already taken care of via VdfNode::IsEqual().
Reimplemented in VdfEmptyInputVector, VdfInputVector< T >, and VdfTestUtils::CallbackNode.
|
protectedvirtual |
Releases an input/output specs pointer that was acquired with a previous call to _AcquireInputAndOutputSpecsPointer(). This is virtual so that a derived class may specify exactly where the storage comes from. This function is not called during performance-critical code-paths.
Reimplemented in VdfExtensibleNode.
|
protected |
Replaces the node's input specs with inputSpecs and rebuilds all inputs.
|
inlineprotected |
Sets the node id. The node id is controlled by VdfNetwork.
|
protectedvirtual |
|
pure virtual |
This is the method called to perform computation.
Derived classes must ensure that this method is thread safe, in the sense that Compute() may be called simultaneously on a single node.
Implemented in VdfTestUtils::CallbackNode, VdfSpeculationNode, and Vdf_InputVectorBase.
| VDF_API VdfMask::Bits VdfNode::ComputeInputDependencyMask | ( | const VdfMaskedOutput & | maskedOutput, |
| const VdfConnection & | inputConnection | ||
| ) | const |
Returns a mask that indicates which elements of the data that flows along inputConnection are needed to compute the data flowing out as indicated by maskedOutput.
This is used for dependency queries in the output-to-input direction.
inputConnection is associated with the output in maskedOutput, returns a mask that is computed based on the semantics of associated input/output pairs.inputConnection must be a connection that connects to an input on this node. The output in maskedOutput must be owned by this node.
| VDF_API VdfConnectionAndMaskVector VdfNode::ComputeInputDependencyMasks | ( | const VdfMaskedOutput & | maskedOutput, |
| bool | skipAssociatedInputs | ||
| ) | const |
Vectorized version of ComputeInputDependencyMask.
Additional parameter skipAssociatedInputs can control if associated inputs should be considered.
| VDF_API VdfConnectionAndMaskVector VdfNode::ComputeInputDependencyRequest | ( | const VdfMaskedOutputVector & | request | ) | const |
Vectorized version of ComputeInputDependencyMasks().
Computes all input dependencies for request in one go.
| VDF_API VdfMask VdfNode::ComputeOutputDependencyMask | ( | const VdfConnection & | inputConnection, |
| const VdfMask & | inputDependencyMask, | ||
| const VdfOutput & | output | ||
| ) | const |
Returns a mask that indicates which elements of the data that flows along output depend on the elements indicated by inputDependencyMask that flow in via inputConnection.
This is used for dependency queries in the input-to-output direction.
output is an associated output, returns a mask that is computed based on the semantics of associated input/output pairs.inputConnection must be a connection that connects to an input on this node. output must be owned by this node.
| VDF_API void VdfNode::ComputeOutputDependencyMasks | ( | const VdfConnection & | inputConnection, |
| const VdfMask & | inputDependencyMask, | ||
| VdfMaskedOutputVector * | outputDependencies | ||
| ) | const |
Vectorized version of ComputeOutputDependencyMask. For a given inputConnection and inputDependencyMask, returns the outputs and masks that depend on them in outputDependencies.
| VDF_API const std::string VdfNode::GetDebugName | ( | ) | const |
Returns the debug name for this node, if one is registered. Otherwise, returns the node type name by default.
|
inline |
Returns the input named inputName, returns NULL if no input of that name exists.
| VDF_API VdfConnectionVector VdfNode::GetInputConnections | ( | ) | const |
Returns a flat vector of all input connections.
|
inline |
|
inline |
|
virtual |
Returns the amount of memory used by the node in bytes.
Does not account for data structures to keep track of connections etc.
Reimplemented in Vdf_InputVectorBase.
|
inline |
|
inline |
|
inline |
|
inline |
Returns the output object named name.
Returns NULL if no such output exists, but issues no errors.
Returns the output object named name.
Returns NULL and issues a coding error if no such output exists.
|
inline |
Returns the only output object that this node contains.
It is only valid to call this method on nodes that contain exactly one output. A coding error will be issued otherwise.
Returns NULL if the node doesn't have exactly one output.
| VDF_API VdfConnectionVector VdfNode::GetOutputConnections | ( | ) | const |
Returns a flat vector of all output connections.
|
inline |
|
inline |
|
virtual |
Returns a predicate, determining whether a given input and its connections are required in order to fulfill this node's input dependencies.
This method is only allowed to read input values on the inputs that have been marked as prerequisites.
Reimplemented in VdfSpeculationNode.
|
inlinestatic |
|
inline |
|
inline |
|
inline |
Returns true, if rhs and this node compute the same value(s).
|
virtual |
Returns true if this node performs speculation.
The default implementation returns false.
Reimplemented in VdfSpeculationNode.
Sets the debug name for this node.
By default, a node's debug name is the node type name; this function appends name to the node type name.
|
inline |
| VDF_API void VdfNode::SetDebugNameCallback | ( | VdfNodeDebugNameCallback && | callback | ) |
Sets the debug name for this node with a lazily invoked callback.
By default, a node's debug name is the node type name; this function appends the string returned by callback to the node type name.
If callback is empty, return without setting the debug name.
| VdfNode::TF_MALLOC_TAG_NEW | ( | "Vdf" | , |
| "new VdfNode" | |||
| ) |
|
friend |