GemaCoreLib
The GeMA Core library
gmSolutionData.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_SOLUTION_DATA_H_
25 #define _GEMA_SOLUTION_DATA_H_
26 
27 #include "gmCoreConfig.h"
28 
29 #include <QString>
30 #include <luaFunction.h>
31 
32 class GmPhysics;
33 class GmNumSolver;
34 class GmLogCategory;
35 
36 
41 {
42 public:
44  ~GmSolutionData();
45 
46  void clear();
47 
49  const QMap<QString, GmPhysics*>& physics() const { return _physicsMap; }
50 
52  const QMap<QString, GmNumSolver*>& numSolvers() const { return _numSolverMap; }
53 
57  bool addPhysics(GmPhysics* phys) { return addObjectToMap<GmPhysics>(phys, _physicsMap); }
58 
62  bool addNumSolver(GmNumSolver* nsolver) { return addObjectToMap<GmNumSolver>(nsolver, _numSolverMap); }
63 
65  LuaFunction& mainScript() { return _mainScript; }
66 
68  const QMap<QString, QString>& processSetMap() const { return _processSetMap; }
69 
71  void setMainScript(LuaFunction& f) { _mainScript = f; }
72 
73  bool addProcessSet(QString setName, QString pluginName);
74 
75  void printInfo(const GmLogCategory& logger);
76 
77 private:
78  template <class T> bool addObjectToMap (T* obj, QMap<QString, T*>& map);
79 
84 };
85 
86 #endif
Auxiliar class used to store the complete set of solution methods data for a simulation.
Definition: gmSolutionData.h:40
const QMap< QString, GmNumSolver * > & numSolvers() const
Returns a const refernce to the numerical solvers map.
Definition: gmSolutionData.h:52
QMap< QString, GmNumSolver * > _numSolverMap
Map storing numeric solvers, keyed by solver id.
Definition: gmSolutionData.h:83
Declaration of usefull configuration definitions for the Core library.
LuaFunction _mainScript
Reference for the main script function.
Definition: gmSolutionData.h:80
QMap< QString, QString > _processSetMap
Map storing for each process function group the name of the plugin that implements it.
Definition: gmSolutionData.h:81
bool addPhysics(GmPhysics *phys)
Adds a physical method to the model. Returns false if an object with the same id already exists....
Definition: gmSolutionData.h:57
const QMap< QString, QString > & processSetMap() const
Returns the map asscoiating process set names with plugin names.
Definition: gmSolutionData.h:68
LuaFunction & mainScript()
Returns a reference for the main lua script.
Definition: gmSolutionData.h:65
bool addNumSolver(GmNumSolver *nsolver)
Adds a numeric solver to the model. Returns false if an object with the same id already exists....
Definition: gmSolutionData.h:62
Base interface class for Physics type plugins.
Definition: gmPhysics.h:41
Base interface class for NumSolver type plugins.
Definition: gmNumSolver.h:34
QMap< QString, GmPhysics * > _physicsMap
Map storing physics objects, keyed by physics id.
Definition: gmSolutionData.h:82
void setMainScript(LuaFunction &f)
Updates the main Lua script used for the simulation.
Definition: gmSolutionData.h:71
const QMap< QString, GmPhysics * > & physics() const
Returns a const refernce to the state vars map.
Definition: gmSolutionData.h:49
#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
Class representing a category with multiple logging levels.
Definition: gmLog.h:58