Loading...
Searching...
No Matches
VdfNetwork Class Reference

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 VdfNodeGetNode (size_t i) const
 Returns the node at index i.
 
VdfNodeGetNode (size_t i)
 Returns the non-const node at index i.
 
VDF_API const VdfNodeGetNodeById (const VdfId nodeId) const
 Returns the node with id nodeId, if it exists.
 
VDF_API VdfNodeGetNodeById (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 VdfConnectionConnect (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 VdfConnectionConnect (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
 

Detailed Description

A VdfNetwork is a collection of VdfNodes and their connections.

Definition at line 59 of file network.h.

Constructor & Destructor Documentation

◆ VdfNetwork()

VDF_API VdfNetwork ( )

Constructs an empty network.

◆ ~VdfNetwork()

VDF_API ~VdfNetwork ( )

Destructs the network and the nodes managed by it.

Member Function Documentation

◆ Clear()

VDF_API void Clear ( )

Clears all nodes from the network.

◆ Connect() [1/2]

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.

◆ Connect() [2/2]

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.

◆ Delete()

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.

◆ Disconnect()

VDF_API void Disconnect ( VdfConnection connection)

Deletes connection from the network.

◆ DisconnectAndDelete()

VDF_API bool DisconnectAndDelete ( VdfNode node)

Disconnects and deletes node.

Returns true, if the node has been deleted.

◆ DumpStats()

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.

◆ GetNode() [1/2]

VdfNode * GetNode ( size_t  i)
inline

Returns the non-const node at index i.

Definition at line 111 of file network.h.

◆ GetNode() [2/2]

const VdfNode * GetNode ( size_t  i) const
inline

Returns the node at index i.

Definition at line 105 of file network.h.

◆ GetNodeById() [1/2]

VDF_API VdfNode * GetNodeById ( const VdfId  nodeId)

Returns the non-const node with id nodeId, if it exists.

◆ GetNodeById() [2/2]

VDF_API const VdfNode * GetNodeById ( const VdfId  nodeId) const

Returns the node with id nodeId, if it exists.

◆ GetNodeCapacity()

size_t GetNodeCapacity ( ) const
inline

Returns the number of entries currently available for nodes and for which it is valid to call GetNode().

Note that some entries may be NULL.

Definition at line 95 of file network.h.

◆ GetNodeDebugName()

VDF_API const std::string GetNodeDebugName ( const VdfNode node) const

Retrieves a debug name for a given node.

◆ GetNumOwnedNodes()

size_t GetNumOwnedNodes ( ) const
inline

Returns the number of nodes that are currently owned by the network.

Definition at line 99 of file network.h.

◆ GetOutputCapacity()

uint32_t GetOutputCapacity ( ) const
inline

Returns the number of indices currently available for outputs.

Note that this is a high water mark, and that the number of outputs currently in the network may be less than the value returned.

Definition at line 87 of file network.h.

◆ GetPoolChainIndex()

VDF_API VdfPoolChainIndex GetPoolChainIndex ( const VdfOutput output) const

Returns the pool chain index from the pool chain indexer.

◆ GetVersion()

size_t GetVersion ( ) const
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!

Definition at line 259 of file network.h.

◆ RegisterEditMonitor()

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.

◆ ReorderInputConnections()

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.

Parameters
inputThe input with the input connections to be reordered.
newToOldIndicesFor 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.

◆ UnregisterEditMonitor()

VDF_API void UnregisterEditMonitor ( EditMonitor monitor)

Unregisters an edit monitor for this network.

Friends And Related Function Documentation

◆ VdfIsolatedSubnetwork

friend class VdfIsolatedSubnetwork
friend

Definition at line 291 of file network.h.

◆ VdfNode

friend class VdfNode
friend

Definition at line 290 of file network.h.

◆ VdfOutput

friend class VdfOutput
friend

Definition at line 292 of file network.h.

◆ VdfSchedule

friend class VdfSchedule
friend

Definition at line 362 of file network.h.

Member Data Documentation

◆ AppendConnection

const int AppendConnection = -1
static

Constant for connection API to indicate to place the connection at the end.

Definition at line 66 of file network.h.


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