DQCsim
Public Member Functions | List of all members
dqcsim::wrap::PluginThreadConfiguration Class Reference

Wrapper class for local plugin thread configurations. More...

Inheritance diagram for dqcsim::wrap::PluginThreadConfiguration:
dqcsim::wrap::PluginConfiguration dqcsim::wrap::Handle

Public Member Functions

 PluginThreadConfiguration (HandleIndex handle) noexcept
 Wraps the given plugin thread configuration handle. More...
 
 PluginThreadConfiguration (const PluginThreadConfiguration &)=delete
 
void operator= (const PluginThreadConfiguration &)=delete
 
 PluginThreadConfiguration (PluginThreadConfiguration &&)=default
 Default move constructor.
 
PluginThreadConfigurationoperator= (PluginThreadConfiguration &&)=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...
 
void add_init_cmd (ArbCmd &&cmd) override
 Attaches an arbitrary initialization command to the plugin. More...
 
PluginThreadConfiguration && with_init_cmd (ArbCmd &&cmd)
 Attaches an arbitrary initialization command to the plugin (builder pattern). More...
 
void set_verbosity (Loglevel level) override
 Sets the logging verbosity level of the plugin. More...
 
PluginThreadConfiguration && 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...
 
PluginThreadConfiguration && 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...
 
- 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.
 
PluginConfigurationoperator= (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...
 
Handleoperator= (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.
 

Detailed Description

Wrapper class for local plugin thread configurations.

Definition at line 9098 of file dqcsim.

Constructor & Destructor Documentation

◆ PluginThreadConfiguration()

dqcsim::wrap::PluginThreadConfiguration::PluginThreadConfiguration ( HandleIndex  handle)
inlinenoexcept

Wraps the given plugin thread configuration handle.

Note
This constructor does not verify that the handle is actually valid.
Parameters
handleThe raw handle to wrap.

Definition at line 9109 of file dqcsim.

Member Function Documentation

◆ get_plugin_type()

PluginType dqcsim::wrap::PluginThreadConfiguration::get_plugin_type ( ) const
inlineoverridevirtual

Returns the plugin type.

Returns
The plugin type.
Exceptions
std::runtime_errorWhen the plugin definition handle is invalid.

Implements dqcsim::wrap::PluginConfiguration.

Definition at line 9132 of file dqcsim.

◆ get_name()

std::string dqcsim::wrap::PluginThreadConfiguration::get_name ( ) const
inlineoverridevirtual

Returns the name given to the plugin.

Note
This returns the instance name, not the class name. The latter can only be queried once the plugin thread or process has been started.
Returns
the name given to the plugin instance.
Exceptions
std::runtime_errorWhen the plugin definition handle is invalid.

Implements dqcsim::wrap::PluginConfiguration.

Definition at line 9145 of file dqcsim.

◆ add_init_cmd()

void dqcsim::wrap::PluginThreadConfiguration::add_init_cmd ( ArbCmd &&  cmd)
inlineoverridevirtual

Attaches an arbitrary initialization command to the plugin.

Parameters
cmdThe initialization command to attach.
Exceptions
std::runtime_errorWhen the plugin definition or command handle is invalid.

Implements dqcsim::wrap::PluginConfiguration.

Definition at line 9159 of file dqcsim.

◆ with_init_cmd()

PluginThreadConfiguration&& dqcsim::wrap::PluginThreadConfiguration::with_init_cmd ( ArbCmd &&  cmd)
inline

Attaches an arbitrary initialization command to the plugin (builder pattern).

Parameters
cmdThe initialization command to attach.
Returns
&self, to continue building.
Exceptions
std::runtime_errorWhen the plugin definition or command handle is invalid.

Definition at line 9172 of file dqcsim.

◆ set_verbosity()

void dqcsim::wrap::PluginThreadConfiguration::set_verbosity ( Loglevel  level)
inlineoverridevirtual

Sets the logging verbosity level of the plugin.

Parameters
levelThe desired logging verbosity for the plugin instance.
Exceptions
std::runtime_errorWhen the plugin definition handle is invalid.

Implements dqcsim::wrap::PluginConfiguration.

Definition at line 9183 of file dqcsim.

◆ with_verbosity()

PluginThreadConfiguration&& dqcsim::wrap::PluginThreadConfiguration::with_verbosity ( Loglevel  level)
inline

Sets the logging verbosity level of the plugin (builder pattern).

Parameters
levelThe desired logging verbosity for the plugin instance.
Returns
&self, to continue building.
Exceptions
std::runtime_errorWhen the plugin definition handle is invalid.

Definition at line 9194 of file dqcsim.

◆ get_verbosity()

Loglevel dqcsim::wrap::PluginThreadConfiguration::get_verbosity ( ) const
inlineoverridevirtual

Returns the current logging verbosity level of the plugin.

Returns
The current logging verbosity level of the plugin.
Exceptions
std::runtime_errorWhen the plugin definition handle is invalid.

Implements dqcsim::wrap::PluginConfiguration.

Definition at line 9205 of file dqcsim.

◆ log_tee()

void dqcsim::wrap::PluginThreadConfiguration::log_tee ( Loglevel  verbosity,
const std::string &  filename 
)
inlineoverridevirtual

Configures a plugin thread to also output its log messages to a file.

Parameters
verbosityConfigures the verbosity level for the tee'd output file only.
filenameThe path to the file to tee log messages to.
Exceptions
std::runtime_errorWhen the plugin definition handle is invalid.

Implements dqcsim::wrap::PluginConfiguration.

Definition at line 9217 of file dqcsim.

◆ with_log_tee()

PluginThreadConfiguration&& dqcsim::wrap::PluginThreadConfiguration::with_log_tee ( Loglevel  verbosity,
const std::string &  filename 
)
inline

Configures a plugin thread to also output its log messages to a file (builder pattern).

Parameters
verbosityConfigures the verbosity level for the tee'd output file only.
filenameThe path to the file to tee log messages to.
Returns
&self, to continue building.
Exceptions
std::runtime_errorWhen the plugin definition handle is invalid.

Definition at line 9231 of file dqcsim.


The documentation for this class was generated from the following file: