GemaCoreLib
The GeMA Core library
gmPluginObject.h
Go to the documentation of this file.
1 /************************************************************************
2 **
3 ** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4 ** All rights reserved.
5 **
6 ** This file is part of the "GeMA" software. It's use should respect
7 ** the terms in the license agreement that can be found together
8 ** with this source code.
9 ** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10 ** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11 ** A PARTICULAR PURPOSE.
12 **
13 ************************************************************************/
14 
24 #ifndef _GEMA_PLUGIN_OBJECT_H_
25 #define _GEMA_PLUGIN_OBJECT_H_
26 
27 #include "gmLog.h"
28 
29 #include <QString>
30 
31 class GmSimulationData;
32 class LuaTable;
33 
34 
37 {
38 public:
39  GmPluginObject(GmSimulationData* simulation, QString id, QString description, const GmLogCategory& logger);
40 
42  virtual ~GmPluginObject() {}
43 
45  QString id() const { return _id; }
46 
48  QString description() const { return _description; }
49 
51  QString pluginTypeName() const { return QString(pluginName()) + "." + pluginType(); }
52 
54  virtual const char* pluginCategory() const = 0;
55 
59  virtual const char* pluginName() const = 0;
60 
68  virtual const char* pluginType() const = 0;
69 
74  virtual bool loadPrivateData(LuaTable& table) = 0;
75 
81  virtual void printParameters(const GmLogCategory& logger) = 0;
82 
83 protected:
85  virtual const GmLogCategory& logger() const { return _logger; }
86 
88  GmSimulationData* simulationData() const { return _simData; }
89 
90 private:
91 
95 
97 };
98 
99 #endif
100 
GmSimulationData * _simData
Reference to the simulation object keeping all simulation data information.
Definition: gmPluginObject.h:92
QString pluginTypeName() const
Returns the hierarchical type name for the plugin object type. See also pluginName() and pluginType()...
Definition: gmPluginObject.h:51
virtual const GmLogCategory & logger() const
Returns the internal logger used by the plugin to emmit messages.
Definition: gmPluginObject.h:85
QString id() const
Returns the object id.
Definition: gmPluginObject.h:45
const GmLogCategory & _logger
Reference to the plugin private logger.
Definition: gmPluginObject.h:96
QString _description
Object description.
Definition: gmPluginObject.h:94
Auxiliar class used to store the complete set of simulation data.
Definition: gmSimulationData.h:51
virtual ~GmPluginObject()
Destructor.
Definition: gmPluginObject.h:42
QString description() const
Returns the object description.
Definition: gmPluginObject.h:48
Base interface class for all object plugins.
Definition: gmPluginObject.h:36
#define GMC_API_EXPORT
Macro for controling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_LI...
Definition: gmCoreConfig.h:35
GmSimulationData * simulationData() const
Returns a reference to the simulation data object keeping global simulation information.
Definition: gmPluginObject.h:88
Class representing a category with multiple logging levels.
Definition: gmLog.h:58
QString _id
Object unique id.
Definition: gmPluginObject.h:93
Declaration of support functions and macros for information logging.