Loading...
Searching...
No Matches

An input option is an element of an input registration that applies to a value specifier, modifying its behavior. More...

+ Collaboration diagram for Input Options:

Functions

This & InputName (const TfToken &inputName)
 Overrides the default input name, setting it to inputName.
 
This & Required ()
 Declares the input is required, i.e., that the computation expects an input value always to be provided at evaluation time.
 
This & FallsBackToDispatched ()
 Declares the input can find dispatched computations if the requested computation name doesn't match a local computation on the provider.
 

Detailed Description

An input option is an element of an input registration that applies to a value specifier, modifying its behavior.

A value specifier may be followed by zero or more input options.

Function Documentation

◆ FallsBackToDispatched()

This & FallsBackToDispatched ( )
inline

Declares the input can find dispatched computations if the requested computation name doesn't match a local computation on the provider.

See also
DispatchedPrimComputation

Example

{
// Register a dispatched prim computation.
self.DispatchedPrimComputation(_tokens->myDispatchedComputation)
.Callback<double>(+[](const VdfContext &) { return 11.0; })
// Register a prim computation that requests the above dispatched
// computation via uses relationship targets.
self.PrimComputation(_tokens->myComputation)
.Callback<double>(+[](const VdfContext &ctx) {
const double *const valuePtr =
ctx.GetInputValuePtr<double>(
_tokens->myDispatchedComputation);
return valuePtr ? *valuePtr : -1.0;
})
.Inputs(
Relationship(_tokens->myRelationship)
.TargetedObjects<double>(
_tokens->myDispatchedComputation)
}
A context is the parameter bundle passed to callbacks of computations.
Definition: context.h:40
#define EXEC_REGISTER_COMPUTATIONS_FOR_SCHEMA(SchemaType)
Initiates registration of exec computations for the schema SchemaType.
This & FallsBackToDispatched()
Declares the input can find dispatched computations if the requested computation name doesn't match a...

Definition at line 414 of file computationBuilders.h.

◆ InputName()

This & InputName ( const TfToken inputName)
inline

Overrides the default input name, setting it to inputName.

Example

{
// Register a prim computation that returns the value of another
// prim computation, using a non-default input name.
self.PrimComputation(_tokens->myComputation)
.Callback<double>(+[](const VdfContext &ctx) {
const double *const valuePtr =
ctx.GetInputValuePtr<double>(_tokens->myInputName);
return valuePtr ? *valuePtr : 0.0;
})
.Inputs(
Computation<double>(_tokens->anotherComputation)
.InputName(_tokens->myInputName));
}

Definition at line 346 of file computationBuilders.h.

◆ Required()

This & Required ( )
inline

Declares the input is required, i.e., that the computation expects an input value always to be provided at evaluation time.

If exec compilation is unable to compile input connections for a required input, an error will be emitted.

Example

{
// Register a prim computation that returns the value of another
// prim computation, using a non-default input name.
self.PrimComputation(_tokens->myComputation)
.Callback<int>(+[](const VdfContext &ctx) {
return ctx.GetInputValue<int>(_tokens->myInputName);
})
.Inputs(
Computation<int>(_tokens->anotherComputation).Required());
}

Definition at line 375 of file computationBuilders.h.