]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
msg/async: refine worker creation in NetworkStack 38415/head
authorInsu Jang <insu_jang@tmax.co.kr>
Thu, 3 Dec 2020 02:09:25 +0000 (11:09 +0900)
committerInsu Jang <insu_jang@tmax.co.kr>
Thu, 3 Dec 2020 02:47:46 +0000 (11:47 +0900)
commitff65c800b3e1f3f7e3989223b9bde4cbbaf5c076
treee4c2d3fafddde5eff3f32b00628e67d509dcd1d1
parent84d50e7d63df0ee25e607ae729bd64fd7a648c77
msg/async: refine worker creation in NetworkStack

This commit updates NetworkStack::create_worker() to a virtual
function to reduce type check redundancy.

Since calling a pure virtual function in a constructor method is
strictly prohibited, NetworkStack::create_worker() is currently
not implemented as a virtual function.
It requires duplicated type check with NetworkStack::create(),
making the code a little bit tricky.

Considering NetworkStack instances can only be instantiated
through NetworkStack::create(), this commit moves worker creation
out of its constructor to NetworkStack::create(), makes it a pure
virtual, and lets inherited classes implement it to remove the
type check redundancy. By making it a non-static, we can also
reduce unnecessary class member function exposure.

Signed-off-by: Insu Jang <insu_jang@tmax.co.kr>
src/msg/async/PosixStack.h
src/msg/async/Stack.cc
src/msg/async/Stack.h
src/msg/async/dpdk/DPDKStack.h
src/msg/async/rdma/RDMAStack.h