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 #ifdef _MSC_VER
00037 # pragma warning ( push )
00038 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
00039 #endif
00040
00041 namespace GENAPI_NAMESPACE
00042 {
00043
00044 interface GENAPI_DECL_ABSTRACT IPortWriteList
00045 {
00047 virtual void Write(const void *pBuffer, int64_t Address, int64_t Length) = 0;
00048
00050 virtual void Replay(IPort* pPort) = 0;
00051
00053
00054 virtual void SetCookie(const int64_t Value) = 0;
00055
00057 virtual int64_t GetCookie() = 0;
00058 };
00059
00064 interface GENAPI_DECL_ABSTRACT IPortReplay : virtual public IPort
00065 {
00067
00072 virtual void Replay( IPortWriteList *pPortRecorder, bool Invalidate = true ) = 0;
00073 };
00074
00079 interface GENAPI_DECL_ABSTRACT IPortRecorder : public IPortReplay
00080 {
00082 virtual void StartRecording( IPortWriteList *pPortRecorder ) = 0;
00083
00085 virtual void StopRecording() = 0;
00086 };
00087
00088
00089
00090
00091
00097 template <class T>
00098 class CPortRecorderRefT : public CPortRefT<T>
00099 {
00100 typedef CPortRefT<T> ref;
00101
00102 public:
00103
00104
00105
00106
00108
00113 virtual void Replay( IPortWriteList *pPortRecorder, bool Invalidate = true )
00114 {
00115 if(ref::m_Ptr)
00116 return ref::m_Ptr->Replay(pPortRecorder, Invalidate);
00117 else
00118 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00119 }
00120
00122 virtual void StartRecording( IPortWriteList *pPortRecorder )
00123 {
00124 if(ref::m_Ptr)
00125 return ref::m_Ptr->StartRecording(pPortRecorder);
00126 else
00127 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00128 }
00129
00131 virtual void StopRecording()
00132 {
00133 if(ref::m_Ptr)
00134 return ref::m_Ptr->StopRecording();
00135 else
00136 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00137 }
00138
00139 };
00140
00143 typedef CPortRecorderRefT< IPortRecorder > CPortRecorderRef;
00144
00145 }
00146
00147 #ifdef _MSC_VER
00148 # pragma warning ( pop )
00149 #endif
00150
00151 #endif // ifndef GENAPI_IPORTRECORDER_H