GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
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
32class LuaTable;
33
34
37{
38public:
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
83protected:
85 virtual const GmLogCategory& logger() const { return _logger; }
86
88 GmSimulationData* simulationData() const { return _simData; }
89
90private:
91 friend class GmSimulationData; // Allow GmSimulationData::progressStats(const GmPluginObject*) to access simulationData()
92
96
98};
99
100#endif
101
Class representing a category with multiple logging levels.
Definition gmLog.h:58
Base interface class for all object plugins.
Definition gmPluginObject.h:37
virtual const GmLogCategory & logger() const
Returns the internal logger used by the plugin to emmit messages.
Definition gmPluginObject.h:85
QString pluginTypeName() const
Returns the hierarchical type name for the plugin object type. See also pluginName() and pluginType()...
Definition gmPluginObject.h:51
QString _description
Object description.
Definition gmPluginObject.h:95
GmSimulationData * simulationData() const
Returns a reference to the simulation data object keeping global simulation information.
Definition gmPluginObject.h:88
QString _id
Object unique id.
Definition gmPluginObject.h:94
virtual ~GmPluginObject()
Destructor.
Definition gmPluginObject.h:42
virtual const char * pluginCategory() const =0
Returns the plugin category.
virtual const char * pluginType() const =0
Returns the string identifying the plugin object type. Should return the SAME string as the one read ...
virtual bool loadPrivateData(LuaTable &table)=0
Function called by the model loader to give the object acess to it's private parameters....
const GmLogCategory & _logger
Reference to the plugin private logger.
Definition gmPluginObject.h:97
virtual const char * pluginName() const =0
Returns a string identifying the plugin which implements this object. Should return the SAME string a...
QString id() const
Returns the object id.
Definition gmPluginObject.h:45
GmSimulationData * _simData
Reference to the simulation object keeping all simulation data information.
Definition gmPluginObject.h:93
QString description() const
Returns the object description.
Definition gmPluginObject.h:48
Auxiliar class used to store the complete set of simulation data.
Definition gmSimulationData.h:55
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Declaration of support functions and macros for information logging.