DQCsim
Public Member Functions | List of all members
dqcsim::wrap::PluginConfiguration Class Referenceabstract

Generic class for plugin configurations. More...

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

Public Member Functions

 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.
 
virtual PluginType get_plugin_type () const =0
 Returns the plugin type. More...
 
virtual std::string get_name () const =0
 Returns the name given to the plugin. More...
 
virtual void add_init_cmd (ArbCmd &&cmd)=0
 Attaches an arbitrary initialization command to the plugin. More...
 
void add_init_cmd (const ArbCmd &cmd)
 Attaches an arbitrary initialization command to the plugin. More...
 
virtual void set_verbosity (Loglevel level)=0
 Sets the logging verbosity level of the plugin. More...
 
virtual Loglevel get_verbosity () const =0
 Returns the current logging verbosity level of the plugin. More...
 
virtual void log_tee (Loglevel verbosity, const std::string &filename)=0
 Configures a plugin thread to also output its log messages to a file. 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

Generic class for plugin configurations.

Definition at line 8542 of file dqcsim.

Constructor & Destructor Documentation

◆ PluginConfiguration()

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

Wraps the given plugin process or thread configuration handle.

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

Definition at line 8553 of file dqcsim.

Member Function Documentation

◆ get_plugin_type()

virtual PluginType dqcsim::wrap::PluginConfiguration::get_plugin_type ( ) const
pure virtual

Returns the plugin type.

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

Implemented in dqcsim::wrap::PluginThreadConfiguration, and dqcsim::wrap::PluginProcessConfiguration.

◆ get_name()

virtual std::string dqcsim::wrap::PluginConfiguration::get_name ( ) const
pure virtual

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.

Implemented in dqcsim::wrap::PluginThreadConfiguration, and dqcsim::wrap::PluginProcessConfiguration.

◆ add_init_cmd() [1/2]

virtual void dqcsim::wrap::PluginConfiguration::add_init_cmd ( ArbCmd &&  cmd)
pure virtual

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.

Implemented in dqcsim::wrap::PluginThreadConfiguration, and dqcsim::wrap::PluginProcessConfiguration.

◆ add_init_cmd() [2/2]

void dqcsim::wrap::PluginConfiguration::add_init_cmd ( const ArbCmd cmd)
inline

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.

Definition at line 8605 of file dqcsim.

◆ set_verbosity()

virtual void dqcsim::wrap::PluginConfiguration::set_verbosity ( Loglevel  level)
pure virtual

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.

Implemented in dqcsim::wrap::PluginThreadConfiguration, and dqcsim::wrap::PluginProcessConfiguration.

◆ get_verbosity()

virtual Loglevel dqcsim::wrap::PluginConfiguration::get_verbosity ( ) const
pure virtual

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.

Implemented in dqcsim::wrap::PluginThreadConfiguration, and dqcsim::wrap::PluginProcessConfiguration.

◆ log_tee()

virtual void dqcsim::wrap::PluginConfiguration::log_tee ( Loglevel  verbosity,
const std::string &  filename 
)
pure virtual

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.

Implemented in dqcsim::wrap::PluginThreadConfiguration, and dqcsim::wrap::PluginProcessConfiguration.


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