initial implementation
This commit is contained in:
commit
487f516a3f
5 changed files with 402 additions and 0 deletions
14
src/callback/CMakeLists.txt
Normal file
14
src/callback/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# callback/CMakeLists.txt
|
||||
|
||||
set(SELF_LIB callback)
|
||||
set(SELF_SRCS CallbackSet.cpp)
|
||||
|
||||
# reminder: can't be header-only library, because depends on non-header-only refcnt
|
||||
xo_add_shared_library(${SELF_LIB} ${PROJECT_VERSION} 1 ${SELF_SRCS})
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# external dependencies:
|
||||
|
||||
xo_dependency(${SELF_LIB} refcnt)
|
||||
|
||||
# end CMakeLists.txt
|
||||
22
src/callback/CallbackSet.cpp
Normal file
22
src/callback/CallbackSet.cpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/* file CallbackSet.cpp
|
||||
*
|
||||
* author: Roland Conybeare, Sep 2022
|
||||
*/
|
||||
|
||||
#include "CallbackSet.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace fn {
|
||||
CallbackId
|
||||
CallbackId::generate()
|
||||
{
|
||||
static CallbackId s_last_id;
|
||||
|
||||
s_last_id = CallbackId(s_last_id.id() + 1);
|
||||
|
||||
return s_last_id;
|
||||
} /*generate*/
|
||||
} /*namespace fn*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end CallbackSet.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue