Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: base/store_watcher.h

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/statregex.h ('k') | base/string.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2006-2009 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 // ========================================================================
15
16 //
17 // A simple interface for monitoring changes
18 // happening to a store.
19 //
20 #ifndef OMAHA_COMMON_STORE_WATCHER_H_
21 #define OMAHA_COMMON_STORE_WATCHER_H_
22
23 #include "omaha/base/synchronized.h"
24
25 namespace omaha {
26
27 // Allows for monitoring changes happening to a store
28 // (independant of what the underlying store is).
29 class StoreWatcher {
30 public:
31 StoreWatcher() {}
32 virtual ~StoreWatcher() {}
33
34 // Called to create/reset the event that gets signaled
35 // any time the store changes. Access the created
36 // event using change_event().
37 virtual HRESULT EnsureEventSetup() = 0;
38
39 // Indicates if any changes have occured
40 bool HasChangeOccurred() const {
41 return IsHandleSignaled(change_event());
42 }
43
44 // Get the event that is signaled on store changes.
45 // Note:
46 // * This event will remain constant until the class is destroyed.
47 // * One should call EnsureEventSetup to set-up the event.
48 // * The event is only signaled on the next change and remains signaled.
49 // Do not call ::ResetEvent(). Call EnsureEventSetup() to reset
50 // the event and wait for more changes.
51 virtual HANDLE change_event() const = 0;
52
53 private:
54 DISALLOW_EVIL_CONSTRUCTORS(StoreWatcher);
55 };
56
57 } // namespace omaha
58
59 #endif // OMAHA_COMMON_STORE_WATCHER_H_
OLDNEW
« no previous file with comments | « base/statregex.h ('k') | base/string.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698