]> SALOME platform Git repositories - modules/hexablock.git/blob - src/HEXABLOCK/HexWitness.hxx
Salome HOME
Undef max Visual Studio definition.
[modules/hexablock.git] / src / HEXABLOCK / HexWitness.hxx
1
2 // Class : Enregistrement des dianostics
3
4 // Copyright (C) 2009-2013  CEA/DEN, EDF R&D
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ 
21 // or email : webmaster.salome@opencascade.com
22
23 #ifndef __WITNESS_H_
24 #define __WITNESS_H_
25
26 #include "Hex_defines.hxx"
27
28 #define  Mess   el_root->glob->mess << Begin
29 #define  Follow el_root->glob->mess
30
31 #include "hexa_base.hxx"
32
33 #if defined WIN32
34 #pragma warning ( disable: 4251 )
35 #endif
36
37 BEGIN_NAMESPACE_HEXA
38
39 const std::string Begin (" **** ");
40
41 class DumpStudy;
42 class HEXABLOCKENGINE_EXPORT Witness
43 {
44 public :
45    Witness ();
46    void     setDump (DumpStudy* dd)      { dump_study = dd                ; }
47    void     raz ()                       { mess_state = NoMessage         ; }
48    bool     hasMessage ()                { return mess_state != NoMessage ; }
49    TabText& getMessage ();
50    int      sizeofMessage  ();
51    cpchar   getLine (int nro);
52    void     printMessage ();
53
54    Witness& operator << (int      val);
55    Witness& operator << (double   val);
56    Witness& operator << (cpchar   val);
57    Witness& operator << (rcstring val);
58    Witness& operator << (EltBase* val);
59
60 private :
61    void openMessage  ();
62    void closeMessage () {};
63    void pushLine     ();
64
65 private :
66    TabText      bla_bla;
67    std::string  curr_line; 
68    int          w_status;
69    int          nbr_lines;
70    enum EnumMessage { NoMessage, MessOpen, MessClosed }  mess_state;
71    bool         line_open;
72    DumpStudy*   dump_study;
73 };
74 END_NAMESPACE_HEXA
75 #endif