xref: /haiku/src/servers/index/AnalyserDispatcher.h (revision ca8ed5ea660fb6275799a3b7f138b201c41a667b)
1 /*
2  * Copyright 2010, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Clemens Zeidler <haiku@clemens-zeidler.de>
7  */
8 #ifndef ANALYSER_DISPATCHER
9 #define ANALYSER_DISPATCHER
10 
11 
12 #include <Looper.h>
13 #include <String.h>
14 
15 #include "IndexServerAddOn.h"
16 
17 
18 class FileAnalyser;
19 
20 
21 class AnalyserDispatcher : public BLooper {
22 public:
23 								AnalyserDispatcher(const char* name);
24 								~AnalyserDispatcher();
25 
26 			void				Stop();
27 			bool				Stopped();
28 
29 			bool				Busy();
30 
31 			void				AnalyseEntry(const entry_ref& ref);
32 			void				DeleteEntry(const entry_ref& ref);
33 			void				MoveEntry(const entry_ref& oldRef,
34 									const entry_ref& newRef);
35 			void				LastEntry();
36 
37 			//! thread safe
38 			bool				AddAnalyser(FileAnalyser* analyser);
39 			bool				RemoveAnalyser(const BString& name);
40 
41 			void				WriteAnalyserSettings();
42 			void				SetSyncPosition(bigtime_t time);
43 			void				SetWatchingStart(bigtime_t time);
44 			void				SetWatchingPosition(bigtime_t time);
45 
46 protected:
47 			FileAnalyserList	fFileAnalyserList;
48 
49 private:
50 			FileAnalyser*		_FindAnalyser(const BString& name);
51 
52 			int32				fStopped;
53 };
54 
55 #endif // ANALYSER_DISPATCHER
56