The GraphContainer class that loads a graph to be executed and manages the Jobs that execute this graph.
More...
#include <GraphContainer.h>
|
| struct | SetGraphInfo |
| | The information that is passed to onBeginSetGraph and onEndSetGraph notification handlers. More...
|
| |
The GraphContainer class that loads a graph to be executed and manages the Jobs that execute this graph.
Definition at line 54 of file GraphContainer.h.
◆ GraphContainer() [1/2]
| BifrostGraph::Executor::GraphContainer::GraphContainer |
( |
Private::IGraphContainerOwner & |
owner | ) |
|
|
explicitprotectednoexcept |
◆ GraphContainer() [2/2]
| BifrostGraph::Executor::GraphContainer::GraphContainer |
( |
Uninitialized |
uninitialized | ) |
|
|
explicitprotectednoexcept |
◆ ~GraphContainer()
| virtual BifrostGraph::Executor::GraphContainer::~GraphContainer |
( |
| ) |
|
|
virtualnoexcept |
◆ compile()
Compile the graph for job execution.
The onBeginCompileGraph and onEndCompileGraph notification handlers will be called respectively just before and after compiling the graph of this GraphContainer, allowing a class derived from GraphContainer to do any additional work it may need to do when the graph is compiled.
- Parameters
-
| [in] | mode | The mode on how to compile the graph (i.e. full compile or update), (see GraphCompilationMode). |
- Returns
- The graph compilation status (see GraphCompilationStatus).
- Note
- When the graph is compiled, whatever is the specified
mode, the inputs and outputs of the associated Job are updated. This implies that the Job input values must be set again (see Job::getInputs and Job::setInputValue) and the Job must be executed again (see Job::execute) in order to retrieve the Job output values (see Job::getOutputs and Job::getOutputValue).
◆ EXECUTOR_DECLARE_MAKE_OWNER_FRIENDSHIP()
| BifrostGraph::Executor::GraphContainer::EXECUTOR_DECLARE_MAKE_OWNER_FRIENDSHIP |
( |
| ) |
|
|
protected |
Allow the makeOwner<> factory functions to access the constructors of this class.
◆ getGraphName()
| Amino::String BifrostGraph::Executor::GraphContainer::getGraphName |
( |
| ) |
const |
|
noexcept |
Get the name of the graph currently set in this GraphContainer.
- Returns
- The name of the currently set graph, if any, an empty string otherwise.
◆ getGraphQualifiedName()
| Amino::String BifrostGraph::Executor::GraphContainer::getGraphQualifiedName |
( |
| ) |
const |
|
noexcept |
Get the fully qualified name of the graph currently set in this GraphContainer.
- Returns
- The fully qualified name of the currently set graph, if any, an empty string otherwise.
◆ getInvalid()
| static GraphContainer & BifrostGraph::Executor::GraphContainer::getInvalid |
( |
| ) |
|
|
staticnoexcept |
◆ getJob() [1/2]
| const Job & BifrostGraph::Executor::GraphContainer::getJob |
( |
| ) |
const |
|
noexcept |
◆ getJob() [2/2]
| Job & BifrostGraph::Executor::GraphContainer::getJob |
( |
| ) |
|
|
noexcept |
◆ getRestrictedServices() [1/2]
| const Private::IRestrictedGraphContainerServices & BifrostGraph::Executor::GraphContainer::getRestrictedServices |
( |
| ) |
const |
|
noexcept |
◆ getRestrictedServices() [2/2]
| Private::IRestrictedGraphContainerServices & BifrostGraph::Executor::GraphContainer::getRestrictedServices |
( |
| ) |
|
|
noexcept |
◆ getWorkspace() [1/2]
| const Workspace & BifrostGraph::Executor::GraphContainer::getWorkspace |
( |
| ) |
const |
|
noexcept |
◆ getWorkspace() [2/2]
| Workspace & BifrostGraph::Executor::GraphContainer::getWorkspace |
( |
| ) |
|
|
noexcept |
◆ isValid()
| virtual bool BifrostGraph::Executor::GraphContainer::isValid |
( |
| ) |
const |
|
virtualnoexcept |
Check if this GraphContainer has been successfully initialized.
If an error occurs during the construction of a GraphContainer, isValid() will return false and all future operations on the GraphContainer will fail.
- Returns
- true if this GraphContainer has been successfully initialized and is ready to be used; false otherwise.
◆ onBeginCompileGraph()
| virtual void BifrostGraph::Executor::GraphContainer::onBeginCompileGraph |
( |
| ) |
|
|
privatevirtualnoexcept |
The notification method called by compile when the graph is about to be compiled.
- Note
- The default implementation does nothing.
◆ onBeginSetGraph()
| virtual void BifrostGraph::Executor::GraphContainer::onBeginSetGraph |
( |
const SetGraphInfo & |
graphInfo | ) |
|
|
privatevirtualnoexcept |
The notification method called by setGraph just before a new graph is set.
When this method is called, the previously set graph, if any, is still set in this GraphContainer. If the setGraph's mode parameter was SetGraphMode::kCopy and the attempt to copy the existing graph fails, then this notification method will not be called.
- Parameters
-
| [in] | graphInfo | The information about the graph that is about to be set. |
- Note
- The default implementation does nothing.
◆ onEndCompileGraph()
The notification method called by compile once the graph has been compiled.
- Parameters
-
| [in] | status | The status of the compile operation. |
- Note
- The default implementation does nothing.
◆ onEndSetGraph()
| virtual void BifrostGraph::Executor::GraphContainer::onEndSetGraph |
( |
const SetGraphInfo & |
graphInfo | ) |
|
|
privatevirtualnoexcept |
The notification method called by setGraph just after a new graph is set.
If the setGraph's mode parameter was SetGraphMode::kCopy and the attempt to copy the existing graph fails, then this notification method will not be called.
- Parameters
-
| [in] | graphInfo | The information about the graph that has just been set. |
- Note
- The default implementation does nothing.
◆ reportMessage()
◆ setGraph()
Set the graph in this GraphContainer.
The definition of the graph designated by name must have been previously loaded in the Library (see Workspace::loadConfigFiles or Library::loadDefinitionFile).
If mode is SetGraphMode::kCopy, the copy of the graph will have a new unique fully qualified name to avoid name collisions (see GraphContainer::SetGraphInfo).
If the graph does not exist in the Library, or if the mode is SetGraphMode::kCopy and the attempt to copy the existing graph fails, then this method aborts and does not set the graph. Otherwise, the onBeginSetGraph and onEndSetGraph notification handlers will be called respectively just before and after setting the graph in this GraphContainer, allowing a class derived from GraphContainer to do any additional work it may need to do when the graph is set or replaced by another one.
- Parameters
-
| [in] | name | The fully qualified name of the graph to be set. |
| [in] | mode | The mode controlling the behavior of setGraph. |
- Returns
- true if the graph exists and has been successfully copied (if required) and set in this GraphContainer; false otherwise.
◆ Private::GraphContainerImpl
| friend class Private::GraphContainerImpl |
|
friend |