omni::graph::core::ogn::constructInputFromOutput

Defined in omni/graph/core/ogn/Database.h

template<eMemoryType MemoryType>
static inline ogn::RuntimeAttribute<ogn::kOgnInput, MemoryType> omni::graph::core::ogn::constructInputFromOutput(OmniGraphDatabase const &db, ogn::RuntimeAttribute<ogn::kOgnOutput, MemoryType> const &output, NameToken outputToken)

Creates an input RuntimeAttribute from an output RuntimeAttribute.

When nodes have to chain the result of multiple computations, for example when accumulating a value in a loop, it is often necessary to treat the output attribute as an input in the next iteration of the loop. Because the runtime attributes are strongly typed and different depending if they are inputs or outputs, they cannot be used interchangeably as arguments to functions which compute one iteration of a computation.

This helper function creates an input RuntimeAttribute from the same handle as the original output attribute. The raw data pointer of the original attribute and the newly constructed input attribute are the same.

Template Parameters

MemoryType – The location of the memory expected for the attribute

Parameters
  • db[in] The node database.

  • output[in] The original output RuntimeAttribute.

  • outputToken[in] The original output RuntimeAttribute name token.

Returns

Returns a RuntimeAttribute with the template type ogn::kOgnInput and the same handle as the original output attribute.