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
15class AppManager : BLocker {
16public:
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
33private:
34			void				_CleanupTeam(team_id team);
35
36private:
37			typedef std::map<team_id, BMessenger> AppMap;
38
39			AppMap				fMap;
40};
41
42
43#endif // APP_MANAGER_H
44