VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtLocklessQueue.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vector>
13 
14 namespace makVrv
15 {
20  template <class T>
22  {
23  public:
24 
26  DtLocklessQueue(int size);
27 
30 
32  void push(T newElement);
33 
35  T pop();
36 
39  bool okToPush();
40 
42  int count();
43 
44  private:
45 
48 
50  DtLocklessQueue( const DtLocklessQueue& orig);
51 
54 
55  protected:
56  std::vector<T> myElements;
59  };
60 }
61 
62 #define DtLocklessQueue_INL_
63 #include <vrvUtil/DtLocklessQueue.inl>
64 #undef DtLocklessQueue_INL_
bool okToPush()
Check to see if there is room in the queue. If there is not enough room, the call to push will block...
voidpf void uLong size
Definition: ioapi.h:39
int myWriteHead
Definition: DtLocklessQueue.h:58
T pop()
Remove an element from the queue.
DtLocklessQueue is a thread safe queue for single reader/single writer. It may block if the queue fil...
Definition: DtLocklessQueue.h:21
int myReadHead
Definition: DtLocklessQueue.h:57
DtLocklessQueue & operator=(const DtLocklessQueue &rhs)
Assignment operator (unimplemented)
DtLocklessQueue()
Default CTOR (unimplemented)
int count()
Get the current element count.
void push(T newElement)
Add an element fo the queue.
std::vector< T > myElements
Definition: DtLocklessQueue.h:56

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)