From a4298b95fa971630ba21926e101a7fa4ee7ddb47 Mon Sep 17 00:00:00 2001 From: TravisBot <> Date: Sat, 2 Jun 2018 13:53:58 +0000 Subject: [Travis] Rebuilding documentation --- syncqueue_8h_source.html | 167 +++++++++++++++++++++++------------------------ 1 file changed, 82 insertions(+), 85 deletions(-) (limited to 'syncqueue_8h_source.html') diff --git a/syncqueue_8h_source.html b/syncqueue_8h_source.html index f9d6b543..126a48f3 100644 --- a/syncqueue_8h_source.html +++ b/syncqueue_8h_source.html @@ -91,97 +91,94 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
Go to the documentation of this file.
1 
-
9 #ifndef YAGE_UTIL_SYNCQUEUE_H
-
10 #define YAGE_UTIL_SYNCQUEUE_H
-
11 
-
12 #include <condition_variable>
-
13 #include <mutex>
-
14 #include <queue>
-
15 
-
16 namespace yage
-
17 {
-
18 
-
19 template <typename T>
-
20 class SyncQueue
-
21 {
-
22 public:
-
23  SyncQueue() = default;
-
24  SyncQueue(const SyncQueue &) = delete;
-
25  SyncQueue &operator=(const SyncQueue &) = delete;
-
26 
-
27  T pop();
-
28  void pop(T &item);
-
29  void push(const T &item);
-
30  void push(T &&item);
-
31 
-
32 private:
-
33  std::queue<T> queue_;
-
34  std::mutex mutex_;
-
35  std::condition_variable cond_;
-
36 };
-
37 
-
38 // Template definitions
-
39 
-
40 template <typename T>
- -
42 {
-
43  std::unique_lock<std::mutex> mlock(mutex_);
-
44 
-
45  while (queue_.empty()) {
-
46  cond_.wait(mlock);
-
47  }
-
48 
-
49  auto item = queue_.front();
-
50  queue_.pop();
-
51  return item;
-
52 }
-
53 
-
54 template <typename T>
-
55 void SyncQueue<T>::pop(T &item)
-
56 {
-
57  std::unique_lock<std::mutex> mlock(mutex_);
-
58 
-
59  while (queue_.empty()) {
-
60  cond_.wait(mlock);
-
61  }
-
62 
-
63  item = queue_.front();
-
64  queue_.pop();
-
65 }
-
66 
-
67 template <typename T>
-
68 void SyncQueue<T>::push(const T &item)
-
69 {
-
70  std::unique_lock<std::mutex> mlock(mutex_);
-
71 
-
72  queue_.push(item);
-
73  mlock.unlock();
-
74  cond_.notify_one();
-
75 }
-
76 
-
77 template <typename T>
-
78 void SyncQueue<T>::push(T &&item)
-
79 {
-
80  std::unique_lock<std::mutex> mlock(mutex_);
-
81 
-
82  queue_.push(std::move(item));
-
83  mlock.unlock();
-
84  cond_.notify_one();
-
85 }
-
86 
-
87 } // namespace yage
-
88 
-
89 #endif
+
9 #pragma once
+
10 
+
11 #include <condition_variable>
+
12 #include <mutex>
+
13 #include <queue>
+
14 
+
15 namespace yage
+
16 {
+
17 
+
18 template <typename T>
+
19 class SyncQueue
+
20 {
+
21 public:
+
22  SyncQueue() = default;
+
23  SyncQueue(const SyncQueue &) = delete;
+
24  SyncQueue &operator=(const SyncQueue &) = delete;
+
25 
+
26  T pop();
+
27  void pop(T &item);
+
28  void push(const T &item);
+
29  void push(T &&item);
+
30 
+
31 private:
+
32  std::queue<T> queue_;
+
33  std::mutex mutex_;
+
34  std::condition_variable cond_;
+
35 };
+
36 
+
37 // Template definitions
+
38 
+
39 template <typename T>
+ +
41 {
+
42  std::unique_lock<std::mutex> mlock(mutex_);
+
43 
+
44  while (queue_.empty()) {
+
45  cond_.wait(mlock);
+
46  }
+
47 
+
48  auto item = queue_.front();
+
49  queue_.pop();
+
50  return item;
+
51 }
+
52 
+
53 template <typename T>
+
54 void SyncQueue<T>::pop(T &item)
+
55 {
+
56  std::unique_lock<std::mutex> mlock(mutex_);
+
57 
+
58  while (queue_.empty()) {
+
59  cond_.wait(mlock);
+
60  }
+
61 
+
62  item = queue_.front();
+
63  queue_.pop();
+
64 }
+
65 
+
66 template <typename T>
+
67 void SyncQueue<T>::push(const T &item)
+
68 {
+
69  std::unique_lock<std::mutex> mlock(mutex_);
+
70 
+
71  queue_.push(item);
+
72  mlock.unlock();
+
73  cond_.notify_one();
+
74 }
+
75 
+
76 template <typename T>
+
77 void SyncQueue<T>::push(T &&item)
+
78 {
+
79  std::unique_lock<std::mutex> mlock(mutex_);
+
80 
+
81  queue_.push(std::move(item));
+
82  mlock.unlock();
+
83  cond_.notify_one();
+
84 }
+
85 
+
86 } // namespace yage
SyncQueue()=default
SyncQueue & operator=(const SyncQueue &)=delete
-
T pop()
Definition: syncqueue.h:41
-
void push(const T &item)
Definition: syncqueue.h:68
+
T pop()
Definition: syncqueue.h:40
+
void push(const T &item)
Definition: syncqueue.h:67
-
Definition: syncqueue.h:20
+
Definition: syncqueue.h:19
-- cgit