DQCsim
|
Wrapper class for plugin process configurations. More...
Public Member Functions | |
PluginProcessConfiguration (HandleIndex handle) noexcept | |
Wraps the given plugin process configuration handle. More... | |
PluginProcessConfiguration (const PluginProcessConfiguration &)=delete | |
void | operator= (const PluginProcessConfiguration &)=delete |
PluginProcessConfiguration (PluginProcessConfiguration &&)=default | |
Default move constructor. | |
PluginProcessConfiguration & | operator= (PluginProcessConfiguration &&)=default |
Default move assignment. | |
PluginType | get_plugin_type () const override |
Returns the plugin type. More... | |
std::string | get_name () const override |
Returns the name given to the plugin. More... | |
std::string | get_executable () const |
Returns the configured executable path for the plugin. More... | |
std::string | get_script () const |
Returns the configured script path for the plugin. More... | |
void | add_init_cmd (ArbCmd &&cmd) override |
Attaches an arbitrary initialization command to the plugin. More... | |
PluginProcessConfiguration && | with_init_cmd (ArbCmd &&cmd) |
Attaches an arbitrary initialization command to the plugin (builder pattern). More... | |
void | set_env_var (const std::string &key, const std::string &value) |
Overrides an environment variable for the plugin process. More... | |
PluginProcessConfiguration && | with_env_var (const std::string &key, const std::string &value) |
Overrides an environment variable for the plugin process (builder pattern). More... | |
void | unset_env_var (const std::string &key) |
Removes/unsets an environment variable for the plugin process. More... | |
PluginProcessConfiguration && | without_env_var (const std::string &key) |
Removes/unsets an environment variable for the plugin process (builder pattern). More... | |
void | set_work_dir (const std::string &dir) |
Overrides the working directory for the plugin process. More... | |
PluginProcessConfiguration && | with_work_dir (const std::string &dir) |
Overrides the working directory for the plugin process (builder pattern). More... | |
std::string | get_work_dir () const |
Returns the configured working directory for the given plugin process. More... | |
void | set_verbosity (Loglevel level) override |
Sets the logging verbosity level of the plugin. More... | |
PluginProcessConfiguration && | with_verbosity (Loglevel level) |
Sets the logging verbosity level of the plugin (builder pattern). More... | |
Loglevel | get_verbosity () const override |
Returns the current logging verbosity level of the plugin. More... | |
void | log_tee (Loglevel verbosity, const std::string &filename) override |
Configures a plugin thread to also output its log messages to a file. More... | |
PluginProcessConfiguration && | with_log_tee (Loglevel verbosity, const std::string &filename) |
Configures a plugin thread to also output its log messages to a file (builder pattern). More... | |
void | set_stdout_loglevel (Loglevel level) |
Configures the capture mode for the stdout stream of the specified plugin process. More... | |
PluginProcessConfiguration && | with_stdout_loglevel (Loglevel level) |
Configures the capture mode for the stdout stream of the specified plugin process (builder pattern). More... | |
Loglevel | get_stdout_loglevel () const |
Returns the configured stdout capture mode for the specified plugin process. More... | |
void | set_stderr_loglevel (Loglevel level) |
Configures the capture mode for the stderr stream of the specified plugin process. More... | |
PluginProcessConfiguration && | with_stderr_loglevel (Loglevel level) |
Configures the capture mode for the stderr stream of the specified plugin process (builder pattern). More... | |
Loglevel | get_stderr_loglevel () const |
Returns the configured stderr capture mode for the specified plugin process. More... | |
void | set_accept_timeout (double timeout) |
Configures the timeout for the plugin process to connect to DQCsim. More... | |
PluginProcessConfiguration && | with_accept_timeout (double timeout) |
Configures the timeout for the plugin process to connect to DQCsim (builder pattern). More... | |
PluginProcessConfiguration && | without_accept_timeout () |
Disables the timeout for the plugin process to connect to DQCsim (builder pattern). More... | |
double | get_accept_timeout () const |
Returns the configured timeout for the plugin process to connect to DQCsim. More... | |
void | set_shutdown_timeout (double timeout) |
Configures the timeout for the plugin process to shut down gracefully. More... | |
PluginProcessConfiguration && | with_shutdown_timeout (double timeout) |
Configures the timeout for the plugin process to shut down gracefully (builder pattern). More... | |
PluginProcessConfiguration && | without_shutdown_timeout () |
Disables the timeout for the plugin process to shut down gracefully (builder pattern). More... | |
double | get_shutdown_timeout () const |
Returns the configured timeout for the plugin process to shut down gracefully. More... | |
Public Member Functions inherited from dqcsim::wrap::PluginConfiguration | |
PluginConfiguration (HandleIndex handle) noexcept | |
Wraps the given plugin process or thread configuration handle. More... | |
PluginConfiguration (const PluginConfiguration &)=delete | |
void | operator= (const PluginConfiguration &)=delete |
PluginConfiguration (PluginConfiguration &&)=default | |
Default move constructor. | |
PluginConfiguration & | operator= (PluginConfiguration &&)=default |
Default move assignment. | |
void | add_init_cmd (const ArbCmd &cmd) |
Attaches an arbitrary initialization command to the plugin. More... | |
Public Member Functions inherited from dqcsim::wrap::Handle | |
Handle () noexcept | |
Constructs an empty wrapper. More... | |
Handle (HandleIndex handle) noexcept | |
Wraps the given raw handle. More... | |
virtual | ~Handle () noexcept |
Delete the handle and its wrapper. | |
void | free () |
Explicitly delete the handle, allowing errors to be caught. More... | |
bool | is_valid () const noexcept |
Returns whether this wrapper (still) contains a valid handle. More... | |
HandleIndex | get_handle () const noexcept |
Returns the raw handle without relinquishing ownership. More... | |
HandleIndex | take_handle () noexcept |
Returns the raw handle and relinquishes ownership. More... | |
Handle (const Handle &)=delete | |
void | operator= (const Handle &)=delete |
Handle (Handle &&src) | |
Move constructor; simply moves ownership of the handle from the source object to the constructed object. More... | |
Handle & | operator= (Handle &&src) |
Move constructor; simply moves ownership of the handle from the source object to the assignment target. More... | |
std::string | dump () const |
Returns a string containing a debug dump of the handle. More... | |
HandleType | type () const |
Returns the type of this handle. More... | |
Additional Inherited Members | |
Protected Attributes inherited from dqcsim::wrap::Handle | |
HandleIndex | handle |
The wrapped handle. | |
|
inlinenoexcept |
|
inlineoverridevirtual |
Returns the plugin type.
std::runtime_error | When the plugin definition handle is invalid. |
Implements dqcsim::wrap::PluginConfiguration.
|
inlineoverridevirtual |
Returns the name given to the plugin.
std::runtime_error | When the plugin definition handle is invalid. |
Implements dqcsim::wrap::PluginConfiguration.
|
inline |
|
inline |
|
inlineoverridevirtual |
Attaches an arbitrary initialization command to the plugin.
cmd | The initialization command to attach. |
std::runtime_error | When the plugin definition or command handle is invalid. |
Implements dqcsim::wrap::PluginConfiguration.
|
inline |
|
inline |
Overrides an environment variable for the plugin process.
The environment variable key
is set to value
regardless of whether it exists in the parent environment variable scope.
key | The environment variable to set. |
value | The value to set it to. |
std::runtime_error | When the plugin definition or command handle is invalid. |
|
inline |
Overrides an environment variable for the plugin process (builder pattern).
The environment variable key
is set to value
regardless of whether it exists in the parent environment variable scope.
key | The environment variable to set. |
value | The value to set it to. |
&self
, to continue building. std::runtime_error | When the plugin definition or command handle is invalid. |
|
inline |
Removes/unsets an environment variable for the plugin process.
The environment variable key is unset regardless of whether it exists in the parent environment variable scope.
key | The environment variable to unset. |
std::runtime_error | When the plugin definition or command handle is invalid. |
|
inline |
Removes/unsets an environment variable for the plugin process (builder pattern).
The environment variable key is unset regardless of whether it exists in the parent environment variable scope.
key | The environment variable to unset. |
&self
, to continue building. std::runtime_error | When the plugin definition or command handle is invalid. |
|
inline |
|
inline |
|
inline |
|
inlineoverridevirtual |
Sets the logging verbosity level of the plugin.
level | The desired logging verbosity for the plugin instance. |
std::runtime_error | When the plugin definition handle is invalid. |
Implements dqcsim::wrap::PluginConfiguration.
|
inline |
|
inlineoverridevirtual |
Returns the current logging verbosity level of the plugin.
std::runtime_error | When the plugin definition handle is invalid. |
Implements dqcsim::wrap::PluginConfiguration.
|
inlineoverridevirtual |
Configures a plugin thread to also output its log messages to a file.
verbosity | Configures the verbosity level for the tee'd output file only. |
filename | The path to the file to tee log messages to. |
std::runtime_error | When the plugin definition handle is invalid. |
Implements dqcsim::wrap::PluginConfiguration.
|
inline |
Configures a plugin thread to also output its log messages to a file (builder pattern).
verbosity | Configures the verbosity level for the tee'd output file only. |
filename | The path to the file to tee log messages to. |
&self
, to continue building. std::runtime_error | When the plugin definition handle is invalid. |
|
inline |
Configures the capture mode for the stdout stream of the specified plugin process.
level | The loglevel with which stdout is captured. Loglevel::Pass instructs the logging thread to not capture stdout at all. |
std::runtime_error | When the plugin definition handle is invalid. |
|
inline |
Configures the capture mode for the stdout stream of the specified plugin process (builder pattern).
level | The loglevel with which stdout is captured. Loglevel::Pass instructs the logging thread to not capture stdout at all. |
&self
, to continue building. std::runtime_error | When the plugin definition handle is invalid. |
|
inline |
|
inline |
Configures the capture mode for the stderr stream of the specified plugin process.
level | The loglevel with which stderr is captured. Loglevel::Pass instructs the logging thread to not capture stderr at all. |
std::runtime_error | When the plugin definition handle is invalid. |
|
inline |
Configures the capture mode for the stderr stream of the specified plugin process (builder pattern).
level | The loglevel with which stderr is captured. Loglevel::Pass instructs the logging thread to not capture stderr at all. |
&self
, to continue building. std::runtime_error | When the plugin definition handle is invalid. |
|
inline |
|
inline |
Configures the timeout for the plugin process to connect to DQCsim.
The default is 5 seconds, so you should normally be able to leave this alone.
timeout | The timeout in seconds. You can use IEEE positive infinity from <limits> to specify an infinite timeout. |
std::runtime_error | When the plugin definition handle is invalid. |
|
inline |
Configures the timeout for the plugin process to connect to DQCsim (builder pattern).
The default is 5 seconds, so you should normally be able to leave this alone.
timeout | The timeout in seconds. You can use IEEE positive infinity from <limits> to specify an infinite timeout. |
&self
, to continue building. std::runtime_error | When the plugin definition handle is invalid. |
|
inline |
|
inline |
|
inline |
Configures the timeout for the plugin process to shut down gracefully.
The default is 5 seconds, so you should normally be able to leave this alone.
timeout | The timeout in seconds. You can use IEEE positive infinity from <limits> to specify an infinite timeout. |
std::runtime_error | When the plugin definition handle is invalid. |
|
inline |
Configures the timeout for the plugin process to shut down gracefully (builder pattern).
The default is 5 seconds, so you should normally be able to leave this alone.
timeout | The timeout in seconds. You can use IEEE positive infinity from <limits> to specify an infinite timeout. |
&self
, to continue building. std::runtime_error | When the plugin definition handle is invalid. |
|
inline |
|
inline |