00001 //////////////////////////////////////////////////////////////////////////////// 00002 /// 00003 /// \file 00004 /// \author Gerald Fahrnholz 00005 /// 00006 /// \brief 00007 /// Class CallBackFromSimpleObjectis a call back object with interface 00008 /// ICallBackFromSimpleObject to receive calls from SimpleObject. 00009 /// 00010 //////////////////////////////////////////////////////////////////////////////// 00011 00012 #pragma once 00013 00014 #if _MSC_VER > 1000 00015 #pragma once 00016 #endif // _MSC_VER > 1000 00017 00018 00019 #include "SourcesToTest\ISimpleObject.h" // ICallBackFromSimpleObject 00020 #include "TestToolBox/Synchronizer.h" // synchronization via TU_SYNC 00021 #include "TestToolBox/TestEvents.h" // signalling (asynchronous) textual events 00022 using namespace TestToolBox; 00023 00024 ///\cond do not document 00025 00026 class CallBackFromSimpleObject : 00027 public ICallBackFromSimpleObject 00028 { 00029 public: 00030 00031 // Constructor 00032 explicit CallBackFromSimpleObject(){}; 00033 00034 // Destructor 00035 virtual ~CallBackFromSimpleObject(){}; 00036 00037 //******************************************************************** 00038 // Interface ICallBackFromSimpleObject 00039 //******************************************************************** 00040 00041 void Result ( 00042 long in_val) 00043 { 00044 TRCF("CallBackFromSimpleObject::Result") 00045 TRC (TL_DEBUG, "Begin in_val = %d", in_val); 00046 00047 // Inform test utility about the received value 00048 TestEvents::Get()->Act("CallBack-Result: %d", in_val); 00049 00050 // TODO / possible extension: 00051 // Add implementation variant allowing output to stream instead of printf syntax 00052 00053 // Generate sync event to synchronize with main thread of test exe 00054 TTB_SYNC(); 00055 00056 TRC (TL_DEBUG, "End"); 00057 } 00058 00059 }; // class CallBackFromSimpleObject 00060 00061 ///\endcond do not document