-
Notifications
You must be signed in to change notification settings - Fork 7
Add kqueue context #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pandazxx
wants to merge
9
commits into
bemanproject:main
Choose a base branch
from
pandazxx:dev/kqueue
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+472
−10
Open
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9609861
Finish coding of kqueue_context
pandazxx ff45cad
Cleaning up
pandazxx e47bd38
Update include/beman/net/detail/basic_socket_acceptor.hpp
pandazxx 830c966
Add conditional compilation
pandazxx f88f85e
Fix CI error, replace CheckIncludeFile with CheckIncludeFileCXX
pandazxx bd2bb46
Update execution library to latest version
pandazxx 9b3bbe2
Fix Clang 15 compile error
pandazxx 2a2bb54
Move static filters to member variables
pandazxx 448da9e
Fix problems from review feedback
pandazxx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,8 +4,11 @@ | |
| #ifndef INCLUDED_BEMAN_NET_DETAIL_CONTAINER | ||
| #define INCLUDED_BEMAN_NET_DETAIL_CONTAINER | ||
|
|
||
| #include <algorithm> | ||
| #include <beman/net/detail/netfwd.hpp> | ||
| #include <cstddef> | ||
| #include <iterator> | ||
| #include <optional> | ||
| #include <variant> | ||
| #include <vector> | ||
|
|
||
|
|
@@ -28,6 +31,10 @@ class beman::net::detail::container { | |
| auto insert(Record r) -> ::beman::net::detail::socket_id; | ||
| auto erase(::beman::net::detail::socket_id id) -> void; | ||
| auto operator[](::beman::net::detail::socket_id id) -> Record&; | ||
| // using iterator = decltype(records)::iterator; | ||
| // auto begin() -> iterator; | ||
| // auto end() -> iterator; | ||
|
Comment on lines
+34
to
+36
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these declarations should either be included and appropriately defined or removed. |
||
| auto find(const Record& r) -> ::std::optional<::beman::net::detail::socket_id>; | ||
| }; | ||
|
|
||
| // ---------------------------------------------------------------------------- | ||
|
|
@@ -55,6 +62,19 @@ inline auto beman::net::detail::container<Record>::operator[](::beman::net::deta | |
| return ::std::get<1>(this->records[::std::size_t(id)]); | ||
| } | ||
|
|
||
| template <typename Record> | ||
| inline auto ::beman::net::detail::container<Record>::find(const Record& r) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This member function can be |
||
| -> ::std::optional<::beman::net::detail::socket_id> { | ||
| auto it = ::std::find_if(records.begin(), records.end(), [&](auto& l) { | ||
| return ::std::holds_alternative<Record>(l) && ::std::get<Record>(l) == r; | ||
| }); | ||
|
|
||
| if (it == records.end()) { | ||
| return {}; | ||
| } | ||
| return {::beman::net::detail::socket_id(::std::distance(records.begin(), it))}; | ||
| } | ||
|
|
||
| // ---------------------------------------------------------------------------- | ||
|
|
||
| #endif | ||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.