home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2003 March / VPR0303A.ISO / AIBO / AiboBiff2 / AiboBiff / AiboBiff.h < prev    next >
C/C++ Source or Header  |  2002-12-19  |  1KB  |  62 lines

  1. #ifndef AiboBiff_h_DEFINED
  2. #define AiboBiff_h_DEFINED
  3.  
  4. #include <OPENR/OObject.h>
  5. #include <OPENR/OSubject.h>
  6. #include <OPENR/OObserver.h>
  7. #include <OPENR/ODataArchive.h>
  8. #include <OPENR/OTime.h>
  9. #include <MoNetData.h>
  10. #include "def.h"
  11.  
  12. #include <list>
  13. using namespace std;
  14.  
  15. enum AiboBiffState {
  16.     BIFF_IDLE,
  17.     BIFF_READY
  18. };
  19.  
  20. enum MoNetTestState {
  21.     MNTS_IDLE,
  22.     MNTS_START,
  23.     MNTS_WAITING_RESULT,
  24.     MNTS_SHUTDOWN
  25. };
  26.  
  27. const MoNetCommandID SLEEP2SLEEP_NULL = 0; // see /OPEN-R/MW/CONF/MONETCMD.CFG
  28.  
  29. class AiboBiff: public OObject {
  30. public:
  31.     AiboBiff();
  32.     virtual ~AiboBiff() {}
  33.  
  34.     OSubject*   subject[numOfSubject];
  35.     OObserver*  observer[numOfObserver];     
  36.  
  37.     virtual OStatus DoInit   (const OSystemEvent& event);
  38.     virtual OStatus DoStart  (const OSystemEvent& event);
  39.     virtual OStatus DoStop   (const OSystemEvent& event);
  40.     virtual OStatus DoDestroy(const OSystemEvent& event);
  41.  
  42. public:
  43.     void ReadyCommand(const OReadyEvent& event);
  44.     void NotifyResult(const ONotifyEvent& event);
  45.  
  46.     void NotifySensor(const ONotifyEvent& event);
  47.  
  48.     void ReadyMailCheck(const OReadyEvent& event);
  49.     void NotifyNewMail(const ONotifyEvent& event);
  50.  
  51. private:
  52.     void ParseCommandLine(char* cmdline);
  53.     void Execute(MoNetCommandID cmdID);
  54.  
  55.     MoNetTestState moNetTestState;
  56.     list<MoNetCommandID> commandQueue;
  57.     
  58.     AiboBiffState biffState;
  59. };
  60.  
  61. #endif // AiboBiff_h_DEFINED
  62.