|
Bifrost SDK
Bifrost SDK documentation
|
The Job class that executes a graph with inputs/outputs coming/going from/to host. More...
#include <Job.h>
Classes | |
| struct | Input |
| A Job input descriptor. More... | |
| struct | Output |
| A Job output descriptor. More... | |
| struct | TerminalState |
| A Job Terminal State descriptor. More... | |
Public Types | |
| using | Inputs = Amino::Array< Input > |
| A collection of Job inputs. More... | |
| using | Outputs = Amino::Array< Output > |
| A collection of Job outputs. More... | |
| using | TerminalStates = Amino::Array< TerminalState > |
| A collection of Job Terminal States. More... | |
Public Member Functions | |
| ~Job () noexcept | |
| Destructor. More... | |
| bool | isValid () const noexcept |
| Check if this Job has been successfully initialized. More... | |
| void | enableRuntimeLogging (bool enable) noexcept |
| Set whether runtime logging should be enabled when executing the job. During a job execution, some operators may report messages to the Amino::RuntimeServices. If the runtime logging is disabled, those messages will not be reported to the Workspace. More... | |
| bool | isRuntimeLoggingEnabled () const noexcept |
| Query whether or not runtime logging is enabled when executing the job. More... | |
| const Inputs & | getInputs () const noexcept |
| Get the Job inputs. More... | |
| bool | setInputValue (const Input &input, const TypeTranslation::ValueData *valueData) noexcept |
| Set the given Job input value. More... | |
| JobExecutionStatus | execute (JobExecutionMode mode=JobExecutionMode::kDefault) noexcept |
| Execute the job with current inputs. More... | |
| const Outputs & | getOutputs () const noexcept |
| Get the Job outputs. More... | |
| bool | getOutputValue (const Output &output, TypeTranslation::ValueData *valueData) const noexcept |
| Retrieve the given Job output value. More... | |
| bool | setTerminalStates (const TerminalStates &terminalStates) noexcept |
| Set the terminal states. More... | |
| const GraphContainer & | getGraphContainer () const noexcept |
| Access the GraphContainer which owns this Job. More... | |
| GraphContainer & | getGraphContainer () noexcept |
| Access the GraphContainer which owns this Job. More... | |
| const Workspace & | getWorkspace () const noexcept |
| Access this Job's Workspace ancestor, i.e. the one that owns the GraphContainer associated with this Job. More... | |
| Workspace & | getWorkspace () noexcept |
| Access this Job's Workspace ancestor, i.e. the one that owns the GraphContainer associated with this Job. More... | |
| const Private::IRestrictedJobServices & | getRestrictedServices () const noexcept |
| Obtain an interface giving access to private Job services. More... | |
| Private::IRestrictedJobServices & | getRestrictedServices () noexcept |
| Obtain an interface giving access to private Job services. More... | |
Static Public Member Functions | |
| static Job & | getInvalid () noexcept |
| Get a statically allocated Job that is uninitialized, invalid and not owned by any GraphContainer. Any operation on this instance will always fail and Job::isValid will return false. More... | |
The Job class that executes a graph with inputs/outputs coming/going from/to host.
|
noexcept |
Destructor.
The destructor should not be called directly since a Job is managed by the GraphContainer.
|
noexcept |
Set whether runtime logging should be enabled when executing the job. During a job execution, some operators may report messages to the Amino::RuntimeServices. If the runtime logging is disabled, those messages will not be reported to the Workspace.
| [in] | enable | The desired state of runtime logging. |
|
noexcept |
Execute the job with current inputs.
Each Job input value is consumed by the execution and needs to be set prior to the next execution (see Job::getInputs and Job::setInputValue).
| [in] | mode | The mode on how to execute the job (see JobExecutionMode). |
|
noexcept |
Access the GraphContainer which owns this Job.
|
noexcept |
Access the GraphContainer which owns this Job.
|
noexcept |
Get the Job inputs.
For each Job input, its value can be set using Job::setInputValue, and then the graph can be executed using Job::execute.
|
staticnoexcept |
Get a statically allocated Job that is uninitialized, invalid and not owned by any GraphContainer. Any operation on this instance will always fail and Job::isValid will return false.
|
noexcept |
Get the Job outputs.
Once the graph has been compiled, and the Job input values have been set (see Job::getInputs and Job::setInputValue), and the Job has been executed (see Job::execute), then the value of each Job output can be retrieved using Job::getOutputValue.
|
noexcept |
Retrieve the given Job output value.
This method allows one to retrieve the value of a Job output obtained from Job::getOutputs.
When a Job output value is retrieved, it is converted to a host data by calling TypeTranslation::convertValueToHost on the TypeTranslation shared library that has been registered for the type of this output.
| [in] | output | The Job output. |
| [in,out] | valueData | The host data that will be passed to TypeTranslation::convertValueToHost. |
|
noexcept |
Obtain an interface giving access to private Job services.
|
noexcept |
Obtain an interface giving access to private Job services.
|
noexcept |
Access this Job's Workspace ancestor, i.e. the one that owns the GraphContainer associated with this Job.
|
noexcept |
Access this Job's Workspace ancestor, i.e. the one that owns the GraphContainer associated with this Job.
|
noexcept |
Query whether or not runtime logging is enabled when executing the job.
|
noexcept |
|
noexcept |
Set the given Job input value.
This method allows one to manually set the value of a Job input obtained from Job::getInputs.
When a Job input value is set, it is converted from a host data by calling TypeTranslation::convertValueFromHost on the TypeTranslation shared library that has been registered for the type of this input.
If a Job input value is not manually set before Job::execute is called, its default value (coming from the graph, if any) will be used (see Job::Input::defaultValue).
| [in] | input | The Job input. |
| [in] | valueData | The host data that will be passed to TypeTranslation::convertValueFromHost. |
|
noexcept |
Set the terminal states.
Terminals can be explicitly deactivated at the job level.
| [in] | terminalStates | List of terminals that should be activated or deactivated at the job level. |