![]() |
|
A VdfNetwork is a collection of VdfNodes and their connections. More...
#include <network.h>
Classes | |
| class | EditMonitor |
| An abstract class to monitor network edit operations. More... | |
Public Member Functions | |
| VDF_API | VdfNetwork () |
| Constructs an empty network. | |
| VDF_API | ~VdfNetwork () |
| Destructs the network and the nodes managed by it. | |
| VDF_API const std::string | GetNodeDebugName (const VdfNode *node) const |
| Retrieves a debug name for a given node. | |
| uint32_t | GetOutputCapacity () const |
| Returns the number of indices currently available for outputs. | |
| size_t | GetNodeCapacity () const |
| Returns the number of entries currently available for nodes and for which it is valid to call GetNode(). | |
| size_t | GetNumOwnedNodes () const |
| Returns the number of nodes that are currently owned by the network. | |
| const VdfNode * | GetNode (size_t i) const |
Returns the node at index i. | |
| VdfNode * | GetNode (size_t i) |
Returns the non-const node at index i. | |
| VDF_API const VdfNode * | GetNodeById (const VdfId nodeId) const |
Returns the node with id nodeId, if it exists. | |
| VDF_API VdfNode * | GetNodeById (const VdfId nodeId) |
Returns the non-const node with id nodeId, if it exists. | |
Edit | |
Used by clients to edit networks, e.g., to perform incremental changes. | |
| VDF_API void | Clear () |
| Clears all nodes from the network. | |
| VDF_API VdfConnection * | Connect (VdfOutput *output, VdfNode *inputNode, const TfToken &inputName, const VdfMask &mask, int atIndex=AppendConnection) |
Connects the output to the given inputNode's input inputName with mask. | |
| VDF_API VdfConnection * | Connect (const VdfMaskedOutput &maskedOutput, VdfNode *inputNode, const TfToken &inputName, int atIndex=AppendConnection) |
Connects the maskedOutput to the given inputNode's input inputName. | |
| VDF_API bool | Delete (VdfNode *node) |
Deletes node from the network. | |
| VDF_API void | Disconnect (VdfConnection *connection) |
Deletes connection from the network. | |
| VDF_API bool | DisconnectAndDelete (VdfNode *node) |
Disconnects and deletes node. | |
| VDF_API void | ReorderInputConnections (VdfInput *input, const TfSpan< const VdfConnectionVector::size_type > &newToOldIndices) |
Reorders all input connections for input according to the mapping defined by newToOldIndices. | |
| VDF_API void | RegisterEditMonitor (EditMonitor *monitor) |
| Registers an edit monitor for this network. | |
| VDF_API void | UnregisterEditMonitor (EditMonitor *monitor) |
| Unregisters an edit monitor for this network. | |
| size_t | GetVersion () const |
| Returns the current edit version of the network. | |
Statistics | |
| VDF_API size_t | DumpStats (std::ostream &os) const |
Prints useful statistics about the network to os. | |
Pool Chain Index | |
| VDF_API VdfPoolChainIndex | GetPoolChainIndex (const VdfOutput &output) const |
| Returns the pool chain index from the pool chain indexer. | |
Static Public Attributes | |
| static const int | AppendConnection = -1 |
| Constant for connection API to indicate to place the connection at the end. | |
Friends | |
| class | VdfNode |
| class | VdfIsolatedSubnetwork |
| class | VdfOutput |
| class | VdfSchedule |
A VdfNetwork is a collection of VdfNodes and their connections.
| VDF_API VdfNetwork | ( | ) |
Constructs an empty network.
| VDF_API ~VdfNetwork | ( | ) |
Destructs the network and the nodes managed by it.
| VDF_API void Clear | ( | ) |
Clears all nodes from the network.
| VDF_API VdfConnection * Connect | ( | const VdfMaskedOutput & | maskedOutput, |
| VdfNode * | inputNode, | ||
| const TfToken & | inputName, | ||
| int | atIndex = AppendConnection |
||
| ) |
Connects the maskedOutput to the given inputNode's input inputName.
If atIndex is >= 0 the connection will be placed at index atIndex on the target input. Otherwise it will be appened at the end.
| VDF_API VdfConnection * Connect | ( | VdfOutput * | output, |
| VdfNode * | inputNode, | ||
| const TfToken & | inputName, | ||
| const VdfMask & | mask, | ||
| int | atIndex = AppendConnection |
||
| ) |
Connects the output to the given inputNode's input inputName with mask.
If atIndex is >= 0 the connection will be placed at index atIndex on the target input. Otherwise it will be appened at the end.
| VDF_API bool Delete | ( | VdfNode * | node | ) |
Deletes node from the network.
The node must have no inputs and no outputs connected.
Note: Calling Delete() may change the index VdfNetwork assigns to each VdfNode.
Returns true, if the node has been deleted.
| VDF_API void Disconnect | ( | VdfConnection * | connection | ) |
Deletes connection from the network.
| VDF_API bool DisconnectAndDelete | ( | VdfNode * | node | ) |
Disconnects and deletes node.
Returns true, if the node has been deleted.
| VDF_API size_t DumpStats | ( | std::ostream & | os | ) | const |
Prints useful statistics about the network to os.
Returns the numer of nodes owned by this network.
|
inline |
|
inline |
Returns the non-const node with id nodeId, if it exists.
Returns the node with id nodeId, if it exists.
|
inline |
| VDF_API const std::string GetNodeDebugName | ( | const VdfNode * | node | ) | const |
Retrieves a debug name for a given node.
|
inline |
|
inline |
| VDF_API VdfPoolChainIndex GetPoolChainIndex | ( | const VdfOutput & | output | ) | const |
Returns the pool chain index from the pool chain indexer.
|
inline |
Returns the current edit version of the network.
The version will be updated every time the network topology changes.
Note, no assumptions shall be made about the absolute value returned from this function. It is merely guaranteed that if two version of the same VdfNetwork instance equal, no topological edits have been made!
| VDF_API void RegisterEditMonitor | ( | EditMonitor * | monitor | ) |
Registers an edit monitor for this network.
The edit monitor needs to be persistent as long as the network is alive and will receive notifications for network edits.
| VDF_API void ReorderInputConnections | ( | VdfInput * | input, |
| const TfSpan< const VdfConnectionVector::size_type > & | newToOldIndices | ||
| ) |
Reorders all input connections for input according to the mapping defined by newToOldIndices.
| input | The input with the input connections to be reordered. |
| newToOldIndices | For each index i, newToOldIndices[i] is the old connection index and i is the desired new connection index. The number of indices given must be the same as the number of input connections, each index must be a valid connection index, and the indices must be unique. |
| VDF_API void UnregisterEditMonitor | ( | EditMonitor * | monitor | ) |
Unregisters an edit monitor for this network.
|
friend |
|
friend |
|
static |