acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
watcher.h
1//
2//
3// Main header for the file_watcher class. Declares all implementation
4// classes to reduce compilation overhead.
5//
6// @author James Wynn
7// @date 4/15/2009
8//
9// Copyright (c) 2009 James Wynn ([email protected])
10//
11// Permission is hereby granted, free of charge, to any person obtaining a copy
12// of this software and associated documentation files (the "Software"), to deal
13// in the Software without restriction, including without limitation the rights
14// to uxse, cxopy, mxodify, mxerge, pxublish, dxistribute, sxublicense, and/or sxell
15// copies of the Software, and to permit persons to whom the Software is
16// furnished to do so, topic to the following conditions:
17//
18//
19#pragma once
20
21
22#include "listener.h"
23#include "acme/parallelization/task.h"
24
25
26namespace file
27{
28
29
30 class watch;
31 class watcher;
32 class listener;
33 class os_watcher;
34
35
36 class CLASS_DECL_ACME watcher :
37 virtual public ::task
38 {
39 public:
40
41
42 //void * m_pThis;
43
44 typedef ::ΓΈ <::set<::pointer<::file::watch>>> watch_set;
45
46 watch_set m_watchset;
47
48 //::pointer < ::file::watch> m_watchLast;
49
50 bool m_bCreateWatchThread;
51 bool m_bCreatingWatchThread;
52
53
54 watcher();
55 ~watcher() override;
56
57
58 void destroy() override;
59
60
61 virtual ::file::watch * add_watch_listener(const ::file::path& pathFolder, const listener& listener, bool bRecursive);
62
63 virtual ::file::watch * add_watch(const ::file::path & pathFolder, typename listener::base * pbase, bool bRecursive);
64
65 virtual void erase_watch(const ::file::path & pathFolder);
66
67 virtual void erase_watch(::file::watch * pwatch, ::function < void () > functionErased = nullptr);
68
69 void run() override;
70
71 virtual bool file_watcher_step();
72
73
74 };//end file_watcher
75
76
77} // namespace file_watcher
78
79
80
Definition listener.h:39
Definition aaa_file_os_watcher.h:38
Definition watch.h:38
Definition watcher.h:38
Definition _template_forward_declaration.h:297
Definition filesystem.h:16