From 881b060d1f64df3027861ba39e8e92de78390311 Mon Sep 17 00:00:00 2001 From: mutouyun Date: Wed, 23 Jan 2019 11:44:26 +0800 Subject: [PATCH] refactor --- include/elem_circ.h | 5 +- include/elem_link.h | 5 ++ include/ipc.h | 8 +- include/queue.h | 184 +++++++++++++++++++++++++++++--------------- include/rw_lock.h | 4 +- src/ipc.cpp | 68 ++++++++-------- 6 files changed, 171 insertions(+), 103 deletions(-) diff --git a/include/elem_circ.h b/include/elem_circ.h index 659a323..cfca3ab 100644 --- a/include/elem_circ.h +++ b/include/elem_circ.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "def.h" #include "rw_lock.h" @@ -299,7 +300,7 @@ public: using base_t::cursor; template - bool push(F&& f, P&&...) noexcept { + bool push(F&& f) noexcept { return base_t::push(this, std::forward(f), block_); } @@ -312,6 +313,8 @@ public: template struct prod_cons { + using is_fixed = std::true_type; + template using elems_t = elem_array>; }; diff --git a/include/elem_link.h b/include/elem_link.h index 0f5703c..9148d29 100644 --- a/include/elem_link.h +++ b/include/elem_link.h @@ -10,4 +10,9 @@ namespace ipc { +namespace link { + + + +} // namespace link } // namespace ipc diff --git a/include/ipc.h b/include/ipc.h index 6f3bc8d..e5f1f30 100644 --- a/include/ipc.h +++ b/include/ipc.h @@ -7,14 +7,14 @@ #include "def.h" #include "buffer.h" #include "shm.h" -#include "queue.h" +#include "elem_circ.h" namespace ipc { using handle_t = void*; using buff_t = buffer; -template