Loading...
Searching...
No Matches
VdfTestUtils Namespace Reference

This file contains classes to facilitate network creation in unit tests. More...

Classes

class  CallbackNode
 A helper class that implements a simple callback node. More...
 
class  CallbackNodeType
 This class specifies a CallbackNode with a given callback function. More...
 
class  DependencyCallbackNode
 A CallbackNode which allows for passing in a custom input / output dependency callback. More...
 
class  ExecutionStats
 Simple wrapper around ExecutionStats that allows for logging arbitrary data for testing. More...
 
class  ExecutionStatsProcessor
 Simple processor that processor ExecutionStats into a vector of vector of events and a vector of substats that mirrors the internal structure of ExecutionStats. More...
 
class  InputNodeType
 This class specifies a VdfInputVector of type T. More...
 
class  Network
 This is a container class used to hold on to all the nodes and to facilitate their management. More...
 
class  Node
 This class is a wrapper around a VdfNode. More...
 
class  NodeType
 Base class for various kinds of nodes that can be created. More...
 
class  OutputAccessor
 A helper class which enables access to a VdfOutput from a VdfContext. More...
 

Functions

std::unique_ptr< VdfSpeculationExecutorBase > CreateSpeculationExecutor (const VdfSpeculationNode *speculationNode, const VdfExecutorInterface *parentExecutor)
 Create a new test speculation executor.
 

Detailed Description

This file contains classes to facilitate network creation in unit tests.

Simple example of how to use these classes:

VdfTestUtils::Network graph; // The container for the nodes.
VdfTestUtils::CallbackNodeType outType; // The consumer node type.
// Consumer nodes read and write ints.
outType.ReadWrite<int>(_tokens->moves, _tokens->moves);
graph.AddInputVector<int>("input", 3); // Add an input node.
graph.Add("consume", outType); // Add a consumer node.
graph["input"] // Add a few input values to
.SetValue(0, 11) // the input node.
.SetValue(1, 22)
.SetValue(2, 33)
;
// Finally, connect node "input"'s default output to "consume's" moves
// input with a mask.
graph["input"] >>
graph["consume"].In(_tokens->moves, VdfMask::AllOnes(3));
static VdfMask AllOnes(size_t size)
Returns a mask of the requested size that will iterate over all elements.
Definition: mask.h:494
This class specifies a CallbackNode with a given callback function.
Definition: testUtils.h:238
CallbackNodeType & ReadWrite(const TfToken &name, const TfToken &outName)
Adds a ReadWrite input and an associated Output to this node type.
Definition: testUtils.h:267
This is a container class used to hold on to all the nodes and to facilitate their management.
Definition: testUtils.h:406
VDF_API void Add(const std::string &nodeName, const NodeType &nodeType)
Creates a node named nodeName of type nodeType.
void AddInputVector(const std::string &nodeName, size_t size=1)
Creates an input vector of type T named nodeName.
Definition: testUtils.h:487

Function Documentation

◆ CreateSpeculationExecutor()

std::unique_ptr< VdfSpeculationExecutorBase > CreateSpeculationExecutor ( const VdfSpeculationNode speculationNode,
const VdfExecutorInterface parentExecutor 
)
inline

Create a new test speculation executor.

Definition at line 678 of file testUtils.h.