Share

Managing the GraphContainers

The Workspace object manages a list of GraphContainers. To execute a graph that has been loaded into the Workspace resources, you must first add a GraphContainer to the Workspace, select this graph in the GraphContainer, compile the graph, and then use the GraphContainer's Job to execute the graph.

To add a new GraphContainer, you can use the Workspace's addGraphContainerT<>() template method. This template method is flexible and allows you to create instances of your own subclass of the GraphContainer base class. You simply need to pass in a Functor argument that will be used by the template to create your own GraphContainer instance, then addGraphContainerT<>() will validate this instance and add it into the Workspace's storage. The Owner<T> object that is returned by your Functor will be responsible to delete your newly created GraphContainer (either when the Workspace's deleteGraphContainer() method will be called, or when the Workspace will be deleted).

If you do not need to create your own GraphContainer subclass, you can create an instance of the GraphContainer base-class itself by calling the Workspace's addGraphContainer() alias method.

You can have multiple GraphContainers in the same Workspace. All of these GraphContainers will share the same Workspace's Bifrost resources, have access to all available graphs, and execute any of them. Please note though that even if you select the same graph in multiple GraphContainers, you still need to compile the graph in each GraphContainer in order to execute it through the GraphContainer's Job (see Accessing the Job instance).

Was this information helpful?