File tree Expand file tree Collapse file tree
include/cpp_utils/memory/impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,9 +55,9 @@ class InternalPtrData
5555 // ! Create an empty (non valid) data
5656 InternalPtrData () noexcept ;
5757
58- // ! Move constructor
58+ // ! Move constructor is disabled because the internal mutex is not movable
5959 InternalPtrData (
60- InternalPtrData&& other) noexcept ;
60+ InternalPtrData&& other) noexcept = delete ;
6161
6262 /* *
6363 * @brief Destruct object
Original file line number Diff line number Diff line change @@ -34,15 +34,6 @@ InternalPtrData<T>::InternalPtrData() noexcept
3434{
3535}
3636
37- template <typename T>
38- InternalPtrData<T>::InternalPtrData(
39- InternalPtrData&& other) noexcept
40- : reference_(std::move(other.reference_))
41- , shared_mutex_(std::move(other.shared_mutex_))
42- , deleter_(std::move(other.deleter_))
43- {
44- }
45-
4637template <typename T>
4738InternalPtrData<T>::~InternalPtrData () noexcept
4839{
Original file line number Diff line number Diff line change 1818
1919#pragma once
2020
21+ #include < string>
22+
23+ #if !defined(__APPLE__)
2124#include < FileWatch.hpp>
25+ #endif
2226
2327namespace eprosima {
2428namespace utils {
2529namespace event {
2630
31+ #if defined(__APPLE__)
32+
33+ enum class FileWatchEvent
34+ {
35+ added,
36+ removed,
37+ modified,
38+ renamed_old,
39+ renamed_new
40+ };
41+
42+ class FileWatcher
43+ {
44+ public:
45+
46+ template <typename Callback>
47+ FileWatcher (
48+ std::string,
49+ Callback&&)
50+ {
51+ }
52+ };
53+
54+ #else
55+
2756class FileWatcher : public filewatch ::FileWatch<std::string>
2857{
2958 using filewatch::FileWatch<std::string>::FileWatch;
3059};
3160
3261using FileWatchEvent = filewatch::Event;
3362
63+ #endif // defined(__APPLE__)
64+
3465} /* namespace event */
3566} /* namespace utils */
3667} /* namespace eprosima */
68+
Original file line number Diff line number Diff line change @@ -56,6 +56,12 @@ void FileWatcherHandler::start_filewatcher_nts_()
5656{
5757 logInfo (UTILS_FILEWATCHER , " Starting FileWatcher in file: " << file_path_);
5858
59+ #if defined(__APPLE__)
60+ logWarning (
61+ UTILS_FILEWATCHER ,
62+ " File watching is disabled on macOS because the bundled backend only supports Windows and Linux." );
63+ filewatcher_started_.store (true );
64+ #else
5965 try
6066 {
6167 file_watch_handler_ = std::make_unique<FileWatcher>(
@@ -81,6 +87,7 @@ void FileWatcherHandler::start_filewatcher_nts_()
8187 }
8288
8389 filewatcher_started_.store (true );
90+ #endif // defined(__APPLE__)
8491
8592 logInfo (UTILS_FILEWATCHER , " Start Watching file: " << file_path_);
8693}
@@ -112,3 +119,4 @@ void FileWatcherHandler::callback_unset_nts_() noexcept
112119} /* namespace event */
113120} /* namespace utils */
114121} /* namespace eprosima */
122+
You can’t perform that action at this time.
0 commit comments