1 // TestApp.h 2 3 #ifndef _beos_test_app_h_ 4 #define _beos_test_app_h_ 5 6 #include <Application.h> 7 #include <ObjectList.h> 8 #include <MessageQueue.h> 9 10 // TestHandler 11 12 class BTestHandler : public BHandler { 13 public: 14 virtual void MessageReceived(BMessage *message); 15 BMessageQueue &Queue(); 16 17 private: 18 BMessageQueue fQueue; 19 }; 20 21 22 // TestApp 23 24 class BTestApp : public BApplication { 25 public: 26 BTestApp(const char *signature); 27 virtual ~BTestApp(); 28 29 status_t Init(); 30 void Terminate(); 31 32 virtual void ReadyToRun(); 33 34 BTestHandler *CreateTestHandler(); 35 bool DeleteTestHandler(BTestHandler *handler); 36 37 BTestHandler &Handler(); 38 BTestHandler *TestHandlerAt(int32 index); 39 40 private: 41 static int32 _AppThreadStart(void *data); 42 43 private: 44 typedef BObjectList<BTestHandler> TestHandlers; 45 thread_id fAppThread; 46 TestHandlers fHandlers; 47 }; 48 49 #endif // _beos_test_app_h_ 50