From: Victor Plage Date: Tue, 16 Jan 2024 16:30:44 +0000 (+0100) Subject: Migrate libasyncio from boost.signal to signals2 (#8756) X-Git-Url: http://developer.intra2net.com/git/?p=libasyncio;a=commitdiff_plain;h=HEAD Migrate libasyncio from boost.signal to signals2 (#8756) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a58ffe7..08daf35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ else(WITH_LIBI2NCOMMON) message(STATUS "[!] Building *without* libi2ncommon support. [!]") endif(WITH_LIBI2NCOMMON) -find_package(Boost 1.34 REQUIRED COMPONENTS signals unit_test_framework) +find_package(Boost 1.34 REQUIRED COMPONENTS unit_test_framework) include_directories(${Boost_INCLUDE_DIRS}) option(WITH_LIBT2N "Build with libt2n support" OFF) @@ -83,9 +83,6 @@ include(CheckIncludeFiles) if(Boost_FOUND) set(HAVE_BOOST 1) endif() -if(Boost_SIGNALS_FOUND) - set(HAVE_BOOST_SIGNALS 1) -endif() if(Boost_UNIT_TEST_FRAMEWORK_FOUND) set(HAVE_BOOST_UNIT_TEST_FRAMEWORK 1) endif() diff --git a/asyncio/CMakeLists.txt b/asyncio/CMakeLists.txt index d7605b6..e861992 100644 --- a/asyncio/CMakeLists.txt +++ b/asyncio/CMakeLists.txt @@ -33,8 +33,8 @@ set_target_properties(libasyncio-static PROPERTIES OUTPUT_NAME asyncio) set_target_properties(libasyncio-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) # Dependencies -target_link_libraries(libasyncio ${LIBI2NCOMMON_LIBRARIES} ${Boost_SIGNALS_LIBRARIES}) -target_link_libraries(libasyncio-static ${LIBI2NCOMMON_LIBRARIES} ${Boost_SIGNALS_LIBRARIES}) +target_link_libraries(libasyncio ${LIBI2NCOMMON_LIBRARIES}) +target_link_libraries(libasyncio-static ${LIBI2NCOMMON_LIBRARIES}) # Headerlist foreach(header_file_in ${libasyncio_HEADERS}) diff --git a/asyncio/async_io.hpp b/asyncio/async_io.hpp index 56e7b3c..eccca7a 100644 --- a/asyncio/async_io.hpp +++ b/asyncio/async_io.hpp @@ -39,7 +39,7 @@ on this file might be covered by the GNU General Public License. #include -#include +#include #include @@ -204,7 +204,7 @@ class FilterNull : public FilterBase * interfaces and which to keep hidden. */ class IOImplementation -: public boost::signals::trackable +: public boost::signals2::trackable , virtual public Utils::SharedBase { friend class Backend; @@ -214,13 +214,13 @@ class IOImplementation typedef std::list< FilterBasePtr > FilterChain; - typedef boost::signal< void() > SignalType; + typedef boost::signals2::signal< void() > SignalType; typedef boost::shared_ptr< IOImplementation > PtrType; public: IOImplementation(int read_fd=-1, int write_fd=-1); - virtual ~IOImplementation(); //lint !e1509 // boost::signals::trackable is not virtual + virtual ~IOImplementation(); //lint !e1509 // boost::signals2::signals::trackable is not virtual virtual void close(Direction direction = Direction::both); @@ -349,7 +349,7 @@ class SimpleIO : public IOImplementation void sendString(const std::string& data); - boost::signal signal_received_string; + boost::signals2::signal signal_received_string; private: @@ -371,7 +371,7 @@ class SimpleIO2 : public IOImplementation2 void sendString(const std::string& data); - boost::signal signal_received_string; + boost::signals2::signal signal_received_string; private: diff --git a/asyncio/async_pipe.hpp b/asyncio/async_pipe.hpp index 00a965e..28e9573 100644 --- a/asyncio/async_pipe.hpp +++ b/asyncio/async_pipe.hpp @@ -41,7 +41,7 @@ class SimplePipe : public IOImplementation void sendString(const std::string& data); - boost::signal signal_received_string; + boost::signals2::signal signal_received_string; protected: diff --git a/asyncio/async_process.hpp b/asyncio/async_process.hpp index aed7b20..825f09c 100644 --- a/asyncio/async_process.hpp +++ b/asyncio/async_process.hpp @@ -193,7 +193,7 @@ class ProcessManager : public TimerBase * Another module which forks child processes can connect to this signal to receive * the information when these child processes are terminated. */ - boost::signal m_foreign_child_state_changed_signal; + boost::signals2::signal m_foreign_child_state_changed_signal; protected: diff --git a/asyncio/async_timer.hpp b/asyncio/async_timer.hpp index ae0154b..974e83d 100644 --- a/asyncio/async_timer.hpp +++ b/asyncio/async_timer.hpp @@ -29,7 +29,7 @@ on this file might be covered by the GNU General Public License. #include "async_io.hpp" -#include +#include namespace AsyncIo { @@ -39,8 +39,8 @@ class SimpleTimer : public TimerBase { public: - typedef boost::signal TimerSignal; - typedef boost::signal TimerSignalP; + typedef boost::signals2::signal TimerSignal; + typedef boost::signals2::signal TimerSignalP; public: diff --git a/asyncio_config.hpp.in.cmake b/asyncio_config.hpp.in.cmake index 91d6e8c..301551e 100644 --- a/asyncio_config.hpp.in.cmake +++ b/asyncio_config.hpp.in.cmake @@ -3,9 +3,6 @@ /* define if the Boost library is available */ #cmakedefine HAVE_BOOST -/* define if the Boost::Signals library is available */ -#cmakedefine HAVE_BOOST_SIGNALS - /* define if the Boost::Unit_Test_Framework library is available */ #cmakedefine HAVE_BOOST_UNIT_TEST_FRAMEWORK diff --git a/glue_t2n/CMakeLists.txt b/glue_t2n/CMakeLists.txt index d7f9bc9..00be4e4 100644 --- a/glue_t2n/CMakeLists.txt +++ b/glue_t2n/CMakeLists.txt @@ -18,8 +18,8 @@ set_target_properties(libasyncio_t2n-static PROPERTIES OUTPUT_NAME asyncio_t2n) set_target_properties(libasyncio_t2n-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) # Dependencies -target_link_libraries(libasyncio_t2n libasyncio ${LIBT2N_LIBRARIES} ${LIBI2NCOMMON_LIBRARIES} ${Boost_SIGNALS_LIBRARIES}) -target_link_libraries(libasyncio_t2n-static libasyncio ${LIBT2N_LIBRARIES} ${LIBI2NCOMMON_LIBRARIES} ${Boost_SIGNALS_LIBRARIES}) +target_link_libraries(libasyncio_t2n libasyncio ${LIBT2N_LIBRARIES} ${LIBI2NCOMMON_LIBRARIES}) +target_link_libraries(libasyncio_t2n-static libasyncio ${LIBT2N_LIBRARIES} ${LIBI2NCOMMON_LIBRARIES}) # Installation install(TARGETS libasyncio_t2n LIBRARY DESTINATION lib) diff --git a/glue_t2n/asyncio_t2n.cpp b/glue_t2n/asyncio_t2n.cpp index 4e20b60..9586ba4 100644 --- a/glue_t2n/asyncio_t2n.cpp +++ b/glue_t2n/asyncio_t2n.cpp @@ -29,7 +29,7 @@ on this file might be covered by the GNU General Public License. #include #include #include -#include +#include #include #include #include @@ -81,14 +81,14 @@ class IOExportWrapperBase return std::string(); } - virtual boost::signals::connection connectEof( const boost::function< void() >& func ) + virtual boost::signals2::connection connectEof( const boost::function< void() >& func ) { - return boost::signals::connection(); + return boost::signals2::connection(); } - virtual boost::signals::connection connectRead( const boost::function< void() >& func ) + virtual boost::signals2::connection connectRead( const boost::function< void() >& func ) { - return boost::signals::connection(); + return boost::signals2::connection(); } }; // eo class IOExportWrapperBase @@ -185,7 +185,7 @@ class IOExportWrapper * @param func the function which should be connected to the eof signal. * @return signal connection handle. */ - virtual boost::signals::connection connectEof( const boost::function< void() >& func ) + virtual boost::signals2::connection connectEof( const boost::function< void() >& func ) { return IOClass::m_signal_eof.connect(func); } @@ -195,7 +195,7 @@ class IOExportWrapper * @param func the function which should be connected to the "read" signal. * @return signal connection handle. */ - virtual boost::signals::connection connectRead( const boost::function< void() >& func ) + virtual boost::signals2::connection connectRead( const boost::function< void() >& func ) { return IOClass::m_signal_read.connect(func); } diff --git a/glue_t2n/asyncio_t2n.hpp b/glue_t2n/asyncio_t2n.hpp index 31c796c..adc86a9 100644 --- a/glue_t2n/asyncio_t2n.hpp +++ b/glue_t2n/asyncio_t2n.hpp @@ -43,7 +43,7 @@ on this file might be covered by the GNU General Public License. #include #include #include -#include +#include namespace AsyncIo @@ -185,7 +185,7 @@ class T2NServerBase public: - boost::signal< void() > m_signal_client_got_new_data; + boost::signals2::signal< void() > m_signal_client_got_new_data; protected: diff --git a/unittest/test_simpleio_basics.cpp b/unittest/test_simpleio_basics.cpp index 6de16ee..719d964 100644 --- a/unittest/test_simpleio_basics.cpp +++ b/unittest/test_simpleio_basics.cpp @@ -38,7 +38,7 @@ on this file might be covered by the GNU General Public License. #include #include -#include +#include #include #include