xref: /haiku/src/servers/media/AppManager.h (revision 11c7bd86e2648375192ad86ba628b06a5ac5b503)
1 /*
2  * Copyright 2002, Marcus Overhagen. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef APP_MANAGER_H
6 #define APP_MANAGER_H
7 
8 
9 #include <map>
10 
11 #include <Locker.h>
12 #include <Messenger.h>
13 
14 
15 class AppManager : BLocker {
16 public:
17 								AppManager();
18 								~AppManager();
19 
20 			status_t			RegisterTeam(team_id team,
21 									const BMessenger& messenger);
22 			status_t			UnregisterTeam(team_id team);
23 			bool				HasTeam(team_id team);
24 
25 			team_id				AddOnServerTeam();
26 
27 			status_t			SendMessage(team_id team, BMessage* message);
28 
29 			void				Dump();
30 
31 			void				NotifyRosters();
32 
33 private:
34 			void				_CleanupTeam(team_id team);
35 
36 private:
37 			typedef std::map<team_id, BMessenger> AppMap;
38 
39 			AppMap				fMap;
40 };
41 
42 
43 #endif // APP_MANAGER_H
44