From f9e63c9d3388b250ecf6c5dbc935d51b1e96b438 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sat, 17 Nov 2012 23:31:26 -0500 Subject: [PATCH] Simplified member_function_pointer declarations. --- .../bound_function_pointer_kernel_1.h | 2 +- dlib/gui_widgets/base_widgets.h | 4 ++-- dlib/gui_widgets/widgets.cpp | 6 +++--- dlib/logger/logger_kernel_1.h | 2 +- dlib/server/server_kernel.cpp | 4 +--- dlib/threads/multithreaded_object_extension.h | 2 +- dlib/threads/thread_pool_extension.h | 6 +++--- dlib/threads/threads_kernel_shared.cpp | 2 +- dlib/threads/threads_kernel_shared.h | 6 +++--- 9 files changed, 16 insertions(+), 18 deletions(-) diff --git a/dlib/bound_function_pointer/bound_function_pointer_kernel_1.h b/dlib/bound_function_pointer/bound_function_pointer_kernel_1.h index 694fed336..d35d18d79 100644 --- a/dlib/bound_function_pointer/bound_function_pointer_kernel_1.h +++ b/dlib/bound_function_pointer/bound_function_pointer_kernel_1.h @@ -42,7 +42,7 @@ namespace dlib typename strip::type* arg4; - typename member_function_pointer::kernel_1a_c mfp; + member_function_pointer mfp; }; // ---------------- diff --git a/dlib/gui_widgets/base_widgets.h b/dlib/gui_widgets/base_widgets.h index 6e0adfb08..27e7e8afd 100644 --- a/dlib/gui_widgets/base_widgets.h +++ b/dlib/gui_widgets/base_widgets.h @@ -2058,7 +2058,7 @@ namespace dlib { auto_mutex M(wm); - member_function_pointer<>::kernel_1a temp; + member_function_pointer<> temp; temp.set(object,event_handler); // if this handler isn't already registered then add it @@ -2144,7 +2144,7 @@ namespace dlib array submenus; unsigned long selected_item; bool submenu_open; - array::kernel_1a> hide_handlers; + array > hide_handlers; // restricted functions popup_menu(popup_menu&); // copy constructor diff --git a/dlib/gui_widgets/widgets.cpp b/dlib/gui_widgets/widgets.cpp index 1279ba001..c179513dd 100644 --- a/dlib/gui_widgets/widgets.cpp +++ b/dlib/gui_widgets/widgets.cpp @@ -5663,11 +5663,11 @@ namespace dlib class image_display_functor { const std::string str; - const member_function_pointer::kernel_1a mfp; + const member_function_pointer mfp; public: image_display_functor ( const std::string& str_, - const member_function_pointer::kernel_1a& mfp_ + const member_function_pointer& mfp_ ) : str(str_), mfp(mfp_) {} @@ -6052,7 +6052,7 @@ namespace dlib auto_mutex lock(m); if (part_names.insert(name).second) { - member_function_pointer::kernel_1a mfp; + member_function_pointer mfp; mfp.set(*this,&image_display::on_part_add); parts_menu.menu().add_menu_item(menu_item_text("Add " + name,impl::image_display_functor(name,mfp))); } diff --git a/dlib/logger/logger_kernel_1.h b/dlib/logger/logger_kernel_1.h index ad27fc234..44494c09d 100644 --- a/dlib/logger/logger_kernel_1.h +++ b/dlib/logger/logger_kernel_1.h @@ -203,7 +203,7 @@ namespace dlib public: typedef member_function_pointer::kernel_1a_c hook_mfp; + const uint64, const char*> hook_mfp; logger ( const char* name_ diff --git a/dlib/server/server_kernel.cpp b/dlib/server/server_kernel.cpp index 84ea2fab2..9e8130e78 100644 --- a/dlib/server/server_kernel.cpp +++ b/dlib/server/server_kernel.cpp @@ -184,9 +184,7 @@ namespace dlib // to report errors back to the user in a very straight forward way. open_listening_socket(); - member_function_pointer<>::kernel_1a mfp; - mfp.set(*this,&server::start_async_helper); - async_start_thread.reset(new thread_function(mfp)); + async_start_thread.reset(new thread_function(make_mfp(*this,&server::start_async_helper))); } // ---------------------------------------------------------------------------------------- diff --git a/dlib/threads/multithreaded_object_extension.h b/dlib/threads/multithreaded_object_extension.h index ce43266ca..90a29e481 100644 --- a/dlib/threads/multithreaded_object_extension.h +++ b/dlib/threads/multithreaded_object_extension.h @@ -126,7 +126,7 @@ namespace dlib void thread_helper( ); - typedef member_function_pointer<>::kernel_1a_c mfp; + typedef member_function_pointer<> mfp; rmutex m_; rsignaler s; diff --git a/dlib/threads/thread_pool_extension.h b/dlib/threads/thread_pool_extension.h index 20cee1384..09ff29351 100644 --- a/dlib/threads/thread_pool_extension.h +++ b/dlib/threads/thread_pool_extension.h @@ -445,9 +445,9 @@ namespace dlib long arg1; long arg2; - member_function_pointer<>::kernel_1a mfp0; - member_function_pointer::kernel_1a mfp1; - member_function_pointer::kernel_1a mfp2; + member_function_pointer<> mfp0; + member_function_pointer mfp1; + member_function_pointer mfp2; bfp_type bfp; shared_ptr function_copy; diff --git a/dlib/threads/threads_kernel_shared.cpp b/dlib/threads/threads_kernel_shared.cpp index a3cbea5e8..51c51e11c 100644 --- a/dlib/threads/threads_kernel_shared.cpp +++ b/dlib/threads/threads_kernel_shared.cpp @@ -127,7 +127,7 @@ namespace dlib reg.m.lock(); const thread_id_type id = get_thread_id(); thread_id_type id_copy; - member_function_pointer<>::kernel_1a mfp; + member_function_pointer<> mfp; // Remove all the member function pointers for this thread from the tree // and call them. diff --git a/dlib/threads/threads_kernel_shared.h b/dlib/threads/threads_kernel_shared.h index 1b8b26aac..87dc0b8b1 100644 --- a/dlib/threads/threads_kernel_shared.h +++ b/dlib/threads/threads_kernel_shared.h @@ -92,7 +92,7 @@ namespace dlib void (T::*handler)() ) { - member_function_pointer<>::kernel_1a mfp, junk_mfp; + member_function_pointer<> mfp, junk_mfp; mfp.set(obj,handler); thread_id_type junk_id; @@ -119,7 +119,7 @@ namespace dlib ) { thread_id_type id = get_thread_id(); - member_function_pointer<>::kernel_1a mfp; + member_function_pointer<> mfp; mfp.set(obj,handler); auto_mutex M(reg.m); @@ -162,7 +162,7 @@ namespace dlib mutex m; binary_search_tree< thread_id_type, - member_function_pointer<>::kernel_1a, + member_function_pointer<>, memory_manager::kernel_2a >::kernel_2a_c reg; };