Class ExecutableBase

Inheritance Relationships

Base Types

  • public mrpt::system::COutputLogger

  • public mrpt::rtti::CObject

  • private std::enable_shared_from_this< ExecutableBase >

Derived Types

Class Documentation

class ExecutableBase : public mrpt::system::COutputLogger, public mrpt::rtti::CObject, private std::enable_shared_from_this<ExecutableBase>

Base virtual class for all executable (nodelet-like) units inside a SLAM system.

Subclassed by mola::BackEndBase, mola::FrontEndBase, mola::MolaViz, mola::RawDataSourceBase, mola::WorldModel

Directory services

{

std::function<Ptr(const std::string&)> nameServer_

A name server function to search for other ExecutableBase objects in my running system. Empty during ctor, should be usable from initialize_common() and initialize().

See also

findService()

Note

In a standard system, this is implemented by MolaLauncherApp::nameServerImpl()

template<class Interface>
std::vector<Ptr> findService() const

Finds (an)other ExecutableBase(s) by its expected Interface, that is, a virtual base class.

See also

nameServer_

void setModuleInstanceName(const std::string &s)
std::string getModuleInstanceName() const

Virtual interface of any ExecutableBase

{

virtual void initialize(const Yaml &cfg) = 0

This must be implemented to read all the required parameters

virtual void spinOnce() = 0

Runs any required action on a timely manner

inline virtual int launchOrderPriority() const

Modules will be initialized in the order determined by:

  • First: the “order priority”, which is the number returned here.

  • Second: modules with the same “priority”, will be sorted by ascending lexicographical order or their “instance names”.

inline virtual void onQuit()

Called while destroying the SLAM system. A perfect placeholder for saving data to filesystem, clean up, etc. before any module destructor has been actually beeing invoked.

Public Functions

ExecutableBase()
virtual ~ExecutableBase()
inline Ptr getAsPtr()

Get as shared_ptr via enable_shared_from_this<>

inline bool requestedShutdown() const

Public Members

std::optional<ProfilerSaverAtDtor> profiler_dtor_save_stats_

Enabled from mola-cli with --profiler-whole to save full profile stats to .m files at program end.

Profiler profiler_ = {false}

Time profiler (disabled by default). All profilers can be globally enabled from MolaLauncherApp.

Public Static Functions

static Ptr Factory(const std::string &classname)

Class factory. Register using MOLA_REGISTER_MODULE()

Protected Functions

inline void requestShutdown()