ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

plugins.h File Reference

#include "common/array.h"
#include "common/fs.h"
#include "common/str.h"
Include dependency graph for plugins.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PluginObject
 Abstract base class for the plugin objects which handle plugins instantiation. More...
class  Plugin
 Abstract base class for the plugin system. More...
class  PluginProvider
 Abstract base class for Plugin factories. More...
class  FilePluginProvider
 Abstract base class for Plugin factories which load binary code from files. More...
class  PluginManager
 Singleton class which manages all plugins, including loading them, managing all Plugin class instances, and unloading them. More...
class  PluginManagerUncached
 Uncached version of plugin manager Keeps only one dynamic plugin in memory at a time. More...

Defines

#define PLUGIN_VERSION   1
 Global Plugin API version.
#define PLUGIN_TYPE_ENGINE_VERSION   1
#define PLUGIN_TYPE_MUSIC_VERSION   1
#define STATIC_PLUGIN   1
#define DYNAMIC_PLUGIN   2
#define PLUGIN_ENABLED_STATIC(ID)   (ENABLE_##ID && !PLUGIN_ENABLED_DYNAMIC(ID))
#define PLUGIN_ENABLED_DYNAMIC(ID)   (ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN))
#define PLUGIN_DYNAMIC_DSO_HANDLE
#define PLUGIN_DYNAMIC_BUILD_DATE
#define REGISTER_PLUGIN_STATIC(ID, TYPE, PLUGINCLASS)
 REGISTER_PLUGIN_STATIC is a convenience macro which is used to declare the plugin interface for static plugins.
#define REGISTER_PLUGIN_DYNAMIC(ID, TYPE, PLUGINCLASS)
 REGISTER_PLUGIN_DYNAMIC is a convenience macro which is used to declare the plugin interface for dynamically loadable plugins.
#define PluginMan   PluginManager::instance()

Typedefs

typedef Common::Array< Plugin * > PluginList
 List of Plugin instances.

Enumerations

enum  PluginType { PLUGIN_TYPE_ENGINE = 0, PLUGIN_TYPE_MUSIC, PLUGIN_TYPE_MAX }

Variables

int pluginTypeVersions [PLUGIN_TYPE_MAX]

Define Documentation

#define DYNAMIC_PLUGIN   2

Definition at line 77 of file plugins.h.

#define PLUGIN_DYNAMIC_BUILD_DATE

Definition at line 101 of file plugins.h.

#define PLUGIN_DYNAMIC_DSO_HANDLE

Definition at line 94 of file plugins.h.

#define PLUGIN_ENABLED_DYNAMIC (   ID  )     (ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN))

Definition at line 83 of file plugins.h.

#define PLUGIN_ENABLED_STATIC (   ID  )     (ENABLE_##ID && !PLUGIN_ENABLED_DYNAMIC(ID))

Definition at line 79 of file plugins.h.

#define PLUGIN_TYPE_ENGINE_VERSION   1

Definition at line 68 of file plugins.h.

#define PLUGIN_TYPE_MUSIC_VERSION   1

Definition at line 69 of file plugins.h.

#define PLUGIN_VERSION   1

Global Plugin API version.

Definition at line 56 of file plugins.h.

#define PluginMan   PluginManager::instance()

Definition at line 296 of file plugins.h.

#define REGISTER_PLUGIN_DYNAMIC (   ID,
  TYPE,
  PLUGINCLASS 
)
Value:
extern "C" { \
        PLUGIN_DYNAMIC_DSO_HANDLE \
        PLUGIN_DYNAMIC_BUILD_DATE \
        PLUGIN_EXPORT int32 PLUGIN_getVersion() { return PLUGIN_VERSION; } \
        PLUGIN_EXPORT int32 PLUGIN_getType() { return TYPE; } \
        PLUGIN_EXPORT int32 PLUGIN_getTypeVersion() { return TYPE##_VERSION; } \
        PLUGIN_EXPORT PluginObject *PLUGIN_getObject() { \
            return new PLUGINCLASS(); \
        } \
    } \
    void dummyFuncToAllowTrailingSemicolon()

REGISTER_PLUGIN_DYNAMIC is a convenience macro which is used to declare the plugin interface for dynamically loadable plugins.

Code (such as game engines) which needs to implement a dynamic plugin can simply invoke this macro with a plugin ID, plugin type and PluginObject subclass, and the correct wrapper code will be inserted.

See also:
REGISTER_PLUGIN_STATIC

Definition at line 131 of file plugins.h.

#define REGISTER_PLUGIN_STATIC (   ID,
  TYPE,
  PLUGINCLASS 
)
Value:
PluginType g_##ID##_type = TYPE; \
    PluginObject *g_##ID##_getObject() { \
        return new PLUGINCLASS(); \
    } \
    void dummyFuncToAllowTrailingSemicolon()

REGISTER_PLUGIN_STATIC is a convenience macro which is used to declare the plugin interface for static plugins.

Code (such as game engines) which needs to implement a static plugin can simply invoke this macro with a plugin ID, plugin type and PluginObject subclass, and the correct wrapper code will be inserted.

See also:
REGISTER_PLUGIN_DYNAMIC

Definition at line 113 of file plugins.h.

#define STATIC_PLUGIN   1

Definition at line 76 of file plugins.h.


Typedef Documentation

List of Plugin instances.

Definition at line 211 of file plugins.h.


Enumeration Type Documentation

enum PluginType
Enumerator:
PLUGIN_TYPE_ENGINE 
PLUGIN_TYPE_MUSIC 
PLUGIN_TYPE_MAX 

Definition at line 58 of file plugins.h.


Variable Documentation

int pluginTypeVersions[PLUGIN_TYPE_MAX]

Definition at line 36 of file plugins.cpp.



Generated on Sat Jun 15 2019 05:01:43 for ResidualVM by doxygen 1.7.1
curved edge   curved edge