Class ILLIXR::plugin
A dynamically-loadable plugin for Spindle.
#include <plugin.hpp>
Inherited by the following classes: ILLIXR::threadloop
Public Functions
Type | Name |
---|---|
std::string | get_name () noexcept const |
plugin (std::string name_, phonebook * pb_) |
|
void | spdlogger (const char * log_level) |
virtual void | start () A method which Spindle calls when it starts the component. |
virtual void | stop () A method which Spindle calls when it stops the component. |
virtual | ~plugin () = default |
Protected Attributes
Type | Name |
---|---|
const std::shared_ptr< gen_guid > | gen_guid_ |
const std::size_t | id |
std::string | name |
const phonebook * | pb |
const std::shared_ptr< record_logger > | record_logger_ |
Public Functions Documentation
function get_name
inline std::string ILLIXR::plugin::get_name () noexcept const
function plugin
inline ILLIXR::plugin::plugin (
std::string name_,
phonebook * pb_
)
function spdlogger
inline void ILLIXR::plugin::spdlogger (
const char * log_level
)
function start
A method which Spindle calls when it starts the component.
inline virtual void ILLIXR::plugin::start ()
This is necessary because a constructor can't call derived virtual methods (due to structure of C++). See threadloop
for an example of this use-case.
function stop
A method which Spindle calls when it stops the component.
inline virtual void ILLIXR::plugin::stop ()
This is necessary because the parent class might define some actions that need to be taken prior to destructing the derived class. For example, threadloop must halt and join the thread before the derived class can be safely destructed. However, the derived class's destructor is called before its parent (threadloop), so threadloop doesn't get a chance to join the thread before the derived class is destroyed, and the thread accesses freed memory. Instead, we call plugin->stop manually before destrying anything.
Concrete plugins are responsible for initializing their specific logger and sinks.
function ~plugin
virtual ILLIXR::plugin::~plugin () = default
Protected Attributes Documentation
variable gen_guid_
const std::shared_ptr<gen_guid> ILLIXR::plugin::gen_guid_;
variable id
const std::size_t ILLIXR::plugin::id;
variable name
std::string ILLIXR::plugin::name;
variable pb
const phonebook* ILLIXR::plugin::pb;
variable record_logger_
const std::shared_ptr<record_logger> ILLIXR::plugin::record_logger_;
The documentation for this class was generated from the following file include/illixr/plugin.hpp