PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusIGTLMessageQueue.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2  Program: Plus
3  Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4  See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #ifndef __vtkPlusIGTLMessageQueue_h
8 #define __vtkPlusIGTLMessageQueue_h
9 
10 #include "vtkPlusOpenIGTLinkExport.h"
11 
12 #include "vtkObject.h"
13 
14 #include <deque>
15 
16 #include "igtlMessageBase.h"
17 
18 class vtkIGSIORecursiveCriticalSection;
19 
25 class vtkPlusOpenIGTLinkExport vtkPlusIGTLMessageQueue : public vtkObject
26 {
27  typedef std::deque<igtl::MessageBase*> MessageBuffer;
28 
29 public:
30  static vtkPlusIGTLMessageQueue *New();
31  vtkTypeMacro( vtkPlusIGTLMessageQueue,vtkObject );
32  virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
33 
34  void PushMessage( igtl::MessageBase* message );
35  igtl::MessageBase* PullMessage();
36 
37  int GetSize();
38 
39 protected:
40 
42  virtual ~vtkPlusIGTLMessageQueue();
43 
44 
45 protected:
46  vtkIGSIORecursiveCriticalSection* Mutex;
47  MessageBuffer DataBuffer;
48 };
49 
50 
51 #endif
vtkIGSIORecursiveCriticalSection * Mutex
#define VTK_OVERRIDE
Definition: PlusCommon.h:49
Message queue to store OpenIGTLink messages.
const char * message
Definition: phidget22.h:2457