Commit f9e63c9d authored by Davis King's avatar Davis King

Simplified member_function_pointer declarations.

parent f0705c93
...@@ -42,7 +42,7 @@ namespace dlib ...@@ -42,7 +42,7 @@ namespace dlib
typename strip<T4>::type* arg4; typename strip<T4>::type* arg4;
typename member_function_pointer<T1,T2,T3,T4>::kernel_1a_c mfp; member_function_pointer<T1,T2,T3,T4> mfp;
}; };
// ---------------- // ----------------
......
...@@ -2058,7 +2058,7 @@ namespace dlib ...@@ -2058,7 +2058,7 @@ namespace dlib
{ {
auto_mutex M(wm); auto_mutex M(wm);
member_function_pointer<>::kernel_1a temp; member_function_pointer<> temp;
temp.set(object,event_handler); temp.set(object,event_handler);
// if this handler isn't already registered then add it // if this handler isn't already registered then add it
...@@ -2144,7 +2144,7 @@ namespace dlib ...@@ -2144,7 +2144,7 @@ namespace dlib
array<popup_menu*> submenus; array<popup_menu*> submenus;
unsigned long selected_item; unsigned long selected_item;
bool submenu_open; bool submenu_open;
array<member_function_pointer<>::kernel_1a> hide_handlers; array<member_function_pointer<> > hide_handlers;
// restricted functions // restricted functions
popup_menu(popup_menu&); // copy constructor popup_menu(popup_menu&); // copy constructor
......
...@@ -5663,11 +5663,11 @@ namespace dlib ...@@ -5663,11 +5663,11 @@ namespace dlib
class image_display_functor class image_display_functor
{ {
const std::string str; const std::string str;
const member_function_pointer<const std::string&>::kernel_1a mfp; const member_function_pointer<const std::string&> mfp;
public: public:
image_display_functor ( image_display_functor (
const std::string& str_, const std::string& str_,
const member_function_pointer<const std::string&>::kernel_1a& mfp_ const member_function_pointer<const std::string&>& mfp_
) : str(str_), ) : str(str_),
mfp(mfp_) mfp(mfp_)
{} {}
...@@ -6052,7 +6052,7 @@ namespace dlib ...@@ -6052,7 +6052,7 @@ namespace dlib
auto_mutex lock(m); auto_mutex lock(m);
if (part_names.insert(name).second) if (part_names.insert(name).second)
{ {
member_function_pointer<const std::string&>::kernel_1a mfp; member_function_pointer<const std::string&> mfp;
mfp.set(*this,&image_display::on_part_add); 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))); parts_menu.menu().add_menu_item(menu_item_text("Add " + name,impl::image_display_functor(name,mfp)));
} }
......
...@@ -203,7 +203,7 @@ namespace dlib ...@@ -203,7 +203,7 @@ namespace dlib
public: public:
typedef member_function_pointer<const std::string&, const log_level&, typedef member_function_pointer<const std::string&, const log_level&,
const uint64, const char*>::kernel_1a_c hook_mfp; const uint64, const char*> hook_mfp;
logger ( logger (
const char* name_ const char* name_
......
...@@ -184,9 +184,7 @@ namespace dlib ...@@ -184,9 +184,7 @@ namespace dlib
// to report errors back to the user in a very straight forward way. // to report errors back to the user in a very straight forward way.
open_listening_socket(); open_listening_socket();
member_function_pointer<>::kernel_1a mfp; async_start_thread.reset(new thread_function(make_mfp(*this,&server::start_async_helper)));
mfp.set(*this,&server::start_async_helper);
async_start_thread.reset(new thread_function(mfp));
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -126,7 +126,7 @@ namespace dlib ...@@ -126,7 +126,7 @@ namespace dlib
void thread_helper( void thread_helper(
); );
typedef member_function_pointer<>::kernel_1a_c mfp; typedef member_function_pointer<> mfp;
rmutex m_; rmutex m_;
rsignaler s; rsignaler s;
......
...@@ -445,9 +445,9 @@ namespace dlib ...@@ -445,9 +445,9 @@ namespace dlib
long arg1; long arg1;
long arg2; long arg2;
member_function_pointer<>::kernel_1a mfp0; member_function_pointer<> mfp0;
member_function_pointer<long>::kernel_1a mfp1; member_function_pointer<long> mfp1;
member_function_pointer<long,long>::kernel_1a mfp2; member_function_pointer<long,long> mfp2;
bfp_type bfp; bfp_type bfp;
shared_ptr<function_object_copy> function_copy; shared_ptr<function_object_copy> function_copy;
......
...@@ -127,7 +127,7 @@ namespace dlib ...@@ -127,7 +127,7 @@ namespace dlib
reg.m.lock(); reg.m.lock();
const thread_id_type id = get_thread_id(); const thread_id_type id = get_thread_id();
thread_id_type id_copy; 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 // Remove all the member function pointers for this thread from the tree
// and call them. // and call them.
......
...@@ -92,7 +92,7 @@ namespace dlib ...@@ -92,7 +92,7 @@ namespace dlib
void (T::*handler)() void (T::*handler)()
) )
{ {
member_function_pointer<>::kernel_1a mfp, junk_mfp; member_function_pointer<> mfp, junk_mfp;
mfp.set(obj,handler); mfp.set(obj,handler);
thread_id_type junk_id; thread_id_type junk_id;
...@@ -119,7 +119,7 @@ namespace dlib ...@@ -119,7 +119,7 @@ namespace dlib
) )
{ {
thread_id_type id = get_thread_id(); thread_id_type id = get_thread_id();
member_function_pointer<>::kernel_1a mfp; member_function_pointer<> mfp;
mfp.set(obj,handler); mfp.set(obj,handler);
auto_mutex M(reg.m); auto_mutex M(reg.m);
...@@ -162,7 +162,7 @@ namespace dlib ...@@ -162,7 +162,7 @@ namespace dlib
mutex m; mutex m;
binary_search_tree< binary_search_tree<
thread_id_type, thread_id_type,
member_function_pointer<>::kernel_1a, member_function_pointer<>,
memory_manager<char>::kernel_2a memory_manager<char>::kernel_2a
>::kernel_2a_c reg; >::kernel_2a_c reg;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment