-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing methods attributes/specifiers to util namespace
Linked: #171
- Loading branch information
1 parent
9788234
commit 4354a3c
Showing
36 changed files
with
323 additions
and
295 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -52,7 +52,7 @@ namespace ecstasy::integration::user_action | |
/// @author Andréas Leroux ([email protected]) | ||
/// @since 1.0.0 (2022-11-25) | ||
/// | ||
constexpr ActionBindings &getActionBindings() noexcept | ||
[[nodiscard]] constexpr ActionBindings &getActionBindings() noexcept | ||
{ | ||
return _actionBindings; | ||
} | ||
|
@@ -65,7 +65,7 @@ namespace ecstasy::integration::user_action | |
/// @author Andréas Leroux ([email protected]) | ||
/// @since 1.0.0 (2022-11-25) | ||
/// | ||
constexpr const ActionBindings &getActionBindings() const noexcept | ||
[[nodiscard]] constexpr const ActionBindings &getActionBindings() const noexcept | ||
{ | ||
return _actionBindings; | ||
} | ||
|
@@ -80,7 +80,7 @@ namespace ecstasy::integration::user_action | |
/// @author Andréas Leroux ([email protected]) | ||
/// @since 1.0.0 (2022-12-02) | ||
/// | ||
constexpr Id getId() const noexcept | ||
[[nodiscard]] constexpr Id getId() const noexcept | ||
{ | ||
return _id; | ||
} | ||
|
This file contains 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 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 |
---|---|---|
|
@@ -57,15 +57,15 @@ namespace ecstasy::integration::user_action | |
/// @author Andréas Leroux ([email protected]) | ||
/// @since 1.0.0 (2022-12-02) | ||
/// | ||
Users(size_t count = 1) noexcept; | ||
Users(size_t count = 1); | ||
|
||
/// | ||
/// @brief Default destructor. | ||
/// | ||
/// @author Andréas Leroux ([email protected]) | ||
/// @since 1.0.0 (2022-12-02) | ||
/// | ||
~Users() noexcept = default; | ||
~Users() = default; | ||
|
||
/// | ||
/// @brief Update the internal bindings associative maps. | ||
|
@@ -75,7 +75,7 @@ namespace ecstasy::integration::user_action | |
/// @author Andréas Leroux ([email protected]) | ||
/// @since 1.0.0 (2022-12-02) | ||
/// | ||
void updateBindings() noexcept; | ||
void updateBindings(); | ||
|
||
/// | ||
/// @brief Fetch the @ref Users resource in the registry if available and call @ref updateBindings(). | ||
|
@@ -85,7 +85,7 @@ namespace ecstasy::integration::user_action | |
/// @author Andréas Leroux ([email protected]) | ||
/// @since 1.0.0 (2022-12-02) | ||
/// | ||
static void updateBindings(Registry ®istry) noexcept; | ||
static void updateBindings(Registry ®istry); | ||
|
||
/// | ||
/// @brief Call action listeners associated to the event if any. | ||
|
@@ -107,16 +107,18 @@ namespace ecstasy::integration::user_action | |
/// | ||
/// @return UserProfile& A reference to the requested user. | ||
/// | ||
/// @throw std::out_of_range If the index is out of bounds. | ||
/// | ||
/// @author Andréas Leroux ([email protected]) | ||
/// @since 1.0.0 (2022-12-05) | ||
/// | ||
[[nodiscard]] constexpr UserProfile &getUserProfile(size_t index = 0) noexcept | ||
[[nodiscard]] constexpr UserProfile &getUserProfile(size_t index = 0) | ||
{ | ||
return _users[index]; | ||
} | ||
|
||
/// @copydoc getUserProfile | ||
[[nodiscard]] constexpr const UserProfile &getUserProfile(size_t index = 0) const noexcept | ||
[[nodiscard]] constexpr const UserProfile &getUserProfile(size_t index = 0) const | ||
{ | ||
return _users[index]; | ||
} | ||
|
@@ -125,7 +127,7 @@ namespace ecstasy::integration::user_action | |
/// @internal | ||
/// @brief Remove the bindings present in @p map and not in the @p _users bindings. | ||
template <typename T> | ||
void removeOutdatedBindings(std::unordered_multimap<T, UserActionLink> &map) noexcept | ||
void removeOutdatedBindings(std::unordered_multimap<T, UserActionLink> &map) | ||
{ | ||
for (auto it = map.begin(); it != map.end();) { | ||
if (it->second.userId >= _users.size() | ||
|
@@ -141,7 +143,7 @@ namespace ecstasy::integration::user_action | |
/// @brief Add the @p binding in the @p map if it is missing for the user @p user. | ||
template <typename T> | ||
void addBindingIfMissing(const UserProfile &user, const ActionBinding &binding, T input, | ||
std::unordered_multimap<T, UserActionLink> &map) noexcept | ||
std::unordered_multimap<T, UserActionLink> &map) | ||
{ | ||
bool add = true; | ||
auto range = map.equal_range(input); | ||
|
This file contains 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 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 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 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 |
---|---|---|
|
@@ -114,7 +114,7 @@ namespace util | |
/// @since 1.0.0 (2022-10-24) | ||
/// | ||
template <std::derived_from<Base> T, typename... Args> | ||
T &instanciate(Args &&...args) | ||
[[nodiscard]] T &instanciate(Args &&...args) | ||
{ | ||
T *newObject = new (reinterpret_cast<void *>(&_memory[_cursor])) T(std::forward<Args>(args)...); | ||
|
||
|
@@ -130,7 +130,7 @@ namespace util | |
/// @author Andréas Leroux ([email protected]) | ||
/// @since 1.0.0 (2023-11-08) | ||
/// | ||
constexpr const std::vector<Base *> &getInstances() const | ||
[[nodiscard]] constexpr const std::vector<Base *> &getInstances() const noexcept | ||
{ | ||
return _instances; | ||
} | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/// | ||
/// @file Traits.hpp | ||
/// @author Andréas Leroux ([email protected]) | ||
/// @brief | ||
/// @brief Helper types for parameter packs. | ||
/// @version 1.0.0 | ||
/// @date 2022-10-28 | ||
/// | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/// | ||
/// @file add_optional.hpp | ||
/// @author Andréas Leroux ([email protected]) | ||
/// @brief | ||
/// @brief Add std::optional to a type if required. | ||
/// @version 1.0.0 | ||
/// @date 2022-10-27 | ||
/// | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/// | ||
/// @file apply.hpp | ||
/// @author Andréas Leroux ([email protected]) | ||
/// @brief | ||
/// @brief Apply a modification on all types in a list. | ||
/// @version 1.0.0 | ||
/// @date 2022-12-15 | ||
/// | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/// | ||
/// @file contains.hpp | ||
/// @author Andréas Leroux ([email protected]) | ||
/// @brief | ||
/// @brief Checks if a type exists in a list of types. | ||
/// @version 1.0.0 | ||
/// @date 2022-10-28 | ||
/// | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/// | ||
/// @file filter.hpp | ||
/// @author Andréas Leroux ([email protected]) | ||
/// @brief | ||
/// @brief Filter types from a list. | ||
/// @version 1.0.0 | ||
/// @date 2022-12-15 | ||
/// | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/// | ||
/// @file index.hpp | ||
/// @author Andréas Leroux ([email protected]) | ||
/// @brief | ||
/// @brief Get the index of the first occurence of a type in a list of types. | ||
/// @version 1.0.0 | ||
/// @date 2022-10-28 | ||
/// | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/// | ||
/// @file is_std_vector.hpp | ||
/// @author Andréas Leroux ([email protected]) | ||
/// @brief | ||
/// @brief Check if a type is a std::vector. | ||
/// @version 1.0.0 | ||
/// @date 2024-04-30 | ||
/// | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/// | ||
/// @file is_type_bounded_array.hpp | ||
/// @author Andréas Leroux ([email protected]) | ||
/// @brief | ||
/// @brief Check if a type is a bounded array of a given element type. | ||
/// @version 1.0.0 | ||
/// @date 2024-10-10 | ||
/// | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/// | ||
/// @file outer_join.hpp | ||
/// @author Andréas Leroux ([email protected]) | ||
/// @brief | ||
/// @brief Performs a left outer join between two parameter packs. | ||
/// @version 1.0.0 | ||
/// @date 2022-10-28 | ||
/// | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/// | ||
/// @file type_set_eq.hpp | ||
/// @author Andréas Leroux ([email protected]) | ||
/// @brief | ||
/// @brief Test if two tuple types contains the exact same types independently of the order. | ||
/// @version 1.0.0 | ||
/// @date 2022-10-28 | ||
/// | ||
|
Oops, something went wrong.