ILLIXR: Illinois Extended Reality Testbed
|
A dynamically-loadable plugin for Spindle. More...
#include <plugin.hpp>
Public Member Functions | |
virtual void | start () |
A method which Spindle calls when it starts the component. More... | |
virtual void | stop () |
A method which Spindle calls when it stops the component. More... | |
plugin (std::string name_, phonebook *pb_) | |
std::string | get_name () const noexcept |
void | spdlogger (const char *log_level) |
Protected Attributes | |
std::string | name |
const phonebook * | pb |
const std::shared_ptr< record_logger > | record_logger_ |
const std::shared_ptr< gen_guid > | gen_guid_ |
const std::size_t | id |
A dynamically-loadable plugin for Spindle.
|
inlinevirtual |
A method which Spindle calls when it starts the component.
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.
Reimplemented in ILLIXR::threadloop.
|
inlinevirtual |
A method which Spindle calls when it stops the component.
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.
Reimplemented in ILLIXR::threadloop.