Actin®  Version 5.2.0
Software for Robotics Simulation and Control
ecPlugin.h File Reference
#include "ecConfig.h"
#include "ecMacros.h"
#include "ecVersion.h"
#include <boost/shared_ptr.hpp>

Go to the source code of this file.

Classes

class  Ec::Plugin
 Provides an abstract class to be used as a template for creating dynamically loaded functions. More...
 

Namespaces

 Ec
 Energid common namespace.
 

Macros

#define EC_PLUGIN_DECL   EC_DECL_IMPORTS
 plugin imports
 
#define EC_PLUGIN_DECL_SPEC   EC_DECL_IMPORTS
 Specialized plugin imports.
 
#define EC_PLUGIN_STUB(cls, traits)
 
#define EC_PLUGIN_STUB_DEFAULT(cls)   EC_PLUGIN_STUB(cls,0)
 
#define EC_PLUGIN_THREAD_STARTCALL
 To allow a clean build w/wo latest stable.
 
#define EcPLUGIN_LOAD_AND_CAST(p)   Ec::plugin_load_and_cast<p>(#p)
 Convenience macro to cast from a general Plugin* to a specific class. This will attempt to load the plugin if it is not already loaded.
 
#define EcPLUGIN_FIND_AND_CAST(p)   Ec::plugin_find_and_cast<p>(#p)
 Convenience macro to cast from a general Plugin* to a specific class. This will not attempt to load the plugin if it is not already loaded.
 

Functions

template<typename T >
T * Ec::plugin_load_and_cast (const EcString &name)
 
template<typename T >
T * Ec::plugin_find_and_cast (const EcString &name)
 

Macro Definition Documentation

#define EC_PLUGIN_STUB (   cls,
  traits 
)
Value:
class cls##Helper : public cls\
{ \
public: \
cls##Helper():cls() { m_Name = #cls; m_PluginTraits |= (TraitMask&traits); } \
}; \
extern "C" EC_DECL_EXPORTS Ec::Plugin* loadPlugin() { return new cls##Helper; } \
extern "C" EC_DECL_EXPORTS const char* getPluginVersion(){ return EC_CMAKE_DEF_PLUGIN_VERSION; }
#define EC_DECL_EXPORTS
exports storage-class modifier
Definition: ecConfig.h:90
Provides an abstract class to be used as a template for creating dynamically loaded functions...
Definition: ecPlugin.h:82

Default plugin loader code. This macro needs to appear in the .cpp file for the plugin. It is a wrapper subclass of the plugin so that it may set internal variables and provide an entry point.

Parameters
clsClass name of plugin
traitsPlugin traits (capabilities available)

Definition at line 50 of file ecPlugin.h.

#define EC_PLUGIN_STUB_DEFAULT (   cls)    EC_PLUGIN_STUB(cls,0)

Convenience version of stub that uses the default setting for the plugin. In the case of a GUI plugin, this means that a separate thread will not be spawned to call the update(const EcReal time) method. A non-GUI plugin will spawn a thread.

Examples:
exampleGUIPlugin.cpp, exampleHardwarePlugin.cpp, exampleIoDirectionPlugin.cpp, and examplePlugin.cpp.

Definition at line 63 of file ecPlugin.h.

Created by Energid Technologies www.energid.com
Copyright © 2016 Energid. All trademarks mentioned in this document are property of their respective owners.