Bifrost SDK
Bifrost SDK documentation
GraphContainer.h
Go to the documentation of this file.
1//-
2// ================================================================================================
3// Copyright 2024 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_GRAPHCONTAINER_H
17#define BIFROSTGRAPH_EXECUTOR_GRAPHCONTAINER_H
18
22
23#include <BifrostGraph/Executor/internal/ExecutorExport.h>
24#include <BifrostGraph/Executor/internal/PropagateConstPtr.h>
25
26#include <Amino/Core/String.h>
27
28//-------------------------------------------------------------------------------------------------
29// Forward declarations
30//-------------------------------------------------------------------------------------------------
31
32namespace BifrostGraph {
33namespace Executor {
34
35class Job;
36class Workspace;
37
38namespace Private {
39class GraphContainerImpl;
40class JobImpl;
41class IGraphContainerOwner;
42class IRestrictedGraphContainerServices;
43} // namespace Private
44
46
47//-------------------------------------------------------------------------------------------------
48// CLASS GraphContainer
49//-------------------------------------------------------------------------------------------------
50
54class BIFROSTGRAPH_EXECUTOR_SHARED_DECL GraphContainer {
55protected:
56 //---------------------------------------------------------------------------------------------
57 // Initialization
58 //---------------------------------------------------------------------------------------------
59
75 explicit GraphContainer(Private::IGraphContainerOwner& owner) noexcept;
76
85 explicit GraphContainer(Uninitialized uninitialized) noexcept;
86
89
90 struct SetGraphInfo;
91
92public:
99 virtual ~GraphContainer() noexcept;
100
108 virtual bool isValid() const noexcept;
109
113 static GraphContainer& getInvalid() noexcept;
114
119 const Workspace& getWorkspace() const noexcept;
120 Workspace& getWorkspace() noexcept;
122
123 //---------------------------------------------------------------------------------------------
124 // Graph Management
125 //---------------------------------------------------------------------------------------------
126
147 bool setGraph(const Amino::String& name, SetGraphMode mode = SetGraphMode::kDefault) noexcept;
148
152 Amino::String getGraphName() const noexcept;
153
158 Amino::String getGraphQualifiedName() const noexcept;
159
177
178 //---------------------------------------------------------------------------------------------
179 // Job Management
180 //---------------------------------------------------------------------------------------------
181
186 const Job& getJob() const noexcept;
187 Job& getJob() noexcept;
189
190protected:
196 void reportMessage(MessageCategory category, const Amino::String& message) const noexcept;
197
217 };
218
219private:
220 friend class Private::GraphContainerImpl;
221
232 virtual void onBeginSetGraph(const SetGraphInfo& graphInfo) noexcept;
233
242 virtual void onEndSetGraph(const SetGraphInfo& graphInfo) noexcept;
243
247 virtual void onBeginCompileGraph() noexcept;
248
253 virtual void onEndCompileGraph(GraphCompilationStatus status) noexcept;
254
255public:
256 //---------------------------------------------------------------------------------------------
257 // IRestrictedGraphContainerServices
258 //---------------------------------------------------------------------------------------------
259
270 const Private::IRestrictedGraphContainerServices& getRestrictedServices() const noexcept;
271 Private::IRestrictedGraphContainerServices& getRestrictedServices() noexcept;
273
274private:
277 GraphContainer(const GraphContainer&) = delete;
278 GraphContainer(GraphContainer&&) = delete;
279 GraphContainer& operator=(const GraphContainer&) = delete;
280 GraphContainer& operator=(GraphContainer&&) = delete;
282
283private:
284 Internal::PropagateConstPtr<Private::GraphContainerImpl, Internal::Owned::kYes> m_impl;
285 static GraphContainer s_invalid;
286};
287
288} // namespace Executor
289} // namespace BifrostGraph
290
291#endif // BIFROSTGRAPH_EXECUTOR_GRAPHCONTAINER_H
String class.
Provide factory functions for Executor core classes.
BifrostGraph Executor Owner helper class.
GraphCompilationMode
Modes for graph compilation.
Definition: Types.h:82
Uninitialized
Tag for explicitly specifying that a constructor should not initialize any data members,...
Definition: Types.h:59
SetGraphMode
The mode controlling the behavior of GraphContainer::setGraph.
Definition: Types.h:51
MessageCategory
The category of a reported message.
Definition: Types.h:33
GraphCompilationStatus
Status of graph compilation.
Definition: Types.h:90
Definition: HostData.h:33
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...
EXECUTOR_DECLARE_MAKE_OWNER_FRIENDSHIP()
Allow the makeOwner<> factory functions to access the constructors of this class.
virtual ~GraphContainer() noexcept
Destructor.
virtual void onEndSetGraph(const SetGraphInfo &graphInfo) noexcept
The notification method called by setGraph just after a new graph is set.
GraphContainer(Uninitialized uninitialized) noexcept
Constructor that leaves the GraphContainer in an uninitialized state.
virtual void onBeginSetGraph(const SetGraphInfo &graphInfo) noexcept
The notification method called by setGraph just before a new graph is set.
virtual void onBeginCompileGraph() noexcept
The notification method called by compile when the graph is about to be compiled.
GraphContainer(Private::IGraphContainerOwner &owner) noexcept
Construct a GraphContainer. The new GraphContainer is owned and managed by the Workspace.
The information that is passed to onBeginSetGraph and onEndSetGraph notification handlers.
The Job class that executes a graph with inputs/outputs coming/going from/to host.
Definition: Job.h:52
The Workspace is the central element of the BifrostGraph Executor.
Definition: Workspace.h:69
BifrostGraph Executor common types.