Adding OSAL inotify - #379
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
665abfc to
8ca1037
Compare
8ca1037 to
79cbe77
Compare
ff44720 to
371082b
Compare
| * SPDX-License-Identifier: Apache-2.0 | ||
| ********************************************************************************/ | ||
|
|
||
| #ifndef INOTIFY_RANGE_HPP_ |
There was a problem hiding this comment.
OSAL_INOTIFY_RANGE_HPP_INCLUDED
There was a problem hiding this comment.
Just a suggestion, shall we also include namespace in the #def?
SCORE_MW_LIFECYCLE_OSAL_INOTIFY_RANGE_HPP
| namespace score::mw::lifecycle | ||
| { | ||
|
|
||
| /// @brief A wrapper around score::os::InotiyInstance to get iterator syntax. |
There was a problem hiding this comment.
| /// @brief A wrapper around score::os::InotiyInstance to get iterator syntax. | |
| /// @brief A wrapper around score::os::InotifyInstance to get iterator syntax. |
| return true; | ||
| } | ||
|
|
||
| public: |
There was a problem hiding this comment.
| public: |
| score::os::InotifyInstance* instance_{nullptr}; | ||
|
|
||
| /// @brief Internal buffer of events. | ||
| score::cpp::static_vector<score::os::InotifyEvent, score::os::InotifyInstance::max_events> events_{}; |
There was a problem hiding this comment.
@NicolasFussberger @SimonKozik @MaciejKaszynski how sure can we be that score::os::InotifyInstance::max_events will be sufficient?
There was a problem hiding this comment.
Can't really control this as this is the buffer that is returned from baselibs, but max_events is just the buffer size. Event's won't be dropped after this they will just be in the file.
By default the value can be found with cat /proc/sys/fs/inotify/max_queued_events which is 16384
The user can configure this so don't think we shall worry about this.
There was a problem hiding this comment.
Looks like this is max events per read only...
namespace score
{
namespace os
{
class InotifyInstance
{
public:
/**
* @brief The maximum amount of events a call to Read() can return
*/
static constexpr const unsigned int max_events{10U};So you will need to read multiple times, but events should not really be dropped .
paulquiring
left a comment
There was a problem hiding this comment.
Some findings nothing major.
| #include "score/os/utils/inotify/inotify_event.h" | ||
| #include "score/os/utils/inotify/inotify_instance.h" | ||
|
|
||
| namespace score::mw::lifecycle |
There was a problem hiding this comment.
Shall we add osal to the namespace?
score::mw::lifecycle::osal or score::mw::lifecycle::internal::osal
But this can get long, so I'm not sure here
Adding a small wrapper around
score::os::InotifyInstanceto get iterator syntax.Usage: