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 private: 32 void _CleanupTeam(team_id team); 33 34 private: 35 typedef std::map<team_id, BMessenger> AppMap; 36 37 AppMap fMap; 38 }; 39 40 41 #endif // APP_MANAGER_H 42