Ocean
Ocean::PluginManager::Plugin Class Reference

This class implements a plugin interface. More...

Public Member Functions

 Plugin ()=default
 Creates an empty plugin object. More...
 
 Plugin (const std::string &filename, const std::string &name, const std::string &description, const PluginType type, const PluginPriority priority, const PluginTypeSet &dependencySet, const std::string &thirdpartyDependences, const std::string &thirdpartyDescription)
 Creates a new plugin object. More...
 
const std::string & filename () const
 Returns the filename of the plugin. More...
 
const std::string & name () const
 Returns the name of the plugin. More...
 
const std::string & description () const
 Returns the description of the plugin. More...
 
const std::string & thirdpartyInformation () const
 Returns the version information of the used 3rd party libraries. More...
 
PluginType type () const
 Returns the type of this plugin. More...
 
const std::string & thirdpartyDependences () const
 Returns the 3rd party dependences of this plugin. More...
 
const std::string & thirdpartyDescription () const
 Returns the description about the 3rd party dependences of this plugin. More...
 
bool load () const
 Loads the plugin. More...
 
bool loadApple () const
 Loads the plugin (specialization for Apple platforms) More...
 
bool unload () const
 Tries to unload the plugin. More...
 
bool unloadApple () const
 Tries to unload the plugin. More...
 
 operator bool () const
 Returns whether the plugin is successfully loaded. More...
 
bool operator< (const Plugin &right) const
 Returns whether the left plugin has to be loaded before the right one. More...
 

Protected Types

typedef bool(* PluginLoadFunction) ()
 Definition of a function pointer for plugin load functions. More...
 
typedef bool(* PluginUnloadFunction) ()
 Definition of a function pointer for plugin unload functions. More...
 
typedef const char *(* PluginVersionFunction) ()
 Definition of a function pointer for plugin version information functions. More...
 

Protected Attributes

std::string filename_
 Filename of the plugin. More...
 
std::string name_
 Name of the plugin. More...
 
std::string description_
 Description of the plugin. More...
 
std::string thirdpartyInformation_
 3rd party library version information. More...
 
void * handle_ = nullptr
 Platform specific plugin handle. More...
 
PluginType type_ = TYPE_UNKNOWN
 Plugin type. More...
 
PluginTypeSet dependencySet_
 Set of plugin types this plugin depends on. More...
 
PluginPriority priority_ = PRIORITY_UNDEFINED
 Load priority of this plugin. More...
 
std::string thirdpartyDependences_
 3rd party dependences. More...
 
std::string thirdpartyDescription_
 3rd party description. More...
 
PluginLoadFunction loadFunction_ = nullptr
 Plugin load function. More...
 
PluginUnloadFunction unloadFunction_ = nullptr
 Plugin unload function. More...
 

Detailed Description

This class implements a plugin interface.

Member Typedef Documentation

◆ PluginLoadFunction

typedef bool(* Ocean::PluginManager::Plugin::PluginLoadFunction) ()
protected

Definition of a function pointer for plugin load functions.

◆ PluginUnloadFunction

typedef bool(* Ocean::PluginManager::Plugin::PluginUnloadFunction) ()
protected

Definition of a function pointer for plugin unload functions.

◆ PluginVersionFunction

typedef const char*(* Ocean::PluginManager::Plugin::PluginVersionFunction) ()
protected

Definition of a function pointer for plugin version information functions.

Constructor & Destructor Documentation

◆ Plugin() [1/2]

Ocean::PluginManager::Plugin::Plugin ( )
default

Creates an empty plugin object.

◆ Plugin() [2/2]

Ocean::PluginManager::Plugin::Plugin ( const std::string &  filename,
const std::string &  name,
const std::string &  description,
const PluginType  type,
const PluginPriority  priority,
const PluginTypeSet dependencySet,
const std::string &  thirdpartyDependences,
const std::string &  thirdpartyDescription 
)

Creates a new plugin object.

Parameters
filenamePlugin filename
namePlugin name
descriptionPlugin description
typePlugin type
priorityPlugin load priority, the higher the priority the earlier the plugin will be loaded
dependencySetSet of ocean plugin types this plugin depends on.
thirdpartyDependences3rd party dependences
thirdpartyDescription3rd party description

