Salome HOME
This commit was generated by cvs2git to create tag 'V1_4_0b2'.
[modules/kernel.git] / src / Logger / SALOME_Trace.hxx
1 //  SALOME Logger : CORBA server managing trace output
2 //
3 //  Copyright (C) 2003  CEA/DEN, EDF R&D
4 //
5 //
6 //
7 //  File   : SALOME_Trace.cxx
8 //  Author : Vasily Rusyaev
9 //  Module : SALOME
10
11 #if !defined(AFX_LOGGER_H__96F2A3AB_F6F8_11D6_BFA6_000476A0958C__INCLUDED_)
12 #define AFX_LOGGER_H__96F2A3AB_F6F8_11D6_BFA6_000476A0958C__INCLUDED_
13
14 //these declarations for files don't using OCC includes (for example HDF)
15 # ifdef WNT
16
17 #  ifndef Standard_EXPORT
18 #   define Standard_EXPORT __declspec( dllexport )
19 // For global variables :
20 #   define Standard_EXPORTEXTERN __declspec( dllexport ) extern
21 #   define Standard_EXPORTEXTERNC extern "C" __declspec( dllexport )
22 #  endif  /* Standard_EXPORT */
23
24 #  ifndef Standard_IMPORT
25 #   define Standard_IMPORT __declspec( dllimport ) extern
26 #   define Standard_IMPORTC extern "C" __declspec( dllimport )
27 #  endif  /* Standard_IMPORT */
28
29 # else  /* WNT */
30
31 #  ifndef Standard_EXPORT
32 #   define Standard_EXPORT
33 // For global variables :
34 #   define Standard_EXPORTEXTERN extern
35 #   define Standard_EXPORTEXTERNC extern "C"
36 #  endif  /* Standard_EXPORT */
37
38 #  ifndef Standard_IMPORT
39 #   define Standard_IMPORT extern
40 #   define Standard_IMPORTC extern "C"
41 #  endif  /* Standard_IMPORT */
42
43 # endif  /* WNT */
44
45 using namespace std;
46
47 #include <strstream.h>
48 #include "Logger.hh"
49
50 class SALOME_Trace : public ostrstream  
51 {
52 public:
53         virtual ~SALOME_Trace();
54         static Standard_EXPORT SALOME_Trace& Instance();
55         // initializes Logger (if USE_LOGGER variable is set) and returns true, in case success
56         int Initialize(CORBA::ORB_ptr theOrb);
57         Standard_EXPORT void putMessage(std::ostream& msg);
58 protected:
59         //disable creation of instances. It's necessary to use static SALOME_Logger& Instance()
60         SALOME_Trace();
61         SALOME_Logger::Logger_var m_pInterfaceLogger;// object reference on Logger server.
62         int isInitialized;
63 };
64
65 #define GLogger SALOME_Trace::Instance()
66
67 #endif // !defined(AFX_LOGGER_H__96F2A3AB_F6F8_11D6_BFA6_000476A0958C__INCLUDED_)