Pothos  0.7.0-gf7fbae99
The Pothos dataflow programming software suite
Public Member Functions | Static Public Member Functions | List of all members
Pothos::PluginModule Class Reference

#include <Module.hpp>

Public Member Functions

 PluginModule (void)
 
 PluginModule (const std::string &path)
 
 ~PluginModule (void)
 Plugin module destructor. More...
 
std::string getFilePath (void) const
 
const std::vector< std::string > & getPluginPaths (void) const
 
 operator bool (void) const
 
std::string getVersion (void) const
 

Static Public Member Functions

static const PluginModulenull (void)
 A reference to a permanent empty module. More...
 
static PluginModule safeLoad (const std::string &path)
 

Detailed Description

PluginModule represents a loaded shared library in the filesystem.

Constructor & Destructor Documentation

◆ PluginModule() [1/2]

Pothos::PluginModule::PluginModule ( void  )

Create a null PluginModule.

◆ PluginModule() [2/2]

Pothos::PluginModule::PluginModule ( const std::string &  path)

Create a PluginModule from a file path.

Exceptions
PluginPluginModuleErrorif the path does not exist
PluginPluginModuleErrorif the load fails
Parameters
paththe path to a loadable module on the file system

◆ ~PluginModule()

Pothos::PluginModule::~PluginModule ( void  )

Plugin module destructor.

Member Function Documentation

◆ getFilePath()

std::string Pothos::PluginModule::getFilePath ( void  ) const

Get a file path for this module.

Returns
the file path for the shared library

◆ getPluginPaths()

const std::vector<std::string>& Pothos::PluginModule::getPluginPaths ( void  ) const

Get the paths that this module loaded into the plugin registry. Each path is a string that represents a path in the registry.

◆ getVersion()

std::string Pothos::PluginModule::getVersion ( void  ) const

Get a version string for the specified module. Modules may optionally provide version strings.

Returns
a version string or empty if no version provided

◆ null()

static const PluginModule& Pothos::PluginModule::null ( void  )
static

A reference to a permanent empty module.

◆ operator bool()

Pothos::PluginModule::operator bool ( void  ) const
explicit

Does the module hold a loaded library?

Returns
true if the module is non-empty

◆ safeLoad()

static PluginModule Pothos::PluginModule::safeLoad ( const std::string &  path)
static

Test load this libray module within a separate process to avoid loading something destructive within this process. If the test load succeeds, the module will be loaded locally.

Exceptions
PluginPluginModuleErrorif the load fails
Parameters
paththe path to a loadable module on the file system
Returns
the PluginModule loaded at the given file path

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