From 5d2871185a1bdf092ca8f45df7d24fa0750d2a4e Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Tue, 9 Jun 2020 10:10:19 +0200 Subject: [PATCH] Move FastQueue to sf_stream --- core-buffer/test/main.cpp | 1 - {core-buffer => sf-stream}/include/FastQueue.hpp | 0 {core-buffer => sf-stream}/src/FastQueue.cpp | 5 +++-- sf-stream/test/main.cpp | 1 + {core-buffer => sf-stream}/test/test_FastQueue.cpp | 0 5 files changed, 4 insertions(+), 3 deletions(-) rename {core-buffer => sf-stream}/include/FastQueue.hpp (100%) rename {core-buffer => sf-stream}/src/FastQueue.cpp (95%) rename {core-buffer => sf-stream}/test/test_FastQueue.cpp (100%) diff --git a/core-buffer/test/main.cpp b/core-buffer/test/main.cpp index 9dd8358..e379d99 100644 --- a/core-buffer/test/main.cpp +++ b/core-buffer/test/main.cpp @@ -1,7 +1,6 @@ #include "gtest/gtest.h" #include "test_buffer_utils.cpp" #include "test_bitshuffle.cpp" -#include "test_FastQueue.cpp" using namespace std; diff --git a/core-buffer/include/FastQueue.hpp b/sf-stream/include/FastQueue.hpp similarity index 100% rename from core-buffer/include/FastQueue.hpp rename to sf-stream/include/FastQueue.hpp diff --git a/core-buffer/src/FastQueue.cpp b/sf-stream/src/FastQueue.cpp similarity index 95% rename from core-buffer/src/FastQueue.cpp rename to sf-stream/src/FastQueue.cpp index 69cb2c0..1db833e 100644 --- a/core-buffer/src/FastQueue.cpp +++ b/sf-stream/src/FastQueue.cpp @@ -73,7 +73,7 @@ void FastQueue::commit() } write_slot_id_++; - write_slot_id_ = write_slot_id_ % n_slots_; + write_slot_id_ %= n_slots_; } template @@ -100,8 +100,9 @@ void FastQueue::release() } read_slot_id_++; - read_slot_id_ = read_slot_id_ % n_slots_; + read_slot_id_ %= n_slots_; } +template class FastQueue; template class FastQueue; template class FastQueue; diff --git a/sf-stream/test/main.cpp b/sf-stream/test/main.cpp index e1b1b18..e4c5df7 100644 --- a/sf-stream/test/main.cpp +++ b/sf-stream/test/main.cpp @@ -1,5 +1,6 @@ #include "gtest/gtest.h" #include "test_LiveRecvModule.cpp" +#include "test_FastQueue.cpp" using namespace std; diff --git a/core-buffer/test/test_FastQueue.cpp b/sf-stream/test/test_FastQueue.cpp similarity index 100% rename from core-buffer/test/test_FastQueue.cpp rename to sf-stream/test/test_FastQueue.cpp