Skip to content

Class ILLIXR::plugin

ClassList > ILLIXR > plugin

A dynamically-loadable plugin for Spindle.

  • #include <plugin.hpp>

Inherited by the following classes: ILLIXR::depthai, ILLIXR::fauxpose, ILLIXR::ground_truth_slam, ILLIXR::gtsam_integrator, ILLIXR::offload_data, ILLIXR::offload_rendering_server_loader, ILLIXR::passthrough_integrator, ILLIXR::realsense, ILLIXR::record_imu_cam, ILLIXR::record_rgb_depth, ILLIXR::rk4_integrator, ILLIXR::server_writer, ILLIXR::tcp_network_backend, ILLIXR::threadloop, ILLIXR::viewer, ILLIXR::vkdemo_plugin, offload_rendering_client_loader, pose_lookup_plugin, pose_prediction_plugin

Public Functions

Type Name
std::string get_name () noexcept const
plugin (std::string name, phonebook * pb)
void spd_add_file_sink (const std::string & file_name, const std::string & extension, const std::string & log_level)
auto 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 * phonebook_
std::shared_ptr< spdlog::logger > plugin_logger_
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 spd_add_file_sink

inline void ILLIXR::plugin::spd_add_file_sink (
    const std::string & file_name,
    const std::string & extension,
    const std::string & log_level
) 

function spdlogger

inline auto 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 destroying 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 phonebook_

const phonebook* ILLIXR::plugin::phonebook_;

variable plugin_logger_

std::shared_ptr<spdlog::logger> ILLIXR::plugin::plugin_logger_;

variable record_logger_

const std::shared_ptr<record_logger> ILLIXR::plugin::record_logger_;


The documentation for this class was generated from the following file /home/friedel/devel/ILLIXR/include/illixr/plugin.hpp