VTK
vtkThreadMessager.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkThreadMessager.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
22 #ifndef vtkThreadMessager_h
23 #define vtkThreadMessager_h
24 
25 #include "vtkCommonSystemModule.h" // For export macro
26 #include "vtkObject.h"
27 
28 #if defined(VTK_USE_PTHREADS) || defined(VTK_HP_PTHREADS)
29 #include <pthread.h> // Needed for pthread types
30 #endif
31 
33 {
34 public:
35  static vtkThreadMessager *New();
36 
38  void PrintSelf(ostream& os, vtkIndent indent);
39 
41  void WaitForMessage();
42 
44  void SendWakeMessage();
45 
49  void EnableWaitForReceiver();
50 
54  void DisableWaitForReceiver();
55 
58  void WaitForReceiver();
59 
60 protected:
63 
64 #ifdef VTK_USE_PTHREADS
65  pthread_mutex_t Mutex;
66  pthread_cond_t PSignal;
67 #endif
68 
69 #ifdef VTK_USE_WIN32_THREADS
70  vtkWindowsHANDLE WSignal;
71 #endif
72 
73 private:
74  vtkThreadMessager(const vtkThreadMessager&); // Not implemented.
75  void operator=(const vtkThreadMessager&); // Not implemented.
76 };
77 
78 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:61
#define VTKCOMMONSYSTEM_EXPORT
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
A class for performing inter-thread messaging.
static vtkObject * New()