Tervel  1.0.0
A collection of wait-free containers and algorithms.
linux_API.h
Go to the documentation of this file.
1 #ifndef LINUX_API_H_
2 #define LINUX_API_H_
3 
4 #include "linux_buffer/lockfree_rb_q.cc"
5 
6 template<class T>
7 class TestClass {
8  public:
9  TestClass(size_t capacity, size_t num_threads)
10  : buff_(new LockFreeQueue<T>(num_threads, num_threads, capacity)) {}
11 
12  char * name() {
13  return "Linux Buffer";
14  }
15  bool enqueue(T value) {
16  buff_->push(value);
17  return true;
18  };
19 
20  bool dequeue(T &val) {
21  val = buff_->pop();
22  return true;
23  };
24 
25  void attach_thread() {
26  return;
27  };
28 
29  void detach_thread() {
30  return;
31  };
32 
33  private:
34  LockFreeQueue<T> *buff_;
35 };
36 
37 #endif // LINUX_API_H_
void detach_thread()
Definition: linux_API.h:29
LockFreeQueue< T > * buff_
Definition: linux_API.h:31
TestClass(size_t capacity, size_t num_threads)
Definition: linux_API.h:9
bool dequeue(T &val)
Definition: linux_API.h:20
void attach_thread()
Definition: linux_API.h:25
Definition: blank_api.h:31
bool enqueue(T value)
Definition: linux_API.h:15
char * name()
Definition: linux_API.h:12