-
Notifications
You must be signed in to change notification settings - Fork 0
Baf 1155/use async client #47
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
koudis
wants to merge
17
commits into
master
Choose a base branch
from
BAF-1155/use_async_client
base: master
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.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2e30002
added aeron classes for initial testing
MarioIvancik 206ee66
check returned messages from aeron client
MarioIvancik a42eb16
functional aeron module communication
MarioIvancik 1401400
added docstrings for AeronClient
MarioIvancik ece7897
async function execution usage
MarioIvancik ad680e9
async client as a package
MarioIvancik 0246a0b
refactor of module library handler
MarioIvancik 5133c15
Set correct system name
koudis 79e0a2f
added mutexes for async client; use filesystem::path for file paths
MarioIvancik 5b140fb
removed memory management; added module based channel offset
MarioIvancik 5b56b38
added error handling to async module
MarioIvancik fd5a748
use function definitions from fleet protocol cpp
MarioIvancik f1f8d8c
Check if module defined in external-connection endpoint exists in mod…
vrygl 8bcef91
dont ignore nodiscard value in std::ranged::any_of
vrygl 9f3a6f0
Added missing param in logWarning
vrygl 20e90f8
Addressed PR review comments
jiriskuta 9d549bb
Fixed remaining open PR review findings
jiriskuta 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| SET(STORAGE_LIST DEP) | ||
|
|
||
| SET(STORAGE_LIST_DEP "https://github.com/bacpack-system/package-tracker.git") | ||
| SET(STORAGE_LIST_DEP_REVISION "v0.0.0" CACHE STRING "" FORCE) | ||
| SET(STORAGE_LIST_DEP "https://github.com/bacpack-system/package-tracker.git") |
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
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
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
126 changes: 126 additions & 0 deletions
126
include/bringauto/modules/IModuleManagerLibraryHandler.hpp
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 |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| #pragma once | ||
|
|
||
| #include <bringauto/modules/Buffer.hpp> | ||
|
|
||
| #include <filesystem> | ||
| #include <functional> | ||
|
|
||
|
|
||
|
|
||
| namespace bringauto::modules { | ||
|
|
||
| /** | ||
| * @brief Class used to load and handle library created by module maintainer | ||
| */ | ||
| class IModuleManagerLibraryHandler { | ||
| public: | ||
| IModuleManagerLibraryHandler() = default; | ||
|
|
||
| virtual ~IModuleManagerLibraryHandler() = default; | ||
|
|
||
| /** | ||
| * @brief Load library created by a module maintainer | ||
| * | ||
| * @param path path to the library | ||
| */ | ||
| virtual void loadLibrary(const std::filesystem::path &path) = 0; | ||
jiriskuta marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /** | ||
| * @brief Get the module number | ||
| * | ||
| * @return module number | ||
| */ | ||
| virtual int getModuleNumber() = 0; | ||
|
|
||
| /** | ||
| * @brief Check if device type is supported by the module | ||
| * | ||
| * @param device_type device type to check | ||
| * @return OK if supported, NOT_OK otherwise | ||
| */ | ||
| virtual int isDeviceTypeSupported(unsigned int device_type) = 0; | ||
|
|
||
| /** | ||
| * @brief Evaluate the condition for aggregating a new status into the current status | ||
| * | ||
| * @param current_status current aggregated status | ||
| * @param new_status newly received status | ||
| * @param device_type device type | ||
| * @return OK if the new status should be aggregated, NOT_OK otherwise | ||
| */ | ||
| virtual int sendStatusCondition(const Buffer ¤t_status, const Buffer &new_status, unsigned int device_type) = 0; | ||
|
|
||
| /** | ||
| * @brief After executing the respective module function, an error might be thrown when allocating the buffer. | ||
| * | ||
| * @see fleet-protocol/lib/module_maintainer/module_gateway/include/module_manager.h | ||
| */ | ||
| virtual int generateCommand(Buffer &generated_command, const Buffer &new_status, | ||
| const Buffer ¤t_status, const Buffer ¤t_command, | ||
| unsigned int device_type) = 0; | ||
|
|
||
| /** | ||
| * @brief After executing the respective module function, an error might be thrown when allocating the buffer. | ||
| * | ||
| * @see fleet-protocol/lib/module_maintainer/module_gateway/include/module_manager.h | ||
| */ | ||
| virtual int aggregateStatus(Buffer &aggregated_status, const Buffer ¤t_status, | ||
| const Buffer &new_status, unsigned int device_type) = 0; | ||
|
|
||
| /** | ||
| * @brief After executing the respective module function, an error might be thrown when allocating the buffer. | ||
| * | ||
| * @see fleet-protocol/lib/module_maintainer/module_gateway/include/module_manager.h | ||
| */ | ||
| virtual int aggregateError(Buffer &error_message, const Buffer ¤t_error_message, const Buffer &status, | ||
| unsigned int device_type) = 0; | ||
|
|
||
| /** | ||
| * @brief After executing the respective module function, an error might be thrown when allocating the buffer. | ||
| * | ||
| * @see fleet-protocol/lib/module_maintainer/module_gateway/include/module_manager.h | ||
| */ | ||
| virtual int generateFirstCommand(Buffer &default_command, unsigned int device_type) = 0; | ||
|
|
||
| /** | ||
| * @brief Check if the status data is valid | ||
| * | ||
| * @param status status buffer to validate | ||
| * @param device_type device type | ||
| * @return OK if valid, NOT_OK otherwise | ||
| */ | ||
| virtual int statusDataValid(const Buffer &status, unsigned int device_type) = 0; | ||
|
|
||
| /** | ||
| * @brief Check if the command data is valid | ||
| * | ||
| * @param command command buffer to validate | ||
| * @param device_type device type | ||
| * @return OK if valid, NOT_OK otherwise | ||
| */ | ||
| virtual int commandDataValid(const Buffer &command, unsigned int device_type) = 0; | ||
|
|
||
| /** | ||
| * @brief Constructs a buffer with the given size | ||
| * | ||
| * @param size size of the buffer | ||
| * @return a new Buffer object | ||
| */ | ||
| Buffer constructBuffer(std::size_t size = 0); | ||
|
|
||
| protected: | ||
|
|
||
| std::function<void(struct buffer*)> deallocate_ {}; | ||
|
|
||
| virtual int allocate(struct buffer* buffer_pointer, size_t size_in_bytes) const = 0; | ||
|
|
||
| /** | ||
| * @brief Constructs a buffer by taking ownership of the given raw C buffer | ||
| * | ||
| * @param buffer raw C buffer whose memory ownership is transferred | ||
| * @return a new Buffer object | ||
| */ | ||
| Buffer constructBufferByTakeOwnership(struct ::buffer& buffer); | ||
| }; | ||
|
|
||
| } | ||
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.