3 #if !defined(PARAENGINE_MOBILE) 5 #include "dir_monitor/basic_dir_monitor.hpp" 6 #include <boost/thread.hpp> 22 typedef boost::signals2::signal<void(const DirMonitorEvent&)> FileSystemEvent_t;
23 typedef boost::signals2::connection FileSystemEvent_Connection_t;
54 FileSystemEvent_Connection_t
AddEventCallback(FileSystemEvent_t::slot_type callback);
56 const std::string& GetName()
const;
57 void SetName(
const std::string& val);
62 std::queue < DirMonitorEvent > m_msg_queue;
70 FileSystemEvent_t m_file_event;
76 bool m_bDispatchInMainThread;
84 typedef std::map<std::string, CFileSystemWatcherPtr > file_watcher_map_t;
97 CFileSystemWatcherPtr GetDirWatcher(
const std::string& name);
102 void DeleteDirWatcher(
const std::string& name);
112 boost::asio::io_service&
GetIOService() {
return *(m_io_service.get());}
120 int fileWatcherThreadMain();
122 file_watcher_map_t m_file_watchers;
125 boost::scoped_ptr<boost::asio::io_service::work> m_io_service_work;
Definition: basic_dir_monitor.hpp:16
bool remove_directory(const std::string &dirname)
remove a directory to monitor.
Definition: FileSystemWatcher.cpp:258
different physics engine has different winding order.
Definition: EventBinding.h:32
bool IsStarted()
whether it is started.
Definition: FileSystemWatcher.h:115
int DispatchEvents()
this allows us to process queued messages in main thread's frame move.
Definition: FileSystemWatcher.cpp:214
Definition: class.hpp:124
event_type
Definition: basic_dir_monitor.hpp:18
boost::asio::io_service & GetIOService()
get io service object.
Definition: FileSystemWatcher.h:112
monitoring file changes.
Definition: FileSystemWatcher.h:17
bool IsDispatchInMainThread()
if true(default), we will dispatch all callback event in the main thread.
Definition: FileSystemWatcher.cpp:209
FileSystemEvent_Connection_t AddEventCallback(FileSystemEvent_t::slot_type callback)
add an event call back, please note that the event callback may be called from the main thread or the...
Definition: FileSystemWatcher.cpp:237
void Destroy()
must be called before you wait for worker thread to exit.
Definition: FileSystemWatcher.cpp:284
file system watcher service.
Definition: FileSystemWatcher.h:81
void SetDispatchInMainThread(bool bMainThread)
if true(default), we will dispatch all callback event in the main thread.
Definition: FileSystemWatcher.cpp:204
cross platform mutex
Definition: mutex.h:95
bool add_directory(const std::string &dirname)
add a directory to monitor.
Definition: FileSystemWatcher.cpp:242