Builder class used to construct plugin configurations.
More...
Builder class used to construct plugin configurations.
Definition at line 9241 of file dqcsim.
◆ PluginConfigurationBuilder()
dqcsim::wrap::PluginConfigurationBuilder::PluginConfigurationBuilder |
( |
PluginType |
type | ) |
|
|
inlinenoexcept |
◆ with_name()
Builder function for naming the plugin instance.
The name must be unique within the simulation. It is used, among other things, by the logging system.
If this is not called or is called with an empty string, auto-naming will be performed: "front" for the frontend, "oper[i]" for the operators (indices starting at 1 from frontend to backend), and "back" for the backend.
- Parameters
-
name | The name for the plugin. |
- Returns
&self
, to continue building.
Definition at line 9272 of file dqcsim.
◆ with_spec()
Builds a plugin process configuration object from a "sugared" plugin specification string, using the same syntax that the dqcsim
command line interface uses.
- Parameters
-
spec | The command-line interface specification string for the desired plugin. |
- Returns
- A
PluginProcessConfiguration
object to continue building.
- Exceptions
-
std::runtime_error | When the specified plugin could not be found, or construction of the configuration handle fails for some reason. |
Definition at line 9288 of file dqcsim.
◆ with_executable()
PluginProcessConfiguration dqcsim::wrap::PluginConfigurationBuilder::with_executable |
( |
const std::string & |
executable, |
|
|
const std::string & |
script = "" |
|
) |
| |
|
inline |
Builds a plugin process configuration object from a path to a plugin executable and an optional path to a script for it to run.
Note that not all plugins will use the optional script
parameter.
- Parameters
-
executable | The path to the plugin executable to load. |
script | The optional first command-line argument passed to the plugin executable. |
- Returns
- A
PluginProcessConfiguration
object to continue building.
- Exceptions
-
std::runtime_error | When the specified plugin could not be found, or construction of the configuration handle fails for some reason. |
Definition at line 9307 of file dqcsim.
◆ with_callbacks()
Builds a plugin thread configuration object from a plugin definition object, containing a bunch of callback functions.
- Parameters
-
plugin | The plugin definition object to wrap. Note that this must be std::move() d in if it is not constructed in-place. |
- Returns
- A
PluginThreadConfiguration
object to continue building.
- Exceptions
-
std::runtime_error | When the specified plugin could not be found, or construction of the configuration handle fails for some reason. |
Definition at line 9323 of file dqcsim.
◆ with_spawner() [1/3]
Builds a plugin thread configuration object using a single callback that spawns the entire plugin.
This version takes a pre-existing callback object by copy. The callback is called by DQCsim from a dedicated thread when DQCsim wants to start the plugin. The callback must then in some way spawn a plugin process that connects to the provided simulator string. The callback should return only when the process terminates.
- Parameters
-
data | The wrapper object for the plugin spawning callback. |
- Returns
- A
PluginThreadConfiguration
object to continue building.
- Exceptions
-
std::runtime_error | When construction of the configuration handle fails for some reason. |
Definition at line 9376 of file dqcsim.
◆ with_spawner() [2/3]
Builds a plugin thread configuration object using a single callback that spawns the entire plugin.
This version takes a pre-existing callback object by move. The callback is called by DQCsim from a dedicated thread when DQCsim wants to start the plugin. The callback must then in some way spawn a plugin process that connects to the provided simulator string. The callback should return only when the process terminates.
- Parameters
-
data | The wrapper object for the plugin spawning callback. |
- Returns
- A
PluginThreadConfiguration
object to continue building.
- Exceptions
-
std::runtime_error | When construction of the configuration handle fails for some reason. |
Definition at line 9395 of file dqcsim.
◆ with_spawner() [3/3]
template<typename... Args>
Builds a plugin thread configuration object using a single callback that spawns the entire plugin.
This version allows the callback object to be (copy-)constructed in-place. The callback is called by DQCsim from a dedicated thread when DQCsim wants to start the plugin. The callback must then in some way spawn a plugin process that connects to the provided simulator string. The callback should return only when the process terminates.
- Parameters
-
- Returns
- A
PluginThreadConfiguration
object to continue building.
- Exceptions
-
std::runtime_error | When construction of the configuration handle fails for some reason. |
Definition at line 9416 of file dqcsim.
The documentation for this class was generated from the following file: