diff --git a/include/elem_circ.h b/include/elem_circ.h index f318dbf..14bb414 100644 --- a/include/elem_circ.h +++ b/include/elem_circ.h @@ -291,5 +291,11 @@ public: } }; +template +struct prod_cons { + template + using elems_t = elem_array>; +}; + } // namespace circ } // namespace ipc diff --git a/include/ipc.h b/include/ipc.h index 0f273fa..6f3bc8d 100644 --- a/include/ipc.h +++ b/include/ipc.h @@ -138,7 +138,7 @@ public: * (one producer/server/sender to multi consumers/clients/receivers) */ using route = channel_impl + ipc::queue, ipc::circ::prod_cons >>; /* @@ -150,7 +150,7 @@ using route = channel_impl + ipc::queue, ipc::circ::prod_cons >>; } // namespace ipc diff --git a/include/queue.h b/include/queue.h index 6c8a514..5c8d2d5 100644 --- a/include/queue.h +++ b/include/queue.h @@ -19,10 +19,10 @@ namespace ipc { template > + typename Policy = ipc::circ::prod_cons> class queue { public: - using elems_t = circ::elem_array; + using elems_t = typename Policy::template elems_t; using policy_t = typename elems_t::policy_t; private: diff --git a/src/ipc.cpp b/src/ipc.cpp index 14b6a31..b0b044f 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -263,10 +263,10 @@ buff_t channel_detail::recv(handle_t h) { return detail_impl::recv(h); } -template struct channel_detail>; -template struct channel_detail>; -template struct channel_detail>; -template struct channel_detail>; -template struct channel_detail>; +template struct channel_detail>; +template struct channel_detail>; +template struct channel_detail>; +template struct channel_detail>; +template struct channel_detail>; } // namespace ipc