cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
svlBufferSample.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Balazs Vagvolgyi
7  Created on: 2010
8 
9  (C) Copyright 2006-2010 Johns Hopkins University (JHU), All Rights
10  Reserved.
11 
12 --- begin cisst license - do not edit ---
13 
14 This software is provided "as is" under an open source license, with
15 no warranty. The complete license can be found in license.txt and
16 http://www.cisst.org/cisst/license.txt.
17 
18 --- end cisst license ---
19 
20 */
21 
22 #ifndef _svlBufferSample_h
23 #define _svlBufferSample_h
24 
28 
29 #if (CISST_OS == CISST_WINDOWS)
30 #include <windows.h>
31 #endif
32 
33 // Always include last!
35 
36 
38 {
39 public:
41  //creates a new buffer based on an existing sample prototype (including size)
42  svlBufferSample(const svlSample &sample);
43  ~svlBufferSample();
44 
45  svlStreamType GetType() const;
46 
47  int Push(const svlSample* sample);
48  svlSample* GetPushBuffer();
49  void Push();
50 
51  svlSample* Pull(bool waitfornew, double timeout = 5.0);
52 
53 private:
55 
56 #if (CISST_OS == CISST_WINDOWS)
57  LONG Next, Latest, Locked;
58 #else
59  unsigned int Next, Latest, Locked;
60 #endif
61  osaThreadSignal NewSampleEvent;
62  svlSample* Buffer[3];
63 
64 #if (CISST_OS == CISST_LINUX_RTAI) || (CISST_OS == CISST_LINUX) || (CISST_OS == CISST_DARWIN) || (CISST_OS == CISST_SOLARIS)
66 #endif
67 };
68 
69 #endif // _svlBufferSample_h
70 
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
svlStreamType
Definition: svlDefinitions.h:193
Definition: osaCriticalSection.h:36
Declaration of osaThreadSignal.
Macros to export the symbols of cisstStereoVision (in a Dll).
Definition: svlBufferSample.h:37
Definition: osaThreadSignal.h:40
Definition: svlSample.h:31