Module.hpp
1 /*---------------------------------------------------------------------------*\
2  *
3  * mimmo
4  *
5  * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6  *
7  * -------------------------------------------------------------------------
8  * License
9  * This file is part of mimmo.
10  *
11  * mimmo is free software: you can redistribute it and/or modify it
12  * under the terms of the GNU Lesser General Public License v3 (LGPL)
13  * as published by the Free Software Foundation.
14  *
15  * mimmo is distributed in the hope that it will be useful, but WITHOUT
16  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18  * License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with mimmo. If not, see <http://www.gnu.org/licenses/>.
22  *
23 \*---------------------------------------------------------------------------*/
24 #ifndef __MODULE_HPP__
25 #define __MODULE_HPP__
26 
27 #include "BaseManipulation.hpp"
28 
29 namespace mimmo{
30 
66 class Module: public BaseManipulation{
67 protected:
71 public:
72  Module();
73  Module(const bitpit::Config::Section & rootXML);
74  virtual ~Module();
75 
76  Module(const Module & other);
77  Module& operator=(Module other);
78 
79  void buildPorts();
80 
81  void setField(dmpvecarr3E*field);
83 
84  void plotOptionalResults();
85  void execute();
86  void clear();
87 
88  virtual void absorbSectionXML(const bitpit::Config::Section & slotXML, std::string name="");
89  virtual void flushSectionXML(bitpit::Config::Section & slotXML, std::string name="");
90 
91 protected:
92  void swap(Module & x) noexcept;
93 
94 };
95 
98 
99 REGISTER(BaseManipulation, Module, "mimmo.Module")
100 };
101 
102 #endif /* __MODULE_HPP__ */
Module & operator=(Module other)
Definition: Module.cpp:83
dmpvecarr3E m_field
Definition: Module.hpp:68
void swap(Module &x) noexcept
Definition: Module.cpp:72
dmpvector1D * getResult()
Definition: Module.cpp:124
void clear()
Definition: Module.cpp:103
void execute()
Definition: Module.cpp:132
Module is an executable block class capable of computing the magnitude field of a vector field.
Definition: Module.hpp:66
BaseManipulation is the base class of any manipulation object of the library.
#define M_VECTORFIELD
#define MC_SCALAR
dmpvector1D m_result
Definition: Module.hpp:69
#define MD_MPVECARR3FLOAT_
#define REGISTER_PORT(Name, Container, Datatype, ManipBlock)
void setField(dmpvecarr3E *field)
Definition: Module.cpp:114
void plotOptionalResults()
Definition: Module.cpp:151
#define MD_MPVECFLOAT_
#define M_SCALARFIELD
virtual ~Module()
Definition: Module.cpp:57
virtual void flushSectionXML(bitpit::Config::Section &slotXML, std::string name="")
Definition: Module.cpp:175
void buildPorts()
Definition: Module.cpp:92
virtual void absorbSectionXML(const bitpit::Config::Section &slotXML, std::string name="")
Definition: Module.cpp:163
#define REGISTER(Base, Derived, name)
Definition: factory.hpp:206