MoNet/MoNetTest/MoNetTest.h

Go to the documentation of this file.
00001 //
00002 // Copyright 2002,2004 Sony Corporation 
00003 //
00004 // Permission to use, copy, modify, and redistribute this software for
00005 // non-commercial use is hereby granted.
00006 //
00007 // This software is provided "as is" without warranty of any kind,
00008 // either expressed or implied, including but not limited to the
00009 // implied warranties of fitness for a particular purpose.
00010 //
00011 
00012 #ifndef MoNetTest_h_DEFINED
00013 #define MoNetTest_h_DEFINED
00014 
00015 #include <OPENR/OObject.h>
00016 #include <OPENR/OSubject.h>
00017 #include <OPENR/OObserver.h>
00018 #include <OPENR/ODataArchive.h>
00019 #include <MoNetData.h>
00020 #include "def.h"
00021 
00022 #include <list>
00023 using namespace std;
00024 
00025 enum MoNetTestState {
00026     MNTS_IDLE,
00027     MNTS_START,
00028     MNTS_WAITING_RESULT,
00029     MNTS_SHUTDOWN
00030 };
00031 
00032 const MoNetCommandID SLEEP2SLEEP_NULL = 0; // see MONETCMD.CFG
00033 
00034 class MoNetTest : public OObject {
00035 public:
00036     MoNetTest();
00037     virtual ~MoNetTest() {}
00038 
00039     OSubject*  subject[numOfSubject];
00040     OObserver* observer[numOfObserver];
00041 
00042     virtual OStatus DoInit   (const OSystemEvent& event);
00043     virtual OStatus DoStart  (const OSystemEvent& event);
00044     virtual OStatus DoStop   (const OSystemEvent& event);
00045     virtual OStatus DoDestroy(const OSystemEvent& event);
00046 
00047     void ReadyCommand(const OReadyEvent& event);
00048     void NotifyResult(const ONotifyEvent& event);
00049 
00050 private:
00051     void ParseCommandLine(char* cmdline);
00052     void Execute(MoNetCommandID cmdID);
00053 
00054     MoNetTestState moNetTestState;
00055     list<MoNetCommandID> commandQueue;
00056 };
00057 
00058 #endif // MoNetTest_h_DEFINED

Generated on Sun Dec 2 23:04:29 2007 for openSDK by  doxygen 1.3.9.1