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 @@ -30,7 +30,7 @@ namespace eprosima {
3030namespace utils {
3131
3232// ! Forward declaration of OwnerPtr to use it as friendly class in LesseePtr
33- template <class T >
33+ template <class T >
3434class OwnerPtr ;
3535
3636/* *
@@ -43,7 +43,7 @@ class OwnerPtr;
4343 *
4444 * @tparam T Type of the internal data.
4545 */
46- template <class T >
46+ template <class T >
4747class InternalPtrData
4848{
4949public:
@@ -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 // if !defined(__APPLE__)
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+
55+ #else
56+
2757class FileWatcher : public filewatch ::FileWatch<std::string>
2858{
2959 using filewatch::FileWatch<std::string>::FileWatch;
3060};
3161
3262using FileWatchEvent = filewatch::Event;
3363
64+ #endif // defined(__APPLE__)
65+
3466} /* namespace event */
3567} /* namespace utils */
3668} /* namespace eprosima */
69+
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>(
@@ -76,11 +82,12 @@ void FileWatcherHandler::start_filewatcher_nts_()
7682 }
7783 catch (const std::exception& e)
7884 {
79- utils::InitializationException (STR_ENTRY <<
80- " Error creating file watcher: " << e.what ());
85+ utils::InitializationException (STR_ENTRY
86+ << " Error creating file watcher: " << e.what ());
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