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=========================================================================*/
23#ifndef vtkThreadMessager_h
24#define vtkThreadMessager_h
25
26#include "vtkCommonSystemModule.h" // For export macro
27#include "vtkObject.h"
28
29#if defined(VTK_USE_PTHREADS) || defined(VTK_HP_PTHREADS)
30#include <pthread.h> // Needed for pthread types
31#endif
32
33class VTKCOMMONSYSTEM_EXPORT vtkThreadMessager : public vtkObject
34{
35public:
37
39 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
40
46
52
59
66
73
74protected:
76 ~vtkThreadMessager() VTK_OVERRIDE;
77
78#ifdef VTK_USE_PTHREADS
79 pthread_mutex_t Mutex;
80 pthread_cond_t PSignal;
81#endif
82
83#ifdef VTK_USE_WIN32_THREADS
84 vtkWindowsHANDLE WSignal;
85#endif
86
87private:
88 vtkThreadMessager(const vtkThreadMessager&) VTK_DELETE_FUNCTION;
89 void operator=(const vtkThreadMessager&) VTK_DELETE_FUNCTION;
90};
91
92#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
A class for performing inter-thread messaging.
void DisableWaitForReceiver()
pthreads only.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkThreadMessager() override
void WaitForReceiver()
pthreads only.
void EnableWaitForReceiver()
pthreads only.
void SendWakeMessage()
Send a message to all threads who are waiting via WaitForMessage().
static vtkThreadMessager * New()
void WaitForMessage()
Wait (block, non-busy) until another thread sends a message.