HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VdfNetwork Class Reference

#include <network.h>

Classes

class  EditMonitor
 

Public Member Functions

VDF_API VdfNetwork ()
 
VDF_API ~VdfNetwork ()
 
VDF_API const std::string GetNodeDebugName (const VdfNode *node) const
 
uint32_t GetOutputCapacity () const
 
size_t GetNodeCapacity () const
 
size_t GetNumOwnedNodes () const
 
const VdfNodeGetNode (size_t i) const
 
VdfNodeGetNode (size_t i)
 
VDF_API const VdfNodeGetNodeById (const VdfId nodeId) const
 
VDF_API VdfNodeGetNodeById (const VdfId nodeId)
 
Edit

Used by clients to edit networks, e.g., to perform incremental changes.

VDF_API void Clear ()
 
VDF_API VdfConnectionConnect (VdfOutput *output, VdfNode *inputNode, const TfToken &inputName, const VdfMask &mask, int atIndex=AppendConnection)
 
VDF_API VdfConnectionConnect (const VdfMaskedOutput &maskedOutput, VdfNode *inputNode, const TfToken &inputName, int atIndex=AppendConnection)
 
VDF_API bool Delete (VdfNode *node)
 
VDF_API void Disconnect (VdfConnection *connection)
 
VDF_API bool DisconnectAndDelete (VdfNode *node)
 
VDF_API void ReorderInputConnections (VdfInput *input, const TfSpan< const VdfConnectionVector::size_type > &newToOldIndices)
 
VDF_API void RegisterEditMonitor (EditMonitor *monitor)
 
VDF_API void UnregisterEditMonitor (EditMonitor *monitor)
 
size_t GetVersion () const
 
Statistics
VDF_API size_t DumpStats (std::ostream &os) const
 
Pool Chain Index
VDF_API VdfPoolChainIndex GetPoolChainIndex (const VdfOutput &output) const
 

Static Public Attributes

static const int AppendConnection = -1
 

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

VDF_API VdfNetwork::VdfNetwork ( )

Constructs an empty network.

VDF_API VdfNetwork::~VdfNetwork ( )

Destructs the network and the nodes managed by it.

Member Function Documentation

VDF_API void VdfNetwork::Clear ( )

Clears all nodes from the network.

VDF_API VdfConnection* VdfNetwork::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 VdfConnection* VdfNetwork::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 bool VdfNetwork::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 VdfNetwork::Disconnect ( VdfConnection connection)

Deletes connection from the network.

VDF_API bool VdfNetwork::DisconnectAndDelete ( VdfNode node)

Disconnects and deletes node.

Returns true, if the node has been deleted.

VDF_API size_t VdfNetwork::DumpStats ( std::ostream &  os) const

Prints useful statistics about the network to os.

Returns the numer of nodes owned by this network.

const VdfNode* VdfNetwork::GetNode ( size_t  i) const
inline

Returns the node at index i.

Definition at line 105 of file network.h.

VdfNode* VdfNetwork::GetNode ( size_t  i)
inline

Returns the non-const node at index i.

Definition at line 111 of file network.h.

VDF_API const VdfNode* VdfNetwork::GetNodeById ( const VdfId  nodeId) const

Returns the node with id nodeId, if it exists.

VDF_API VdfNode* VdfNetwork::GetNodeById ( const VdfId  nodeId)

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

size_t VdfNetwork::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.

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

Retrieves a debug name for a given node

size_t VdfNetwork::GetNumOwnedNodes ( ) const
inline

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

Definition at line 99 of file network.h.

uint32_t VdfNetwork::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.

VDF_API VdfPoolChainIndex VdfNetwork::GetPoolChainIndex ( const VdfOutput output) const

Returns the pool chain index from the pool chain indexer.

size_t VdfNetwork::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.

VDF_API void VdfNetwork::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 VdfNetwork::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.
VDF_API void VdfNetwork::UnregisterEditMonitor ( EditMonitor monitor)

Unregisters an edit monitor for this network.

Friends And Related Function Documentation

Definition at line 291 of file network.h.

friend class VdfNode
friend

Definition at line 290 of file network.h.

friend class VdfOutput
friend

Definition at line 292 of file network.h.

friend class VdfSchedule
friend

Definition at line 362 of file network.h.

Member Data Documentation

const int VdfNetwork::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: