PConcurrentRawBufferQueue.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2018 Digital Barriers plc. All rights reserved.
3  * Contact: http://www.digitalbarriers.com/
4  *
5  * This file is part of the Papillon SDK.
6  *
7  * You can't use, modify or distribute any part of this file without
8  * the explicit written agreements of Digital Barriers.
9  */
10 
15 #pragma once
16 #include <PObject.h>
17 
18 PAPILLON_BEGIN_NAMESPACE
19 
28 class PAPILLON_API_CORE PConcurrentRawBufferQueue : public PObject
29 {
30 public:
38  explicit PConcurrentRawBufferQueue(papillon::int32 capacity, papillon::int32 sizeOfBuffersInBytes);
39 
44 
48  virtual ~PConcurrentRawBufferQueue();
49 
54 
59  void Enqueue(const void* sourceBuffer);
60 
73  PResult TryEnqueue(const void* sourceBuffer, int32 timeOutMs = -1);
74 
86  PResult TryDequeue(void* destinationBuffer, int32 timeOutMs = -1);
87 
94  void Clear();
95 
102  void ResizeBuffers(papillon::int32 newSizeOfBuffers);
103 
108  bool IsEmpty();
109 
116  bool IsFull();
117 
122  void DropOldest();
123 
127  papillon::int32 Size();
128 
132  papillon::int32 GetCapacity() const;
133 };
134 
135 PAPILLON_END_NAMESPACE
136 
The PResult class represents the result returned by most of Papillon functions; this class is used to...
Definition: PResult.h:159
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
The PConcurrentRawBufferQueue class represents a concurrent bounded queue of raw buffers, thread-safe.
Class PObject: the root class of all Papillon classes.
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45