UniSet  2.24.2
Extensions.h
1 /*
2  * Copyright (c) 2015 Pavel Vainerman.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as
6  * published by the Free Software Foundation, version 2.1.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Lesser Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 // -------------------------------------------------------------------------
17 #ifndef Extensions_H_
18 #define Extensions_H_
19 // -------------------------------------------------------------------------
20 #include <string>
21 #include "UniXML.h"
22 #include "Debug.h"
23 #include "UniSetTypes.h"
24 #include "Calibration.h"
25 // -------------------------------------------------------------------------
26 namespace uniset
27 {
28  //--------------------------------------------------------------------------
29  namespace extensions
30  {
32  uniset::ObjectId getSharedMemoryID();
33 
34  xmlNode* findNode( xmlNode* node, const std::string& snode, const std::string& field );
35 
36  xmlNode* getCalibrationsSection();
37 
41  void escape_string( std::string& s );
42 
44  Calibration* buildCalibrationDiagram( const std::string& dname );
45 
46  void on_sigchild( int sig );
47 
48  std::shared_ptr<DebugStream> dlog();
49  }
50  // -------------------------------------------------------------------------
51  // "синтаксический сахар"..для логов
52 #define dinfo if( uniset::extensions::dlog()->debugging(Debug::INFO) ) uniset::extensions::dlog()->info()
53 #define dwarn if( uniset::extensions::dlog()->debugging(Debug::WARN) ) uniset::extensions::dlog()->warn()
54 #define dcrit if( uniset::extensions::dlog()->debugging(Debug::CRIT) ) uniset::extensions::dlog()->crit()
55 #define dlog1 if( uniset::extensions::dlog()->debugging(Debug::LEVEL1) ) uniset::extensions::dlog()->level1()
56 #define dlog2 if( uniset::extensions::dlog()->debugging(Debug::LEVEL2) ) uniset::extensions::dlog()->level1()
57 #define dlog3 if( uniset::extensions::dlog()->debugging(Debug::LEVEL3) ) uniset::extensions::dlog()->level3()
58 #define dlog4 if( uniset::extensions::dlog()->debugging(Debug::LEVEL4) ) uniset::extensions::dlog()->level4()
59 #define dlog5 if( uniset::extensions::dlog()->debugging(Debug::LEVEL5) ) uniset::extensions::dlog()->level5()
60 #define dlog6 if( uniset::extensions::dlog()->debugging(Debug::LEVEL6) ) uniset::extensions::dlog()->level6()
61 #define dlog7 if( uniset::extensions::dlog()->debugging(Debug::LEVEL7) ) uniset::extensions::dlog()->level7()
62 #define dlog8 if( uniset::extensions::dlog()->debugging(Debug::LEVEL8) ) uniset::extensions::dlog()->level8()
63 #define dlog9 if( uniset::extensions::dlog()->debugging(Debug::LEVEL9) ) uniset::extensions::dlog()->level9()
64 #define dlogsys if( uniset::extensions::dlog()->debugging(Debug::SYSTEM) ) uniset::extensions::dlog()->system()
65 #define dlogrep if( uniset::extensions::dlog()->debugging(Debug::REPOSITORY) ) uniset::extensions::dlog()->repository()
66 #define dlogany uniset::extensions::dlog()->any()
67  // --------------------------------------------------------------------------
68 } // end of namespace uniset
69 // -------------------------------------------------------------------------
70 
71 #endif // Extensions_H_
72 // -------------------------------------------------------------------------
Definition: CommonEventLoop.h:15
long ObjectId
Definition: UniSetTypes_i.idl:30