00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <OPENR/OSyslog.h>
00013 #include <OPENR/core_macro.h>
00014 #include "SampleObserver.h"
00015
00016 SampleObserver::SampleObserver()
00017 {
00018 }
00019
00020 OStatus
00021 SampleObserver::DoInit(const OSystemEvent& event)
00022 {
00023 NEW_ALL_SUBJECT_AND_OBSERVER;
00024 REGISTER_ALL_ENTRY;
00025 SET_ALL_READY_AND_NOTIFY_ENTRY;
00026 return oSUCCESS;
00027 }
00028
00029 OStatus
00030 SampleObserver::DoStart(const OSystemEvent& event)
00031 {
00032 ENABLE_ALL_SUBJECT;
00033 ASSERT_READY_TO_ALL_OBSERVER;
00034 return oSUCCESS;
00035 }
00036
00037 OStatus
00038 SampleObserver::DoStop(const OSystemEvent& event)
00039 {
00040 DISABLE_ALL_SUBJECT;
00041 DEASSERT_READY_TO_ALL_OBSERVER;
00042 return oSUCCESS;
00043 }
00044
00045 OStatus
00046 SampleObserver::DoDestroy(const OSystemEvent& event)
00047 {
00048 DELETE_ALL_SUBJECT_AND_OBSERVER;
00049 return oSUCCESS;
00050 }
00051
00052 void
00053 SampleObserver::Notify(const ONotifyEvent& event)
00054 {
00055 const char* text = (const char *)event.Data(0);
00056 OSYSPRINT(("SampleObserver::Notify() %s\n", text));
00057 observer[event.ObsIndex()]->AssertReady();
00058 }