MimmoNamespace.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 __MIMMONAMESPACE_HPP__
25 #define __MIMMONAMESPACE_HPP__
26 
27 #include <mimmo_binary_stream.hpp>
28 #include <logger.hpp>
29 
30 namespace mimmo{
40 struct FileDataInfo{
41  int ftype;
42  std::string fname;
43  std::string fdir;
45  FileDataInfo();
46  virtual ~FileDataInfo();
48  FileDataInfo(const FileDataInfo&) = default;
50  FileDataInfo & operator=(const FileDataInfo&) = default;
51 };
52 
53 }
54 
66  namespace mimmo{
67 
68  class BaseManipulation;
69 
77 namespace pin{
78 
83 enum class ConnectionType{
84  BOTH ,
85  BACKWARD ,
86  FORWARD
87 };
88 
89 typedef std::string PortID;
92 bool addPin(BaseManipulation* objSend, BaseManipulation* objRec, PortID portS, PortID portR, bool forced = false);
93 
94 void removeAllPins(BaseManipulation* objSend, BaseManipulation* objRec);
95 
96 void removePin(BaseManipulation* objSend, BaseManipulation* objRec, PortID portS, PortID portR);
97 
98 bool checkCompatibility(BaseManipulation* objSend, BaseManipulation* objRec, PortID portS, PortID portR);
99 
100 
101 } //end of pin namespace
102 
103 
104 //log variables
105 extern std::string MIMMO_LOG_FILE;
106 extern std::string MIMMO_LOG_DIR;
108 void setLogger(std::string log);
109 void setLoggerDirectory(std::string dir);
110 
111 void warningXML(bitpit::Logger* log, std::string name);
112 
113 //expert variable
114 extern bool MIMMO_EXPERT;
117 void setExpertMode(bool flag = true);
118 
119 }//end namespace mimmo
120 
121 #endif
void setLogger(std::string log)
void removePin(BaseManipulation *objSend, BaseManipulation *objRec, PortID portS, PortID portR)
FileDataInfo is a struct to stock data relative to names of external files.
mimmo::OBinaryStream & operator<<(mimmo::OBinaryStream &buf, const mimmo::FileDataInfo &element)
bool checkCompatibility(BaseManipulation *objSend, BaseManipulation *objRec, PortID portS, PortID portR)
mimmo::IBinaryStream & operator>>(mimmo::IBinaryStream &buf, mimmo::FileDataInfo &element)
mimmo custom derivation of bitpit OBinaryStream (see relative doc)
void warningXML(bitpit::Logger *log, std::string name)
BaseManipulation is the base class of any manipulation object of the library.
ConnectionType
Type of allowed connections of the object: bidirectional, only input or only output.
bool addPin(BaseManipulation *objSend, BaseManipulation *objRec, PortID portS, PortID portR, bool forced)
FileDataInfo & operator=(const FileDataInfo &)=default
std::string PortID
mimmo custom derivation of bitpit IBinaryStream (see relative doc)
void setExpertMode(bool flag)
void removeAllPins(BaseManipulation *objSend, BaseManipulation *objRec)
void setLoggerDirectory(std::string dir)