VR-Link API Documentation for HLA 1.3
Home
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vlutil
vlLockfreeMpmcQueue.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 2014 VT MAK
3
** All rights reserved.
4
*********************************************************************/
9
#pragma once
10
11
#ifdef WIN32
12
#if _MSC_VER < 1400
13
#define LOCKFREEQUEUE_UNSUPPORTED
14
#endif
15
#endif
16
17
#ifndef LOCKFREEQUEUE_UNSUPPORTED
18
19
#include <
vlutil/vlMachineTypes.h
>
20
21
#ifdef DtUSE_UTILITIES_NAMESPACE
22
namespace
DtUSE_UTILITIES_NAMESPACE
23
{
24
#endif
25
26
27
class
DT_DLL_VLUTIL
DtLockfreeMpmcQueueImpl
28
{
29
public
:
30
DtLockfreeMpmcQueueImpl
(
unsigned
int
size);
31
32
virtual
~
DtLockfreeMpmcQueueImpl
();
33
34
bool
_push(
void
*
const
& t);
35
36
size_t
_pop(
void
* & ret);
37
38
bool
_empty();
39
40
private
:
41
void
*
myQueue
;
42
};
43
44
template
<
class
T>
45
class
DtLockfreeMpmcQueue
:
public
DtLockfreeMpmcQueueImpl
46
{
47
48
public
:
49
50
DtLockfreeMpmcQueue
(
unsigned
int
size) :
DtLockfreeMpmcQueueImpl
(size)
51
{
52
}
53
54
~
DtLockfreeMpmcQueue
()
55
{
56
57
}
58
59
inline
bool
push(T
const
& t)
60
{
61
return
_push(reinterpret_cast<void*>(t));
62
}
63
64
inline
size_t
pop(T & ret)
65
{
66
return
_pop(reinterpret_cast<void* &>(ret));
67
}
68
69
inline
bool
empty(
void
)
70
{
71
return
_empty();
72
}
73
};
74
75
76
#ifdef DtUSE_UTILITIES_NAMESPACE
77
}
// end of namespace DtUSE_UTILITIES_NAMESPACE
78
#endif
79
80
#endif
Document ID: Generated on Mon Jun 22 21:18:40 EDT 2020 from SVN revision 213785
Copyright © 2005-2018 MAK Technologies. All Rights Reserved (
www.mak.com
)