Commit e379fe54 authored by Davis King's avatar Davis King

Minor cleanup

parent 768888ff
...@@ -481,68 +481,6 @@ namespace dlib ...@@ -481,68 +481,6 @@ namespace dlib
ARG4 arg4 ARG4 arg4
); );
// -----------------------------------
template <
typename funct_type
>
friend void bsp_listen (
unsigned short listening_port,
funct_type funct
);
template <
typename funct_type,
typename ARG1
>
friend void bsp_listen (
unsigned short listening_port,
funct_type funct,
ARG1 arg1
);
template <
typename funct_type,
typename ARG1,
typename ARG2
>
friend void bsp_listen (
unsigned short listening_port,
funct_type funct,
ARG1 arg1,
ARG2 arg2
);
template <
typename funct_type,
typename ARG1,
typename ARG2,
typename ARG3
>
friend void bsp_listen (
unsigned short listening_port,
funct_type funct,
ARG1 arg1,
ARG2 arg2,
ARG3 arg3
);
template <
typename funct_type,
typename ARG1,
typename ARG2,
typename ARG3,
typename ARG4
>
friend void bsp_listen (
unsigned short listening_port,
funct_type funct,
ARG1 arg1,
ARG2 arg2,
ARG3 arg3,
ARG4 arg4
);
// ----------------------------------- // -----------------------------------
template < template <
...@@ -741,108 +679,78 @@ namespace dlib ...@@ -741,108 +679,78 @@ namespace dlib
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
typename port_notify_function_type,
typename funct_type typename funct_type
> >
void bsp_listen_dynamic_port ( void bsp_listen (
unsigned short listening_port, unsigned short listening_port,
port_notify_function_type port_notify_function,
funct_type funct funct_type funct
) )
{ {
impl1::map_id_to_con cons; bsp_listen_dynamic_port(listening_port, impl1::null_notify, funct);
unsigned long node_id;
listen_and_connect_all(node_id, cons, listening_port, port_notify_function);
bsp_context obj(node_id, cons);
funct(obj);
obj.close_all_connections_gracefully();
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
typename port_notify_function_type,
typename funct_type, typename funct_type,
typename ARG1 typename ARG1
> >
void bsp_listen_dynamic_port ( void bsp_listen (
unsigned short listening_port, unsigned short listening_port,
port_notify_function_type port_notify_function,
funct_type funct, funct_type funct,
ARG1 arg1 ARG1 arg1
) )
{ {
impl1::map_id_to_con cons; bsp_listen_dynamic_port(listening_port, impl1::null_notify, funct, arg1);
unsigned long node_id;
listen_and_connect_all(node_id, cons, listening_port, port_notify_function);
bsp_context obj(node_id, cons);
funct(obj,arg1);
obj.close_all_connections_gracefully();
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
typename port_notify_function_type,
typename funct_type, typename funct_type,
typename ARG1, typename ARG1,
typename ARG2 typename ARG2
> >
void bsp_listen_dynamic_port ( void bsp_listen (
unsigned short listening_port, unsigned short listening_port,
port_notify_function_type port_notify_function,
funct_type funct, funct_type funct,
ARG1 arg1, ARG1 arg1,
ARG2 arg2 ARG2 arg2
) )
{ {
impl1::map_id_to_con cons; bsp_listen_dynamic_port(listening_port, impl1::null_notify, funct, arg1, arg2);
unsigned long node_id;
listen_and_connect_all(node_id, cons, listening_port, port_notify_function);
bsp_context obj(node_id, cons);
funct(obj,arg1,arg2);
obj.close_all_connections_gracefully();
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
typename port_notify_function_type,
typename funct_type, typename funct_type,
typename ARG1, typename ARG1,
typename ARG2, typename ARG2,
typename ARG3 typename ARG3
> >
void bsp_listen_dynamic_port ( void bsp_listen (
unsigned short listening_port, unsigned short listening_port,
port_notify_function_type port_notify_function,
funct_type funct, funct_type funct,
ARG1 arg1, ARG1 arg1,
ARG2 arg2, ARG2 arg2,
ARG3 arg3 ARG3 arg3
) )
{ {
impl1::map_id_to_con cons; bsp_listen_dynamic_port(listening_port, impl1::null_notify, funct, arg1, arg2, arg3);
unsigned long node_id;
listen_and_connect_all(node_id, cons, listening_port, port_notify_function);
bsp_context obj(node_id, cons);
funct(obj,arg1,arg2,arg3);
obj.close_all_connections_gracefully();
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
typename port_notify_function_type,
typename funct_type, typename funct_type,
typename ARG1, typename ARG1,
typename ARG2, typename ARG2,
typename ARG3, typename ARG3,
typename ARG4 typename ARG4
> >
void bsp_listen_dynamic_port ( void bsp_listen (
unsigned short listening_port, unsigned short listening_port,
port_notify_function_type port_notify_function,
funct_type funct, funct_type funct,
ARG1 arg1, ARG1 arg1,
ARG2 arg2, ARG2 arg2,
...@@ -850,90 +758,115 @@ namespace dlib ...@@ -850,90 +758,115 @@ namespace dlib
ARG4 arg4 ARG4 arg4
) )
{ {
impl1::map_id_to_con cons; bsp_listen_dynamic_port(listening_port, impl1::null_notify, funct, arg1, arg2, arg3, arg4);
unsigned long node_id;
listen_and_connect_all(node_id, cons, listening_port, port_notify_function);
bsp_context obj(node_id, cons);
funct(obj,arg1,arg2,arg3,arg4);
obj.close_all_connections_gracefully();
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
typename port_notify_function_type,
typename funct_type typename funct_type
> >
void bsp_listen ( void bsp_listen_dynamic_port (
unsigned short listening_port, unsigned short listening_port,
port_notify_function_type port_notify_function,
funct_type funct funct_type funct
) )
{ {
bsp_listen_dynamic_port(listening_port, impl1::null_notify, funct); impl1::map_id_to_con cons;
unsigned long node_id;
listen_and_connect_all(node_id, cons, listening_port, port_notify_function);
bsp_context obj(node_id, cons);
funct(obj);
obj.close_all_connections_gracefully();
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
typename port_notify_function_type,
typename funct_type, typename funct_type,
typename ARG1 typename ARG1
> >
void bsp_listen ( void bsp_listen_dynamic_port (
unsigned short listening_port, unsigned short listening_port,
port_notify_function_type port_notify_function,
funct_type funct, funct_type funct,
ARG1 arg1 ARG1 arg1
) )
{ {
bsp_listen_dynamic_port(listening_port, impl1::null_notify, funct, arg1); impl1::map_id_to_con cons;
unsigned long node_id;
listen_and_connect_all(node_id, cons, listening_port, port_notify_function);
bsp_context obj(node_id, cons);
funct(obj,arg1);
obj.close_all_connections_gracefully();
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
typename port_notify_function_type,
typename funct_type, typename funct_type,
typename ARG1, typename ARG1,
typename ARG2 typename ARG2
> >
void bsp_listen ( void bsp_listen_dynamic_port (
unsigned short listening_port, unsigned short listening_port,
port_notify_function_type port_notify_function,
funct_type funct, funct_type funct,
ARG1 arg1, ARG1 arg1,
ARG2 arg2 ARG2 arg2
) )
{ {
bsp_listen_dynamic_port(listening_port, impl1::null_notify, funct, arg1, arg2); impl1::map_id_to_con cons;
unsigned long node_id;
listen_and_connect_all(node_id, cons, listening_port, port_notify_function);
bsp_context obj(node_id, cons);
funct(obj,arg1,arg2);
obj.close_all_connections_gracefully();
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
typename port_notify_function_type,
typename funct_type, typename funct_type,
typename ARG1, typename ARG1,
typename ARG2, typename ARG2,
typename ARG3 typename ARG3
> >
void bsp_listen ( void bsp_listen_dynamic_port (
unsigned short listening_port, unsigned short listening_port,
port_notify_function_type port_notify_function,
funct_type funct, funct_type funct,
ARG1 arg1, ARG1 arg1,
ARG2 arg2, ARG2 arg2,
ARG3 arg3 ARG3 arg3
) )
{ {
bsp_listen_dynamic_port(listening_port, impl1::null_notify, funct, arg1, arg2, arg3); impl1::map_id_to_con cons;
unsigned long node_id;
listen_and_connect_all(node_id, cons, listening_port, port_notify_function);
bsp_context obj(node_id, cons);
funct(obj,arg1,arg2,arg3);
obj.close_all_connections_gracefully();
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
typename port_notify_function_type,
typename funct_type, typename funct_type,
typename ARG1, typename ARG1,
typename ARG2, typename ARG2,
typename ARG3, typename ARG3,
typename ARG4 typename ARG4
> >
void bsp_listen ( void bsp_listen_dynamic_port (
unsigned short listening_port, unsigned short listening_port,
port_notify_function_type port_notify_function,
funct_type funct, funct_type funct,
ARG1 arg1, ARG1 arg1,
ARG2 arg2, ARG2 arg2,
...@@ -941,9 +874,13 @@ namespace dlib ...@@ -941,9 +874,13 @@ namespace dlib
ARG4 arg4 ARG4 arg4
) )
{ {
bsp_listen_dynamic_port(listening_port, impl1::null_notify, funct, arg1, arg2, arg3, arg4); impl1::map_id_to_con cons;
unsigned long node_id;
listen_and_connect_all(node_id, cons, listening_port, port_notify_function);
bsp_context obj(node_id, cons);
funct(obj,arg1,arg2,arg3,arg4);
obj.close_all_connections_gracefully();
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -183,6 +183,77 @@ namespace dlib ...@@ -183,6 +183,77 @@ namespace dlib
ARG4 arg4 ARG4 arg4
); );
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template <
typename funct_type
>
void bsp_listen (
unsigned short listening_port,
funct_type funct
);
// ----------------------------------------------------------------------------------------
template <
typename funct_type,
typename ARG1
>
void bsp_listen (
unsigned short listening_port,
funct_type funct,
ARG1 arg1
);
// ----------------------------------------------------------------------------------------
template <
typename funct_type,
typename ARG1,
typename ARG2
>
void bsp_listen (
unsigned short listening_port,
funct_type funct,
ARG1 arg1,
ARG2 arg2
);
// ----------------------------------------------------------------------------------------
template <
typename funct_type,
typename ARG1,
typename ARG2,
typename ARG3
>
void bsp_listen (
unsigned short listening_port,
funct_type funct,
ARG1 arg1,
ARG2 arg2,
ARG3 arg3
);
// ----------------------------------------------------------------------------------------
template <
typename funct_type,
typename ARG1,
typename ARG2,
typename ARG3,
typename ARG4
>
void bsp_listen (
unsigned short listening_port,
funct_type funct,
ARG1 arg1,
ARG2 arg2,
ARG3 arg3,
ARG4 arg4
);
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
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