ILLIXR: Illinois Extended Reality Testbed
Public Member Functions | Protected Attributes | List of all members
ILLIXR::plugin Class Reference

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 phonebookpb
 
const std::shared_ptr< record_loggerrecord_logger_
 
const std::shared_ptr< gen_guidgen_guid_
 
const std::size_t id
 

Detailed Description

A dynamically-loadable plugin for Spindle.

Member Function Documentation

◆ start()

virtual void ILLIXR::plugin::start ( )
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.

◆ stop()

virtual void ILLIXR::plugin::stop ( )
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.


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