Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
cb901d75
Commit
cb901d75
authored
Oct 07, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an overload of bsp_connect() and bsp_listen() for 4 argument
functions.
parent
ff52f171
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
0 deletions
+121
-0
bsp.h
dlib/bsp/bsp.h
+85
-0
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