Member Function Documentation

◆ description()

const std::string & Ocean::PluginManager::Plugin::description ( ) const
inline

Returns the description of the plugin.

Returns
Plugin description

◆ filename()

const std::string & Ocean::PluginManager::Plugin::filename ( ) const
inline

Returns the filename of the plugin.

Returns
Plugin filename

◆ load()

bool Ocean::PluginManager::Plugin::load ( ) const

Loads the plugin.

Returns
True, if succeeded

◆ loadApple()

bool Ocean::PluginManager::Plugin::loadApple ( ) const

Loads the plugin (specialization for Apple platforms)

See also
load()
Returns
True, if succeeded

◆ name()

const std::string & Ocean::PluginManager::Plugin::name ( ) const
inline

Returns the name of the plugin.

Returns
Plugin name

◆ operator bool()

Ocean::PluginManager::Plugin::operator bool ( ) const
explicit

Returns whether the plugin is successfully loaded.

Returns
True, if so

◆ operator<()

bool Ocean::PluginManager::Plugin::operator< ( const Plugin right) const

Returns whether the left plugin has to be loaded before the right one.

Parameters
rightRight plugin
Returns
True, if so

◆ thirdpartyDependences()

const std::string & Ocean::PluginManager::Plugin::thirdpartyDependences ( ) const
inline

Returns the 3rd party dependences of this plugin.

Returns
3rd party dependences

◆ thirdpartyDescription()

const std::string & Ocean::PluginManager::Plugin::thirdpartyDescription ( ) const
inline

Returns the description about the 3rd party dependences of this plugin.

Returns
3rd party description

◆ thirdpartyInformation()

const std::string & Ocean::PluginManager::Plugin::thirdpartyInformation ( ) const
inline

Returns the version information of the used 3rd party libraries.

Returns
Version information

◆ type()

PluginManager::PluginType Ocean::PluginManager::Plugin::type ( ) const
inline

Returns the type of this plugin.

Returns
Plugin type

◆ unload()

bool Ocean::PluginManager::Plugin::unload ( ) const

Tries to unload the plugin.

All resources using this plugin have to be released to unload the plugin.

Returns
True, if succeeded

◆ unloadApple()

bool Ocean::PluginManager::Plugin::unloadApple ( ) const

Tries to unload the plugin.

(specialization for Apple platforms) All resources using this plugin have to be released to unload the plugin.

See also
unload()
Returns
True, if succeeded

Field Documentation

◆ dependencySet_

PluginTypeSet Ocean::PluginManager::Plugin::dependencySet_
protected

Set of plugin types this plugin depends on.

◆ description_

std::string Ocean::PluginManager::Plugin::description_
protected

Description of the plugin.

◆ filename_

std::string Ocean::PluginManager::Plugin::filename_
protected

Filename of the plugin.

◆ handle_

void* Ocean::PluginManager::Plugin::handle_ = nullptr
mutableprotected

Platform specific plugin handle.

◆ loadFunction_

PluginLoadFunction Ocean::PluginManager::Plugin::loadFunction_ = nullptr
mutableprotected

Plugin load function.

◆ name_

std::string Ocean::PluginManager::Plugin::name_
protected

Name of the plugin.

◆ priority_

PluginPriority Ocean::PluginManager::Plugin::priority_ = PRIORITY_UNDEFINED
protected

Load priority of this plugin.

◆ thirdpartyDependences_

std::string Ocean::PluginManager::Plugin::thirdpartyDependences_
protected

3rd party dependences.

◆ thirdpartyDescription_

std::string Ocean::PluginManager::Plugin::thirdpartyDescription_
protected

3rd party description.

◆ thirdpartyInformation_

std::string Ocean::PluginManager::Plugin::thirdpartyInformation_
protected

3rd party library version information.

◆ type_

PluginType Ocean::PluginManager::Plugin::type_ = TYPE_UNKNOWN
protected

Plugin type.

◆ unloadFunction_

PluginUnloadFunction Ocean::PluginManager::Plugin::unloadFunction_ = nullptr
mutableprotected

Plugin unload function.


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