2
* @file pluginEntryPointBase.cpp
4
* This file pluginEntryPointBase.cpp is created at Almende B.V. It is open-source software and part
5
* of the Common Hybrid Agent Platform (CHAP). A toolbox with a lot of open-source tools.
6
* Ranging from thread pools, and TCP/IP components to control architectures and learning
7
* algorithms. This software is published under the GNU Lesser General Public license,
9
* It is not possible to add usage restrictions to an open-source license. Nevertheless,
10
* we personally strongly object against this software used by the military, in the
11
* bio-industry, for animal experimentation, or anything that violates the Universal
12
* Declaration of Human Rights.
14
* @author Anne C. van Rossum
16
* @project Replicator FP7
17
* @company Almende B.V.
21
#ifndef PLUGINENTRYPOINTBASE_H_
22
#define PLUGINENTRYPOINTBASE_H_
25
#include <dtGame/gameapplication.h>
26
#include <dtGame/gmcomponent.h>
29
#include <srCore/export.h>
34
* This class functions exactly the same as the Delta3D class dtGame::GameEntryPoint. It is meant
35
* to be inherited by classes that want to add additional functionality to the simulator, for
36
* example in the form of components. Examples of such components:
38
* <li>A component that adds coloured traces to the trajectories of the robots.
39
* <li>A component that adds colours to the robots.
40
* <li>A component that adds an UART interface to each robot in the simulator.
42
* For example, inherit PluginEntryPointBase by TraceComponent.
44
* The two functions that are needed (you define them in TraceComponent.cpp):
46
* <li>extern "C" ROBOT_EXPORT PluginEntryPoint* CreatePluginEntryPoint();
47
* <li>extern "C" ROBOT_EXPORT void DestroyPluginEntryPoint();
49
* They need to have the code to create a TraceComponent and destroy it again. Of course, it is
50
* possible to have a Singleton of the derived TraceComponent class. However, PluginEntryPointBase
51
* is not a singleton, it can be inherited in multiple libraries.
53
class ROBOT_EXPORT PluginEntryPointBase {
58
PluginEntryPointBase() {;}
63
virtual ~PluginEntryPointBase() {;}
66
* A virtual function that makes this class abstract (like a Java interface). This function
67
* needs to be implemented by your derived class. It will be the function that is called
68
* by Robot3D right after CreatePluginEntryPoint. It will have a reference to the Delta3D
69
* dtGame::GameApplication class, so it is possible to get hands on all possible components
70
* and controllers via that class.
72
* As example, take a look how the srInterface library is organised.
74
* @param application A Delta3D GameApplication class through which everything can be obtained
76
virtual void StartPlugin(dtGame::GameApplication &application) = 0;
82
#endif /* PLUGINENTRYPOINTBASE_H_ */