GenericOutputMPVData is the class that write a generic data to file output as mimmo::MimmoPiercedVector. More...
#include <GenericOutput.hpp>
Public Member Functions | |
GenericOutputMPVData (const bitpit::Config::Section &rootXML) | |
GenericOutputMPVData (const GenericOutputMPVData &other) | |
GenericOutputMPVData (std::string dir="./", std::string filename="output.txt", bool csv=false) | |
~GenericOutputMPVData () | |
virtual void | absorbSectionXML (const bitpit::Config::Section &slotXML, std::string name="") |
void | buildPorts () |
void | clearInput () |
void | execute () |
virtual void | flushSectionXML (bitpit::Config::Section &slotXML, std::string name="") |
template<typename T > | |
MimmoPiercedVector< T > * | getInput () |
GenericOutputMPVData & | operator= (GenericOutputMPVData other) |
void | setBinary (bool binary) |
void | setCSV (bool csv) |
void | setFilename (std::string filename) |
template<typename T > | |
void | setInput (MimmoPiercedVector< T > *data) |
template<typename T > | |
void | setInput (MimmoPiercedVector< T > data) |
void | setWriteDir (std::string dir) |
Public Member Functions inherited from mimmo::BaseManipulation | |
BaseManipulation () | |
BaseManipulation (const BaseManipulation &other) | |
virtual | ~BaseManipulation () |
void | activate () |
bool | arePortsBuilt () |
void | clear () |
void | disable () |
void | exec () |
BaseManipulation * | getChild (int i=0) |
ConnectionType | getConnectionType () |
MimmoSharedPointer< MimmoObject > | getGeometry () |
MimmoSharedPointer< MimmoObject > & | getGeometryReference () |
int | getId () |
bitpit::Logger & | getLog () |
std::string | getName () |
int | getNChild () |
int | getNParent () |
int | getNPortsIn () |
int | getNPortsOut () |
BaseManipulation * | getParent (int i=0) |
std::unordered_map< PortID, PortIn * > | getPortsIn () |
std::unordered_map< PortID, PortOut * > | getPortsOut () |
uint | getPriority () |
virtual std::vector< BaseManipulation * > | getSubBlocksEmbedded () |
bool | isActive () |
bool | isApply () |
bool | isChild (BaseManipulation *, int &) |
bool | isParent (BaseManipulation *, int &) |
bool | isPlotInExecution () |
BaseManipulation & | operator= (const BaseManipulation &other) |
void | removePins () |
void | removePinsIn () |
void | removePinsOut () |
void | setApply (bool flag=true) |
void | setGeometry (MimmoSharedPointer< MimmoObject > geometry) |
void | setId (int) |
void | setLog (bitpit::Logger &log) |
void | setName (std::string name) |
void | setOutputPlot (std::string path) |
void | setPlotInExecution (bool) |
void | setPriority (uint priority) |
void | unsetGeometry () |
Protected Member Functions | |
void | swap (GenericOutputMPVData &x) noexcept |
Protected Member Functions inherited from mimmo::BaseManipulation | |
void | _apply (MimmoPiercedVector< darray3E > &displacements) |
void | addChild (BaseManipulation *child) |
void | addParent (BaseManipulation *parent) |
void | addPinIn (BaseManipulation *objIn, PortID portR) |
void | addPinOut (BaseManipulation *objOut, PortID portS, PortID portR) |
virtual void | apply () |
void | cleanBufferIn (PortID port) |
template<typename T , typename O > | |
bool | createPortIn (O *obj, void(O::*setVar_)(T), PortID portR, bool mandatory=false, int family=0) |
template<typename T , typename O > | |
bool | createPortIn (T *var_, PortID portR, bool mandatory=false, int family=0) |
template<typename T , typename O > | |
bool | createPortOut (O *obj, T(O::*getVar_)(), PortID portS) |
template<typename T , typename O > | |
bool | createPortOut (T *var_, PortID portS) |
void | deletePorts () |
PortID | findPinIn (PortIn &pin) |
PortID | findPinOut (PortOut &pin) |
void | initializeLogger (bool logexists) |
virtual void | plotOptionalResults () |
void | readBufferIn (PortID port) |
void | removePinIn (BaseManipulation *objIn, PortID portR) |
void | removePinIn (PortID portR, int j) |
void | removePinOut (BaseManipulation *objOut, PortID portS) |
void | removePinOut (PortID portS, int j) |
void | setBufferIn (PortID port, mimmo::IBinaryStream &input) |
void | swap (BaseManipulation &x) noexcept |
void | unsetChild (BaseManipulation *child) |
void | unsetParent (BaseManipulation *parent) |
void | write (MimmoSharedPointer< MimmoObject > geometry) |
template<typename mpv_t > | |
void | write (MimmoSharedPointer< MimmoObject > geometry, MimmoPiercedVector< mpv_t > &data) |
template<typename mpv_t , typename... Args> | |
void | write (MimmoSharedPointer< MimmoObject > geometry, MimmoPiercedVector< mpv_t > &data, Args ... args) |
template<typename mpv_t > | |
void | write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t > * > &data) |
template<typename mpv_t , typename... Args> | |
void | write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t > * > &data, Args ... args) |
template<typename mpv_t > | |
void | write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t >> &data) |
template<typename mpv_t , typename... Args> | |
void | write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t >> &data, Args ... args) |
Additional Inherited Members | |
Public Types inherited from mimmo::BaseManipulation | |
typedef std::unordered_map< BaseManipulation *, int > | bmumap |
typedef pin::ConnectionType | ConnectionType |
typedef std::string | PortID |
Protected Attributes inherited from mimmo::BaseManipulation | |
bool | m_active |
bool | m_apply |
bool | m_arePortsBuilt |
bmumap | m_child |
int | m_counter |
bool | m_execPlot |
MimmoSharedPointer< MimmoObject > | m_geometry |
bitpit::Logger * | m_log |
std::string | m_name |
std::string | m_outputPlot |
bmumap | m_parent |
std::unordered_map< PortID, PortIn * > | m_portIn |
std::unordered_map< PortID, PortOut * > | m_portOut |
ConnectionType | m_portsType |
uint | m_priority |
Static Protected Attributes inherited from mimmo::BaseManipulation | |
static int | sm_baseManipulationCounter |
Detailed Description
GenericOutputMPVData is the class that write a generic data to file output as mimmo::MimmoPiercedVector.
GenericOutputMPVData is derived from BaseManipulation class. GenericOutputMPVData write MimmoPiercedVector data fields to file (unformatted/csv). When writing, the GenericOutputMPVData object recognizes the type of data and it adapts the writing method in function of the input port used to build link (pin) with an other object. Can write binary data in raw format only, activating the binary flag.
On distributed archs, only the 0 rank procs is deputed to writing.
Ports available in GenericOutputMPVData Class :
Port Input | ||
---|---|---|
PortType | variable/function | DataType |
M_SCALARFIELD | setInput | (MC_SCALAR, MD_MPVECFLOAT_) |
M_VECTORFIELD | setInput | (MC_SCALAR, MD_MPVECARR3FLOAT_) |
Port Output | ||
---|---|---|
PortType | variable/function | DataType |
The xml available parameters, sections and subsections are the following :
Inherited from BaseManipulation:
- ClassName: name of the class as
mimmo.GenericOutputMPVData
; - Priority: uint marking priority in multi-chain execution;
Proper of the class:
- Filename: name of file to write data;
- WriteDir: name of directory to write data;
- CSV: true if write in csv format;
- Binary: 0/1 set write a BINARY file (default ASCII).If CSV, only ASCII is available;
- Examples
- genericinput_example_00002.cpp.
Definition at line 203 of file GenericOutput.hpp.
Constructor & Destructor Documentation
◆ GenericOutputMPVData() [1/3]
mimmo::GenericOutputMPVData::GenericOutputMPVData | ( | std::string | dir = "./" , |
std::string | filename = "output.txt" , |
||
bool | csv = false |
||
) |
Default constructor of GenericOutputMPVData
- Parameters
-
[in] dir Directory of the output file (default value = "./"). [in] filename Name of the output file (default value = "output.txt"). [in] csv True if the output file is a csv format file (default value false).
Definition at line 230 of file GenericOutput.cpp.
◆ GenericOutputMPVData() [2/3]
mimmo::GenericOutputMPVData::GenericOutputMPVData | ( | const bitpit::Config::Section & | rootXML | ) |
Custom constructor reading xml data
- Parameters
-
[in] rootXML reference to your xml tree section
Definition at line 243 of file GenericOutput.cpp.
◆ ~GenericOutputMPVData()
mimmo::GenericOutputMPVData::~GenericOutputMPVData | ( | ) |
Default destructor of GenericOutputMPVData.
Definition at line 265 of file GenericOutput.cpp.
◆ GenericOutputMPVData() [3/3]
mimmo::GenericOutputMPVData::GenericOutputMPVData | ( | const GenericOutputMPVData & | other | ) |
Copy constructor of GenericOutputMPVData. m_input and m_result member are not copied.
Definition at line 270 of file GenericOutput.cpp.
Member Function Documentation
◆ absorbSectionXML()
|
virtual |
It sets infos reading from a XML bitpit::Config::section.
- Parameters
-
[in] slotXML bitpit::Config::Section of XML file [in] name name associated to the slot
Reimplemented from mimmo::BaseManipulation.
Definition at line 375 of file GenericOutput.cpp.
◆ buildPorts()
|
virtual |
It builds the input/output ports of the object
Implements mimmo::BaseManipulation.
Definition at line 303 of file GenericOutput.cpp.
◆ clearInput()
void mimmo::GenericOutputMPVData::clearInput | ( | ) |
It clear the input member of the object
Definition at line 352 of file GenericOutput.cpp.
◆ execute()
|
virtual |
Execution command. It does nothing, the real execution of the object happens in setInput.
Implements mimmo::BaseManipulation.
Definition at line 362 of file GenericOutput.cpp.
◆ flushSectionXML()
|
virtual |
It sets infos from class members in a XML bitpit::Config::section.
- Parameters
-
[in] slotXML bitpit::Config::Section of XML file [in] name name associated to the slot
Reimplemented from mimmo::BaseManipulation.
Definition at line 423 of file GenericOutput.cpp.
◆ getInput()
MimmoPiercedVector< T > * mimmo::GenericOutputMPVData::getInput |
It gets the input member of the object.
- Returns
- Pointer to data stored in the input member.
Definition at line 349 of file GenericOutput.tpp.
◆ operator=()
GenericOutputMPVData & mimmo::GenericOutputMPVData::operator= | ( | GenericOutputMPVData | other | ) |
Assignment operator
Definition at line 280 of file GenericOutput.cpp.
◆ setBinary()
void mimmo::GenericOutputMPVData::setBinary | ( | bool | binary | ) |
It sets if the output file is in Binary format.
- Parameters
-
[in] binary Is the output file in Binary format?
- Examples
- genericinput_example_00002.cpp.
Definition at line 343 of file GenericOutput.cpp.
◆ setCSV()
void mimmo::GenericOutputMPVData::setCSV | ( | bool | csv | ) |
It sets if the output file has to be written in csv format.
- Parameters
-
[in] csv Write the output file in csv format.
- Examples
- genericinput_example_00002.cpp.
Definition at line 335 of file GenericOutput.cpp.
◆ setFilename()
void mimmo::GenericOutputMPVData::setFilename | ( | std::string | filename | ) |
It sets the name of the output file.
- Parameters
-
[in] filename Name of the output file.
- Examples
- genericinput_example_00002.cpp.
Definition at line 326 of file GenericOutput.cpp.
◆ setInput() [1/2]
void mimmo::GenericOutputMPVData::setInput | ( | MimmoPiercedVector< T > * | data | ) |
Overloaded function of base class setInput. It sets the input/result and write on file at the same time.
- Parameters
-
[in] data Pointer to data to be written and to be used to set the input/result.
Definition at line 227 of file GenericOutput.tpp.
◆ setInput() [2/2]
void mimmo::GenericOutputMPVData::setInput | ( | MimmoPiercedVector< T > | data | ) |
Overloaded function of base class setInput. It sets the input/result and write on file at the same time.
- Parameters
-
[in] data Data to be written and to be used to set the input/result.
Definition at line 339 of file GenericOutput.tpp.
◆ setWriteDir()
void mimmo::GenericOutputMPVData::setWriteDir | ( | std::string | dir | ) |
It sets the name of the directory to write the output file.
- Parameters
-
[in] dir Name of the directory of the output file.
- Examples
- genericinput_example_00002.cpp.
Definition at line 317 of file GenericOutput.cpp.
◆ swap()
|
protectednoexcept |
The documentation for this class was generated from the following files:
- src/iogeneric/GenericOutput.hpp
- src/iogeneric/GenericOutput.cpp
- src/iogeneric/GenericOutput.tpp