Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lehrstuhl für Informatik 4 (Systemsoftware)
manycore
emper
Commits
27648ede
Commit
27648ede
authored
4 years ago
by
Florian Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[IO] define methods and functions implemented in header files as inline
parent
c854aa6e
No related branches found
No related tags found
No related merge requests found
Pipeline
#53903
failed
4 years ago
Stage: smoke-test
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
emper/io.hpp
+12
-12
12 additions, 12 deletions
emper/io.hpp
emper/io/Future.hpp
+2
-2
2 additions, 2 deletions
emper/io/Future.hpp
emper/io/IoContext.hpp
+3
-3
3 additions, 3 deletions
emper/io/IoContext.hpp
with
17 additions
and
17 deletions
emper/io.hpp
+
12
−
12
View file @
27648ede
...
...
@@ -33,7 +33,7 @@ namespace emper::io {
*
* @return Future object which signals the completion of the recv request
*/
auto
recv
(
int
socket
,
void
*
buffer
,
size_t
length
,
int
flags
)
->
std
::
unique_ptr
<
Future
>
{
inline
auto
recv
(
int
socket
,
void
*
buffer
,
size_t
length
,
int
flags
)
->
std
::
unique_ptr
<
Future
>
{
IoContext
*
io
=
IoContext
::
getCurrentIo
();
return
io
->
recv
(
socket
,
buffer
,
length
,
flags
);
}
...
...
@@ -51,7 +51,7 @@ auto recv(int socket, void *buffer, size_t length, int flags) -> std::unique_ptr
* @return -1 on error, 0 when receiving from a closed socket, otherwise the received bytes
*/
auto
recv_and_wait
(
int
socket
,
void
*
buffer
,
size_t
length
,
int
flags
)
->
ssize_t
{
inline
auto
recv_and_wait
(
int
socket
,
void
*
buffer
,
size_t
length
,
int
flags
)
->
ssize_t
{
IoContext
*
io
=
IoContext
::
getCurrentIo
();
return
io
->
recv_and_wait
(
socket
,
buffer
,
length
,
flags
);
}
...
...
@@ -71,7 +71,7 @@ auto recv_and_wait(int socket, void *buffer, size_t length, int flags) -> ssize_
*
* @return Future object which signals the completion of the send request
*/
auto
send
(
int
socket
,
const
void
*
buffer
,
size_t
length
,
int
flags
,
bool
send_all
=
true
)
inline
auto
send
(
int
socket
,
const
void
*
buffer
,
size_t
length
,
int
flags
,
bool
send_all
=
true
)
->
std
::
unique_ptr
<
Future
>
{
IoContext
*
io
=
IoContext
::
getCurrentIo
();
return
io
->
send
(
socket
,
buffer
,
length
,
flags
,
send_all
);
...
...
@@ -92,7 +92,7 @@ auto send(int socket, const void *buffer, size_t length, int flags, bool send_al
*
* @return -1 on error, otherwise the number of sent bytes
*/
auto
send_and_wait
(
int
socket
,
const
void
*
buffer
,
size_t
length
,
int
flags
,
bool
send_all
=
true
)
inline
auto
send_and_wait
(
int
socket
,
const
void
*
buffer
,
size_t
length
,
int
flags
,
bool
send_all
=
true
)
->
ssize_t
{
IoContext
*
io
=
IoContext
::
getCurrentIo
();
return
io
->
send_and_wait
(
socket
,
buffer
,
length
,
flags
,
send_all
);
...
...
@@ -116,7 +116,7 @@ auto send_and_wait(int socket, const void *buffer, size_t length, int flags, boo
*
* @return Future object which signals the completion of the connect request
*/
auto
connect
(
int
socket
,
const
struct
sockaddr
*
address
,
socklen_t
address_len
)
inline
auto
connect
(
int
socket
,
const
struct
sockaddr
*
address
,
socklen_t
address_len
)
->
std
::
unique_ptr
<
Future
>
{
IoContext
*
io
=
IoContext
::
getCurrentIo
();
return
io
->
connect
(
socket
,
address
,
address_len
);
...
...
@@ -140,7 +140,7 @@ auto connect(int socket, const struct sockaddr *address, socklen_t address_len)
*
* @return -1 on error, 0 otherwise
*/
auto
connect_and_wait
(
int
socket
,
const
struct
sockaddr
*
address
,
socklen_t
address_len
)
->
int
{
inline
auto
connect_and_wait
(
int
socket
,
const
struct
sockaddr
*
address
,
socklen_t
address_len
)
->
int
{
IoContext
*
io
=
IoContext
::
getCurrentIo
();
return
io
->
connect_and_wait
(
socket
,
address
,
address_len
);
}
...
...
@@ -167,7 +167,7 @@ auto connect_and_wait(int socket, const struct sockaddr *address, socklen_t addr
*
* @return Future object which signals the completion of the accept request
*/
auto
accept
(
int
socket
,
struct
sockaddr
*
address
,
socklen_t
*
address_len
)
inline
auto
accept
(
int
socket
,
struct
sockaddr
*
address
,
socklen_t
*
address_len
)
->
std
::
unique_ptr
<
Future
>
{
IoContext
*
io
=
IoContext
::
getCurrentIo
();
return
io
->
accept
(
socket
,
address
,
address_len
);
...
...
@@ -195,7 +195,7 @@ auto accept(int socket, struct sockaddr *address, socklen_t *address_len)
*
* @return -1 on error, otherwise the non-negative file descriptor of the accepted socket.
*/
auto
accept_and_wait
(
int
socket
,
struct
sockaddr
*
address
,
socklen_t
*
address_len
)
->
int
{
inline
auto
accept_and_wait
(
int
socket
,
struct
sockaddr
*
address
,
socklen_t
*
address_len
)
->
int
{
IoContext
*
io
=
IoContext
::
getCurrentIo
();
return
io
->
accept_and_wait
(
socket
,
address
,
address_len
);
}
...
...
@@ -215,7 +215,7 @@ auto accept_and_wait(int socket, struct sockaddr *address, socklen_t *address_le
*
* @return Future object which signals the completion of the read request
*/
auto
read_file
(
int
fildes
,
void
*
buf
,
size_t
nbyte
,
off_t
offset
=
0
,
bool
read_all
=
false
)
inline
auto
read_file
(
int
fildes
,
void
*
buf
,
size_t
nbyte
,
off_t
offset
=
0
,
bool
read_all
=
false
)
->
std
::
unique_ptr
<
Future
>
{
IoContext
*
io
=
IoContext
::
getCurrentIo
();
return
io
->
read_file
(
fildes
,
buf
,
nbyte
,
offset
,
read_all
);
...
...
@@ -236,7 +236,7 @@ auto read_file(int fildes, void *buf, size_t nbyte, off_t offset = 0, bool read_
*
* @return -1 on error, otherwise the number of bytes read
*/
auto
read_file_and_wait
(
int
fildes
,
void
*
buf
,
size_t
nbyte
,
off_t
offset
=
0
,
inline
auto
read_file_and_wait
(
int
fildes
,
void
*
buf
,
size_t
nbyte
,
off_t
offset
=
0
,
bool
read_all
=
false
)
->
ssize_t
{
IoContext
*
io
=
IoContext
::
getCurrentIo
();
return
io
->
read_file_and_wait
(
fildes
,
buf
,
nbyte
,
offset
,
read_all
);
...
...
@@ -260,7 +260,7 @@ auto read_file_and_wait(int fildes, void *buf, size_t nbyte, off_t offset = 0,
*
* @return Future object which signals the completion of the write request
*/
auto
write_file
(
int
fildes
,
const
void
*
buf
,
size_t
nbyte
,
off_t
offset
=
0
,
bool
write_all
=
true
)
inline
auto
write_file
(
int
fildes
,
const
void
*
buf
,
size_t
nbyte
,
off_t
offset
=
0
,
bool
write_all
=
true
)
->
std
::
unique_ptr
<
Future
>
{
IoContext
*
io
=
IoContext
::
getCurrentIo
();
return
io
->
write_file
(
fildes
,
buf
,
nbyte
,
offset
,
write_all
);
...
...
@@ -284,7 +284,7 @@ auto write_file(int fildes, const void *buf, size_t nbyte, off_t offset = 0, boo
*
* @return -1 on error, otherwise the number of bytes written
*/
auto
write_file_and_wait
(
int
fildes
,
const
void
*
buf
,
size_t
nbyte
,
off_t
offset
=
0
,
inline
auto
write_file_and_wait
(
int
fildes
,
const
void
*
buf
,
size_t
nbyte
,
off_t
offset
=
0
,
bool
write_all
=
false
)
->
ssize_t
{
IoContext
*
io
=
IoContext
::
getCurrentIo
();
return
io
->
write_file_and_wait
(
fildes
,
buf
,
nbyte
,
offset
,
write_all
);
...
...
This diff is collapsed.
Click to expand it.
emper/io/Future.hpp
+
2
−
2
View file @
27648ede
...
...
@@ -160,7 +160,7 @@ class Future : public Logger<LogSubsystem::IO> {
* @brief Equivalent to calling wait() after calling submit()
*/
template
<
CallerEnvironment
callerEnvironment
=
CallerEnvironment
::
EMPER
>
auto
submit_and_wait
()
->
size_t
{
inline
auto
submit_and_wait
()
->
size_t
{
submit
<
callerEnvironment
>
();
return
wait
();
}
...
...
@@ -169,7 +169,7 @@ class Future : public Logger<LogSubsystem::IO> {
* @brief Equivalent to calling wait(partial_completion) after calling submit()
*/
template
<
CallerEnvironment
callerEnvironment
=
CallerEnvironment
::
EMPER
>
auto
submit_and_wait
(
ssize_t
&
partial_completion
)
->
size_t
{
inline
auto
submit_and_wait
(
ssize_t
&
partial_completion
)
->
size_t
{
submit
<
callerEnvironment
>
();
return
wait
(
partial_completion
);
}
...
...
This diff is collapsed.
Click to expand it.
emper/io/IoContext.hpp
+
3
−
3
View file @
27648ede
...
...
@@ -51,7 +51,7 @@ class IoContext : public Logger<LogSubsystem::IO> {
public:
SubmitActor
(
IoContext
&
c
,
Runtime
&
runtime
)
:
Actor
(
runtime
),
io
(
c
)
{}
void
stop
()
{
Actor
::
stop
();
}
inline
void
stop
()
{
Actor
::
stop
();
}
};
/* Actor submitting Futures into the io_uring_sq */
...
...
@@ -80,8 +80,8 @@ class IoContext : public Logger<LogSubsystem::IO> {
IoContext
(
Runtime
&
runtime
)
:
IoContext
(
runtime
,
EMPER_IO_URING_ENTRIES
){};
~
IoContext
();
static
auto
getCurrentIo
()
->
IoContext
*
{
return
currentIo
;
}
void
setCurrentIo
()
{
currentIo
=
this
;
}
static
inline
auto
getCurrentIo
()
->
IoContext
*
{
return
currentIo
;
}
inline
void
setCurrentIo
()
{
currentIo
=
this
;
}
/**
* @brief Request a recv operation mimicking POSIX recv(3) from this IoContext
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment