Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
b1b73134
Commit
b1b73134
authored
Oct 30, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/PollBackend: add Item constructor
parent
b9b02b4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
PollBackend.cxx
src/event/PollBackend.cxx
+3
-4
PollBackend.hxx
src/event/PollBackend.hxx
+6
-0
No files found.
src/event/PollBackend.cxx
View file @
b1b73134
...
...
@@ -36,10 +36,9 @@ PollBackend::Add(int fd, unsigned events, void *obj) noexcept
e
.
events
=
events
;
e
.
revents
=
0
;
auto
i
=
items
.
emplace
(
fd
,
Item
{}).
first
;
auto
&
item
=
i
->
second
;
item
.
index
=
index
;
item
.
obj
=
obj
;
items
.
emplace
(
std
::
piecewise_construct
,
std
::
forward_as_tuple
(
fd
),
std
::
forward_as_tuple
(
index
,
obj
));
return
true
;
}
...
...
src/event/PollBackend.hxx
View file @
b1b73134
...
...
@@ -34,6 +34,12 @@ class PollBackend
{
std
::
size_t
index
;
void
*
obj
;
constexpr
Item
(
std
::
size_t
_index
,
void
*
_obj
)
noexcept
:
index
(
_index
),
obj
(
_obj
)
{}
Item
(
const
Item
&
)
=
delete
;
Item
&
operator
=
(
const
Item
&
)
=
delete
;
};
std
::
vector
<
pollfd
>
poll_events
;
...
...
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