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
cb901d75
"src/vscode:/vscode.git/clone" did not exist on "9ae117d3cdf8e254f88af56bb09eaec256e26aad"
Commit
cb901d75
authored
Oct 07, 2012
by
Davis King
Browse files
Added an overload of bsp_connect() and bsp_listen() for 4 argument
functions.
parent
ff52f171
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
0 deletions
+121
-0
dlib/bsp/bsp.h
dlib/bsp/bsp.h
+85
-0
dlib/bsp/bsp_abstract.h
dlib/bsp/bsp_abstract.h
+36
-0
No files found.
dlib/bsp/bsp.h
View file @
cb901d75
...
...
@@ -269,6 +269,22 @@ namespace dlib
ARG3
arg3
);
template
<
typename
funct_type
,
typename
ARG1
,
typename
ARG2
,
typename
ARG3
,
typename
ARG4
>
friend
void
bsp_connect
(
const
std
::
vector
<
std
::
pair
<
std
::
string
,
unsigned
short
>
>&
hosts
,
funct_type
&
funct
,
ARG1
arg1
,
ARG2
arg2
,
ARG3
arg3
,
ARG4
arg4
);
// -----------------------------------
template
<
...
...
@@ -315,6 +331,22 @@ namespace dlib
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
);
// -----------------------------------
};
...
...
@@ -409,6 +441,33 @@ namespace dlib
obj
.
close_all_connections_gracefully
();
}
// ----------------------------------------------------------------------------------------
template
<
typename
funct_type
,
typename
ARG1
,
typename
ARG2
,
typename
ARG3
,
typename
ARG4
>
void
bsp_connect
(
const
std
::
vector
<
std
::
pair
<
std
::
string
,
unsigned
short
>
>&
hosts
,
funct_type
&
funct
,
ARG1
arg1
,
ARG2
arg2
,
ARG3
arg3
,
ARG4
arg4
)
{
impl
::
map_id_to_con
cons
;
const
unsigned
long
node_id
=
0
;
connect_all
(
cons
,
hosts
,
node_id
);
send_out_connection_orders
(
cons
,
hosts
);
bsp_context
obj
(
node_id
,
cons
);
funct
(
obj
,
arg1
,
arg2
,
arg3
,
arg4
);
obj
.
close_all_connections_gracefully
();
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
@@ -495,6 +554,32 @@ namespace dlib
obj
.
close_all_connections_gracefully
();
}
// ----------------------------------------------------------------------------------------
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
)
{
impl
::
map_id_to_con
cons
;
unsigned
long
node_id
;
listen_and_connect_all
(
node_id
,
cons
,
listening_port
);
bsp_context
obj
(
node_id
,
cons
);
funct
(
obj
,
arg1
,
arg2
,
arg3
,
arg4
);
obj
.
close_all_connections_gracefully
();
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
dlib/bsp/bsp_abstract.h
View file @
cb901d75
...
...
@@ -160,6 +160,24 @@ namespace dlib
ARG3
arg3
);
// ----------------------------------------------------------------------------------------
template
<
typename
funct_type
,
typename
ARG1
,
typename
ARG2
,
typename
ARG3
,
typename
ARG4
>
void
bsp_connect
(
const
std
::
vector
<
std
::
pair
<
std
::
string
,
unsigned
short
>
>&
hosts
,
funct_type
&
funct
,
ARG1
arg1
,
ARG2
arg2
,
ARG3
arg3
,
ARG4
arg4
);
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
@@ -213,6 +231,24 @@ namespace dlib
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