MaliputPlugin Class Reference

Detailed Description

MaliputPlugin loads a dynamic library.

After construction, the id and type of the plugin are provided. Via MaliputPlugin::ExecuteSymbol() functions can be run from the library. It is thought to be the entry point of the plugin. Specific plugin implementations would specialize the template invocation with the necessary types so the functionality for the plugin can be achieved.

To be considered a maliput plugin, the following two functions must be defined:

extern "C" char* GetMaliputPluginId();
extern "C" MaliputPluginType GetMaliputPluginType();
When shared library and executable are compiled using ubsan(undefined behavior sanitizer) the property ENABLE_EXPORTS should be enabled on the executable target in order to instruct the linker to add all symbols to the dynamic symbol table. For further information see next link.

#include <include/maliput/plugin/maliput_plugin.h>

Public Types

using Id = api::TypeSpecificIdentifier< class MaliputPlugin >
 Persistent identifier for a MaliputPlugin element. More...

Public Member Functions

 MaliputPlugin (const std::string &path_to_lib)
 Constructs a MaliputPlugin. More...
 MaliputPlugin ()=delete
std::string GetId () const
MaliputPluginType GetType () const
template<typename ReturnType , typename... Args>
ReturnType ExecuteSymbol (const std::string &sym_name, Args &&... args) const
 Finds and executes a symbol loaded by the plugin library. More...

Member Typedef Documentation

◆ Id

Persistent identifier for a MaliputPlugin element.

Constructor & Destructor Documentation

◆ MaliputPlugin() [1/2]

MaliputPlugin ( const std::string &  path_to_lib)

Constructs a MaliputPlugin.

path_to_libPath to the library.
maliput::common::assertion_errorWhen path_to_lib is empty.

◆ MaliputPlugin() [2/2]

MaliputPlugin ( )

Member Function Documentation

◆ ExecuteSymbol()

ReturnType ExecuteSymbol ( const std::string &  sym_name,
Args &&...  args 
) const

Finds and executes a symbol loaded by the plugin library.

Template Parameters
ReturnTypeThe return type of the symbol that is executed.
ArgsTypes of the argument list.
sym_nameName of the symbol to execute.
argsArgument list for the symbol call.
An object returned by the executed symbol.
maliput::common::assertion_errorWhen sym_name is not found.

◆ GetId()

std::string GetId ( ) const
The Id of the plugin.

◆ GetType()

MaliputPluginType GetType ( ) const
The MaliputPluginType of the plugin.



The documentation for this class was generated from the following files:
Types of maliput plugin.
Definition: maliput_plugin_type.h:39