Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[modules/kernel.git] / src / SALOMELocalTrace / BaseTraceCollector.hxx
1 //  Copyright (C) 2004  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 // 
4 //  This library is free software; you can redistribute it and/or 
5 //  modify it under the terms of the GNU Lesser General Public 
6 //  License as published by the Free Software Foundation; either 
7 //  version 2.1 of the License. 
8 // 
9 //  This library is distributed in the hope that it will be useful, 
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 //  Lesser General Public License for more details. 
13 // 
14 //  You should have received a copy of the GNU Lesser General Public 
15 //  License along with this library; if not, write to the Free Software 
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 // 
18 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
19 //
20 //
21 //
22 //  File   : BaseTraceCollector.hxx
23 //  Author : Paul RASCLE (EDF)
24 //  Module : KERNEL
25 //  $Header$
26
27 #ifndef _BASETRACECOLLECTOR_HXX_
28 #define _BASETRACECOLLECTOR_HXX_
29
30 #include <pthread.h>
31 #include <semaphore.h>
32
33
34 #if defined SALOMELOCALTRACE_EXPORTS
35 #if defined WIN32
36 #define SALOMELOCALTRACE_EXPORT __declspec( dllexport )
37 #else
38 #define SALOMELOCALTRACE_EXPORT
39 #endif
40 #else
41 #if defined WNT
42 #define SALOMELOCALTRACE_EXPORT __declspec( dllimport )
43 #else
44 #define SALOMELOCALTRACE_EXPORT
45 #endif
46 #endif
47
48 //! See derived Classes in SALOMELocalTrace for usage without CORBA,
49 //! see derived Classes in SALOMETraceCollector for usage with CORBA.
50
51 class SALOMELOCALTRACE_EXPORT BaseTraceCollector
52 {
53  public:
54   virtual ~BaseTraceCollector();
55
56  protected:
57   BaseTraceCollector();
58
59   static int _threadToClose;
60   static BaseTraceCollector* _singleton;
61   static pthread_mutex_t _singletonMutex;
62   static pthread_t* _threadId;
63   static sem_t _sem;
64 };
65
66 #endif