diff --git a/cpp_utils/include/cpp_utils/memory/impl/InternalPtrData.hpp b/cpp_utils/include/cpp_utils/memory/impl/InternalPtrData.hpp index c921b846..15552742 100644 --- a/cpp_utils/include/cpp_utils/memory/impl/InternalPtrData.hpp +++ b/cpp_utils/include/cpp_utils/memory/impl/InternalPtrData.hpp @@ -30,7 +30,7 @@ namespace eprosima { namespace utils { //! Forward declaration of OwnerPtr to use it as friendly class in LesseePtr -template +template class OwnerPtr; /** @@ -43,7 +43,7 @@ class OwnerPtr; * * @tparam T Type of the internal data. */ -template +template class InternalPtrData { public: @@ -55,9 +55,9 @@ class InternalPtrData //! Create an empty (non valid) data InternalPtrData() noexcept; - //! Move constructor + //! Move constructor is disabled because the internal mutex is not movable InternalPtrData( - InternalPtrData&& other) noexcept; + InternalPtrData&& other) noexcept = delete; /** * @brief Destruct object diff --git a/cpp_utils/include/cpp_utils/memory/impl/InternalPtrData.ipp b/cpp_utils/include/cpp_utils/memory/impl/InternalPtrData.ipp index 9dc8815f..737c946a 100644 --- a/cpp_utils/include/cpp_utils/memory/impl/InternalPtrData.ipp +++ b/cpp_utils/include/cpp_utils/memory/impl/InternalPtrData.ipp @@ -34,15 +34,6 @@ InternalPtrData::InternalPtrData() noexcept { } -template -InternalPtrData::InternalPtrData( - InternalPtrData&& other) noexcept - : reference_(std::move(other.reference_)) - , shared_mutex_(std::move(other.shared_mutex_)) - , deleter_(std::move(other.deleter_)) -{ -} - template InternalPtrData::~InternalPtrData() noexcept { diff --git a/cpp_utils/src/cpp/event/FileWatcher.hpp b/cpp_utils/src/cpp/event/FileWatcher.hpp index f7e87508..f7955c7e 100644 --- a/cpp_utils/src/cpp/event/FileWatcher.hpp +++ b/cpp_utils/src/cpp/event/FileWatcher.hpp @@ -18,12 +18,42 @@ #pragma once +#include + +#if !defined(__APPLE__) #include +#endif // if !defined(__APPLE__) namespace eprosima { namespace utils { namespace event { +#if defined(__APPLE__) + +enum class FileWatchEvent +{ + added, + removed, + modified, + renamed_old, + renamed_new +}; + +class FileWatcher +{ +public: + + template + FileWatcher( + std::string, + Callback&&) + { + } + +}; + +#else + class FileWatcher : public filewatch::FileWatch { using filewatch::FileWatch::FileWatch; @@ -31,6 +61,9 @@ class FileWatcher : public filewatch::FileWatch using FileWatchEvent = filewatch::Event; +#endif // defined(__APPLE__) + } /* namespace event */ } /* namespace utils */ } /* namespace eprosima */ + diff --git a/cpp_utils/src/cpp/event/FileWatcherHandler.cpp b/cpp_utils/src/cpp/event/FileWatcherHandler.cpp index 5d079b0f..c0fdfb1f 100644 --- a/cpp_utils/src/cpp/event/FileWatcherHandler.cpp +++ b/cpp_utils/src/cpp/event/FileWatcherHandler.cpp @@ -56,6 +56,12 @@ void FileWatcherHandler::start_filewatcher_nts_() { logInfo(UTILS_FILEWATCHER, "Starting FileWatcher in file: " << file_path_); +#if defined(__APPLE__) + logWarning( + UTILS_FILEWATCHER, + "File watching is disabled on macOS because the bundled backend only supports Windows and Linux."); + filewatcher_started_.store(true); +#else try { file_watch_handler_ = std::make_unique( @@ -76,11 +82,12 @@ void FileWatcherHandler::start_filewatcher_nts_() } catch (const std::exception& e) { - utils::InitializationException(STR_ENTRY << - "Error creating file watcher: " << e.what()); + utils::InitializationException(STR_ENTRY + << "Error creating file watcher: " << e.what()); } filewatcher_started_.store(true); +#endif // defined(__APPLE__) logInfo(UTILS_FILEWATCHER, "Start Watching file: " << file_path_); } @@ -112,3 +119,4 @@ void FileWatcherHandler::callback_unset_nts_() noexcept } /* namespace event */ } /* namespace utils */ } /* namespace eprosima */ +