]> SALOME platform Git repositories - modules/kernel.git/blob - src/SALOMELocalTrace/SALOME_Log.hxx
Salome HOME
PR: mergefrom_BSEC_br1_14Mar04
[modules/kernel.git] / src / SALOMELocalTrace / SALOME_Log.hxx
1 //  SALOME Utils : general SALOME's definitions and tools
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SALOME_Log.hxx
25 //  Author : Vasily Rusyaev (OCN), Paul RASCLE (EDF)
26 //  Module : KERNEL
27 //  $Header$
28
29 #ifndef _SALOME_LOG_HXX_
30 #define _SALOME_LOG_HXX_
31
32 //these declarations for files don't using OCC includes (for example HDF)
33 # ifdef WNT
34
35 #  ifndef Standard_EXPORT
36 #   define Standard_EXPORT __declspec( dllexport )
37 // For global variables :
38 #   define Standard_EXPORTEXTERN __declspec( dllexport ) extern
39 #   define Standard_EXPORTEXTERNC extern "C" __declspec( dllexport )
40 #  endif  /* Standard_EXPORT */
41
42 #  ifndef Standard_IMPORT
43 #   define Standard_IMPORT __declspec( dllimport ) extern
44 #   define Standard_IMPORTC extern "C" __declspec( dllimport )
45 #  endif  /* Standard_IMPORT */
46
47 # else  /* WNT */
48
49 #  ifndef Standard_EXPORT
50 #   define Standard_EXPORT
51 // For global variables :
52 #   define Standard_EXPORTEXTERN extern
53 #   define Standard_EXPORTEXTERNC extern "C"
54 #  endif  /* Standard_EXPORT */
55
56 #  ifndef Standard_IMPORT
57 #   define Standard_IMPORT extern
58 #   define Standard_IMPORTC extern "C"
59 #  endif  /* Standard_IMPORT */
60
61 # endif  /* WNT */
62
63
64
65 #include <iostream>
66 #include <strstream>
67
68 using namespace std;
69
70 class SALOME_Log : public ostrstream
71 {
72 private:
73   static SALOME_Log* _singleton;
74 protected:
75   //disable creation of instances: force use static SALOME_Log& Instance()
76   SALOME_Log();
77 public:
78   virtual ~SALOME_Log();
79   static Standard_EXPORT SALOME_Log* Instance();
80   Standard_EXPORT void putMessage(std::ostream& msg);
81 };
82
83 #define SLog SALOME_Log::Instance()
84
85 #endif