11299bfb2Sbeveloper /* 21299bfb2Sbeveloper * Copyright 2002, Marcus Overhagen. All rights reserved. 31299bfb2Sbeveloper * Distributed under the terms of the MIT License. 41299bfb2Sbeveloper */ 5*28a06094Sbeveloper #ifndef __APP_MANAGER_H 6*28a06094Sbeveloper #define __APP_MANAGER_H 752a38012Sejakowatz 86396865dSbeveloper #include "TMap.h" 952a38012Sejakowatz 1052a38012Sejakowatz class AppManager 1152a38012Sejakowatz { 1252a38012Sejakowatz public: 1352a38012Sejakowatz AppManager(); 1452a38012Sejakowatz ~AppManager(); 156396865dSbeveloper 1652a38012Sejakowatz status_t RegisterTeam(team_id, BMessenger); 1752a38012Sejakowatz status_t UnregisterTeam(team_id); 186396865dSbeveloper bool HasTeam(team_id); 19*28a06094Sbeveloper 20*28a06094Sbeveloper team_id AddonServerTeam(); 216396865dSbeveloper 22359ac306Sbeveloper status_t SendMessage(team_id team, BMessage *msg); 23359ac306Sbeveloper 24ced4130fSbeveloper void Dump(); 25ced4130fSbeveloper 2652a38012Sejakowatz private: 276396865dSbeveloper void CleanupTeam(team_id); 286396865dSbeveloper void TeamDied(team_id team); 296396865dSbeveloper static int32 bigbrother(void *self); 306396865dSbeveloper void BigBrother(); 316396865dSbeveloper 326396865dSbeveloper private: 336396865dSbeveloper thread_id fBigBrother; 346396865dSbeveloper sem_id fQuit; 356396865dSbeveloper 366396865dSbeveloper struct App { 3752a38012Sejakowatz team_id team; 3852a38012Sejakowatz BMessenger messenger; 3952a38012Sejakowatz }; 406396865dSbeveloper Map<team_id, App> * fAppMap; 416396865dSbeveloper BLocker *fLocker; 4252a38012Sejakowatz }; 43*28a06094Sbeveloper 44*28a06094Sbeveloper #endif // __APP_MANAGER_H 45