Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00031 #ifndef GENAPI_IPORTRECORDER_H
00032 #define GENAPI_IPORTRECORDER_H
00033
00034 #include <GenApi/IPort.h>
00035
00036 #pragma warning ( push )
00037 #pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
00038
00039 namespace GENAPI_NAMESPACE
00040 {
00041
00042 interface GENAPI_DECL_ABSTRACT IPortWriteList
00043 {
00045 virtual void Write(const void *pBuffer, int64_t Address, int64_t Length) = 0;
00046
00048 virtual void Replay(IPort* pPort) = 0;
00049
00051
00052 virtual void SetCookie(const int64_t Value) = 0;
00053
00055 virtual int64_t GetCookie() = 0;
00056 };
00057
00062 interface GENAPI_DECL_ABSTRACT IPortReplay : virtual public IPort
00063 {
00065
00070 virtual void Replay( IPortWriteList *pPortRecorder, bool Invalidate = true ) = 0;
00071 };
00072
00077 interface GENAPI_DECL_ABSTRACT IPortRecorder : public IPortReplay
00078 {
00080 virtual void StartRecording( IPortWriteList *pPortRecorder ) = 0;
00081
00083 virtual void StopRecording() = 0;
00084 };
00085
00086
00087
00088
00089
00095 template <class T>
00096 class CPortRecorderRefT : public CPortRefT<T>
00097 {
00098 typedef CPortRefT<T> ref;
00099
00100 public:
00101
00102
00103
00104
00106
00111 virtual void Replay( IPortWriteList *pPortRecorder, bool Invalidate = true )
00112 {
00113 if(ref::m_Ptr)
00114 return ref::m_Ptr->Replay(pPortRecorder, Invalidate);
00115 else
00116 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00117 }
00118
00120 virtual void StartRecording( IPortWriteList *pPortRecorder )
00121 {
00122 if(ref::m_Ptr)
00123 return ref::m_Ptr->StartRecording(pPortRecorder);
00124 else
00125 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00126 }
00127
00129 virtual void StopRecording()
00130 {
00131 if(ref::m_Ptr)
00132 return ref::m_Ptr->StopRecording();
00133 else
00134 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00135 }
00136
00137 };
00138
00141 typedef CPortRecorderRefT< IPortRecorder > CPortRecorderRef;
00142
00143 }
00144
00145 #pragma warning ( pop )
00146
00147 #endif // ifndef GENAPI_IPORTRECORDER_H