Bifrost SDK
Bifrost SDK documentation
Job.h
Go to the documentation of this file.
1//-
2// ================================================================================================
3// Copyright 2025 Autodesk, Inc. All rights reserved.
4//
5// Use of this software is subject to the terms of the Autodesk license agreement provided
6// at the time of installation or download, or which otherwise accompanies this software in
7// either electronic or hard copy form.
8// ================================================================================================
9//+
10
15
16#ifndef BIFROSTGRAPH_EXECUTOR_JOB_H
17#define BIFROSTGRAPH_EXECUTOR_JOB_H
18
21
22#include <BifrostGraph/Executor/internal/ExecutorExport.h>
23#include <BifrostGraph/Executor/internal/PropagateConstPtr.h>
24
25#include <Amino/Core/Any.h>
26#include <Amino/Core/String.h>
27
28//-------------------------------------------------------------------------------------------------
29// Forward declarations
30//-------------------------------------------------------------------------------------------------
31
32namespace BifrostGraph {
33namespace Executor {
34
35class GraphContainer;
36class Workspace;
37
38namespace Private {
39class IJobOwner;
40class IRestrictedJobServices;
41class JobImpl;
42} // namespace Private
43
45
46//-------------------------------------------------------------------------------------------------
47// CLASS Job
48//-------------------------------------------------------------------------------------------------
49
52class BIFROSTGRAPH_EXECUTOR_SHARED_DECL Job final {
53public:
55 struct BIFROSTGRAPH_EXECUTOR_SHARED_DECL Input final {
59 bool isJobPort;
60 };
63
65 struct BIFROSTGRAPH_EXECUTOR_SHARED_DECL Output final {
69 bool isEnabled;
70 };
73
75 struct BIFROSTGRAPH_EXECUTOR_SHARED_DECL TerminalState final {
77 bool enabled;
78 };
81
82private:
83 //---------------------------------------------------------------------------------------------
84 // Initialization
85 //---------------------------------------------------------------------------------------------
86
97 explicit Job(Private::IJobOwner& owner) noexcept;
98
105 explicit Job(Uninitialized uninitialized) noexcept;
106
109
110public:
115 ~Job() noexcept;
116
124 bool isValid() const noexcept;
125
129 static Job& getInvalid() noexcept;
130
136 const GraphContainer& getGraphContainer() const noexcept;
137 GraphContainer& getGraphContainer() noexcept;
139
145 const Workspace& getWorkspace() const noexcept;
146 Workspace& getWorkspace() noexcept;
148
153 void enableRuntimeLogging(bool enable) noexcept;
154
158 bool isRuntimeLoggingEnabled() const noexcept;
159
170 const Inputs& getInputs() const noexcept;
171
188 bool setInputValue(const Input& input, const TypeTranslation::ValueData* valueData) noexcept;
189
206 JobExecutionStatus execute(JobExecutionMode mode = JobExecutionMode::kDefault) noexcept;
207
220 const Outputs& getOutputs() const noexcept;
221
235 bool getOutputValue(const Output& output, TypeTranslation::ValueData* valueData) const noexcept;
236
242 bool setTerminalStates(const TerminalStates& terminalStates) noexcept;
243
244 //---------------------------------------------------------------------------------------------
245 // IRestrictedJobServices
246 //---------------------------------------------------------------------------------------------
247
252 const Private::IRestrictedJobServices& getRestrictedServices() const noexcept;
253 Private::IRestrictedJobServices& getRestrictedServices() noexcept;
255
256private:
259 Job(const Job&) = delete;
260 Job(Job&&) = delete;
261 Job& operator=(const Job&) = delete;
262 Job& operator=(Job&&) = delete;
264
265private:
266 Internal::PropagateConstPtr<Private::JobImpl, Internal::Owned::kYes> m_impl;
267 static Job g_invalid;
268};
269
270} // namespace Executor
271} // namespace BifrostGraph
272
273#endif // BIFROSTGRAPH_EXECUTOR_JOB_H
A generic value object.
String class.
Provide factory functions for Executor core classes.
BifrostGraph Executor TypeTranslation.
#define EXECUTOR_DECLARE_MAKE_OWNER_FRIENDSHIP()
Helper macro to declare friend the makeOwner<> factory functions.
Definition: Factory.h:115
JobExecutionMode
Modes for job execution.
Definition: Types.h:99
Uninitialized
Tag for explicitly specifying that a constructor should not initialize any data members,...
Definition: Types.h:59
JobExecutionStatus
Status of job execution.
Definition: Types.h:105
Generic value class that allows for storage of a value of any type.
Definition: Any.h:180
Define a Amino array of elements of type T.
Definition: Array.h:105
The string class used by Amino.
Definition: String.h:46
The GraphContainer class that loads a graph to be executed and manages the Jobs that execute this gra...
The Job class that executes a graph with inputs/outputs coming/going from/to host.
Definition: Job.h:52
~Job() noexcept
Destructor.
A Job input descriptor.
Definition: Job.h:55
Amino::String name
The input's name.
Definition: Job.h:56
Amino::String typeName
The fully qualified name of the input's data type.
Definition: Job.h:57
Amino::Any defaultValue
The input's default value (coming from the graph).
Definition: Job.h:58
bool isJobPort
Whether or not the input is a Job port.
Definition: Job.h:59
A Job output descriptor.
Definition: Job.h:65
Amino::String typeName
The fully qualified name of the output's data type.
Definition: Job.h:67
bool isTerminal
Whether or not the output is a Terminal.
Definition: Job.h:68
bool isEnabled
Whether or not this output is enabled.
Definition: Job.h:69
Amino::String name
The output's name.
Definition: Job.h:66
A Job Terminal State descriptor.
Definition: Job.h:75
bool enabled
Whether or not this terminal is enabled.
Definition: Job.h:77
Amino::String name
The fully qualified name of the terminal.
Definition: Job.h:76
BifrostGraph Executor TypeTranslation.
The Workspace is the central element of the BifrostGraph Executor.
Definition: Workspace.h:69