Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
e379fe54
Commit
e379fe54
authored
Oct 16, 2012
by
Davis King
Browse files
Minor cleanup
parent
768888ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
118 deletions
+126
-118
dlib/bsp/bsp.h
dlib/bsp/bsp.h
+55
-118
dlib/bsp/bsp_abstract.h
dlib/bsp/bsp_abstract.h
+71
-0
No files found.
dlib/bsp/bsp.h
View file @
e379fe54
...
...
@@ -481,68 +481,6 @@ namespace dlib
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
<
...
...
@@ -741,108 +679,78 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
port_notify_function_type
,
typename
funct_type
>
void
bsp_listen
_dynamic_port
(
void
bsp_listen
(
unsigned
short
listening_port
,
port_notify_function_type
port_notify_function
,
funct_type
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
();
bsp_listen_dynamic_port
(
listening_port
,
impl1
::
null_notify
,
funct
);
}
// ----------------------------------------------------------------------------------------
template
<
typename
port_notify_function_type
,
typename
funct_type
,
typename
ARG1
>
void
bsp_listen
_dynamic_port
(
void
bsp_listen
(
unsigned
short
listening_port
,
port_notify_function_type
port_notify_function
,
funct_type
funct
,
ARG1
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
();
bsp_listen_dynamic_port
(
listening_port
,
impl1
::
null_notify
,
funct
,
arg1
);
}
// ----------------------------------------------------------------------------------------
template
<
typename
port_notify_function_type
,
typename
funct_type
,
typename
ARG1
,
typename
ARG2
>
void
bsp_listen
_dynamic_port
(
void
bsp_listen
(
unsigned
short
listening_port
,
port_notify_function_type
port_notify_function
,
funct_type
funct
,
ARG1
arg1
,
ARG2
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
();
bsp_listen_dynamic_port
(
listening_port
,
impl1
::
null_notify
,
funct
,
arg1
,
arg2
);
}
// ----------------------------------------------------------------------------------------
template
<
typename
port_notify_function_type
,
typename
funct_type
,
typename
ARG1
,
typename
ARG2
,
typename
ARG3
>
void
bsp_listen
_dynamic_port
(
void
bsp_listen
(
unsigned
short
listening_port
,
port_notify_function_type
port_notify_function
,
funct_type
funct
,
ARG1
arg1
,
ARG2
arg2
,
ARG3
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
();
bsp_listen_dynamic_port
(
listening_port
,
impl1
::
null_notify
,
funct
,
arg1
,
arg2
,
arg3
);
}
// ----------------------------------------------------------------------------------------
template
<
typename
port_notify_function_type
,
typename
funct_type
,
typename
ARG1
,
typename
ARG2
,
typename
ARG3
,
typename
ARG4
>
void
bsp_listen
_dynamic_port
(
void
bsp_listen
(
unsigned
short
listening_port
,
port_notify_function_type
port_notify_function
,
funct_type
funct
,
ARG1
arg1
,
ARG2
arg2
,
...
...
@@ -850,90 +758,115 @@ namespace dlib
ARG4
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
();
bsp_listen_dynamic_port
(
listening_port
,
impl1
::
null_notify
,
funct
,
arg1
,
arg2
,
arg3
,
arg4
);
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
typename
port_notify_function_type
,
typename
funct_type
>
void
bsp_listen
(
void
bsp_listen
_dynamic_port
(
unsigned
short
listening_port
,
port_notify_function_type
port_notify_function
,
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
<
typename
port_notify_function_type
,
typename
funct_type
,
typename
ARG1
>
void
bsp_listen
(
void
bsp_listen
_dynamic_port
(
unsigned
short
listening_port
,
port_notify_function_type
port_notify_function
,
funct_type
funct
,
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
<
typename
port_notify_function_type
,
typename
funct_type
,
typename
ARG1
,
typename
ARG2
>
void
bsp_listen
(
void
bsp_listen
_dynamic_port
(
unsigned
short
listening_port
,
port_notify_function_type
port_notify_function
,
funct_type
funct
,
ARG1
arg1
,
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
<
typename
port_notify_function_type
,
typename
funct_type
,
typename
ARG1
,
typename
ARG2
,
typename
ARG3
>
void
bsp_listen
(
void
bsp_listen
_dynamic_port
(
unsigned
short
listening_port
,
port_notify_function_type
port_notify_function
,
funct_type
funct
,
ARG1
arg1
,
ARG2
arg2
,
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
<
typename
port_notify_function_type
,
typename
funct_type
,
typename
ARG1
,
typename
ARG2
,
typename
ARG3
,
typename
ARG4
>
void
bsp_listen
(
void
bsp_listen
_dynamic_port
(
unsigned
short
listening_port
,
port_notify_function_type
port_notify_function
,
funct_type
funct
,
ARG1
arg1
,
ARG2
arg2
,
...
...
@@ -941,9 +874,13 @@ namespace dlib
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
();
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
dlib/bsp/bsp_abstract.h
View file @
e379fe54
...
...
@@ -183,6 +183,77 @@ namespace dlib
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
);
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment