xref: /haiku/src/add-ons/kernel/file_systems/netfs/server/StatisticsManager.h (revision 5a1d355fdf2747f80f8c46e2539f844a0b813346)
1 // StatisticsManager.h
2 
3 #ifndef NET_FS_STATISTICS_MANAGER_H
4 #define NET_FS_STATISTICS_MANAGER_H
5 
6 #include "Locker.h"
7 
8 class BMessage;
9 
10 class Share;
11 class User;
12 
13 class StatisticsManager {
14 private:
15 								StatisticsManager();
16 								~StatisticsManager();
17 
18 			status_t			Init();
19 
20 public:
21 	static	status_t			CreateDefault();
22 	static	void				DeleteDefault();
23 	static	StatisticsManager*	GetDefault();
24 
25 			void				UserRemoved(User* user);
26 			void				ShareRemoved(Share* share);
27 
28 			void				ShareMounted(Share* share, User* user);
29 			void				ShareUnmounted(Share* share, User* user);
30 
31 			status_t			GetUserStatistics(User* user,
32 									BMessage* statistics);
33 			status_t			GetUserStatistics(const char* user,
34 									BMessage* statistics);
35 
36 			status_t			GetShareStatistics(Share* share,
37 									BMessage* statistics);
38 			status_t			GetShareStatistics(const char* share,
39 									BMessage* statistics);
40 
41 private:
42 			class ShareStatistics;
43 			struct ShareStatisticsMap;
44 
45 			Locker				fLock;
46 			ShareStatisticsMap*	fShareStatistics;
47 
48 	static	StatisticsManager*	fManager;
49 };
50 
51 #endif	// NET_FS_STATISTICS_MANAGER_H
52