Migrate libasyncio from boost.signal to signals2 (#8756) master
authorVictor Plage <victor.plage@intra2net.com>
Tue, 16 Jan 2024 16:30:44 +0000 (17:30 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 17 Jan 2024 08:50:24 +0000 (09:50 +0100)
CMakeLists.txt
asyncio/CMakeLists.txt
asyncio/async_io.hpp
asyncio/async_pipe.hpp
asyncio/async_process.hpp
asyncio/async_timer.hpp
asyncio_config.hpp.in.cmake
glue_t2n/CMakeLists.txt
glue_t2n/asyncio_t2n.cpp
glue_t2n/asyncio_t2n.hpp
unittest/test_simpleio_basics.cpp

index a58ffe7..08daf35 100644 (file)
@@ -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()
index d7605b6..e861992 100644 (file)
@@ -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})
index 56e7b3c..eccca7a 100644 (file)
@@ -39,7 +39,7 @@ on this file might be covered by the GNU General Public License.
 
 #include <asyncio_utils.hpp>
 
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
 #include <boost/shared_ptr.hpp>
 
 
@@ -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<void(const std::string&)> signal_received_string;
+        boost::signals2::signal<void(const std::string&)> signal_received_string;
 
     private:
 
@@ -371,7 +371,7 @@ class SimpleIO2 : public IOImplementation2
 
         void sendString(const std::string& data);
 
-        boost::signal<void(const std::string&)> signal_received_string;
+        boost::signals2::signal<void(const std::string&)> signal_received_string;
 
     private:
 
index 00a965e..28e9573 100644 (file)
@@ -41,7 +41,7 @@ class SimplePipe : public IOImplementation
 
       void sendString(const std::string& data);
 
-      boost::signal<void(const std::string&)> signal_received_string;
+      boost::signals2::signal<void(const std::string&)> signal_received_string;
 
    protected:
 
index aed7b20..825f09c 100644 (file)
@@ -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<void(pid_t,int)> m_foreign_child_state_changed_signal;
+      boost::signals2::signal<void(pid_t,int)> m_foreign_child_state_changed_signal;
 
    protected:
 
index ae0154b..974e83d 100644 (file)
@@ -29,7 +29,7 @@ on this file might be covered by the GNU General Public License.
 
 #include "async_io.hpp"
 
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
 
 namespace AsyncIo
 {
@@ -39,8 +39,8 @@ class SimpleTimer : public TimerBase
 {
    public:
 
-      typedef boost::signal<void()>       TimerSignal;
-      typedef boost::signal<void(SimpleTimer*)> TimerSignalP;
+      typedef boost::signals2::signal<void()>       TimerSignal;
+      typedef boost::signals2::signal<void(SimpleTimer*)> TimerSignalP;
 
    public:
 
index 91d6e8c..301551e 100644 (file)
@@ -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
 
index d7f9bc9..00be4e4 100644 (file)
@@ -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)
index 4e20b60..9586ba4 100644 (file)
@@ -29,7 +29,7 @@ on this file might be covered by the GNU General Public License.
 #include <iostream>
 #include <boost/type_traits/is_base_of.hpp>
 #include <boost/static_assert.hpp>
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
 #include <climits>
 #include <logfunc.hpp>
 #include <tracefunc.hpp>
@@ -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);
         }
index 31c796c..adc86a9 100644 (file)
@@ -43,7 +43,7 @@ on this file might be covered by the GNU General Public License.
 #include <pointer_func.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
 
 
 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:
 
index 6de16ee..719d964 100644 (file)
@@ -38,7 +38,7 @@ on this file might be covered by the GNU General Public License.
 #include <asyncio_system_tools.hpp>
 #include <asyncio_containerfunc.hpp>
 
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
 #include <boost/bind.hpp>
 #include <boost/random.hpp>