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_IPORT_H
00032 #define GENAPI_IPORT_H
00033
00034 #include <Base/GCException.h>
00035 #include <GenApi/GenApiDll.h>
00036 #include <GenApi/Types.h>
00037 #include <GenApi/IBase.h>
00038
00039 #ifdef _MSC_VER
00040 # pragma warning ( push )
00041 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
00042 #endif
00043
00044 namespace GENAPI_NAMESPACE
00045 {
00046
00047
00048
00049
00054 interface GENAPI_DECL_ABSTRACT IPort : virtual public IBase
00055 {
00057 virtual void Read(void *pBuffer, int64_t Address, int64_t Length) = 0;
00058
00060 virtual void Write(const void *pBuffer, int64_t Address, int64_t Length) = 0;
00061 };
00062
00063
00064
00065
00066
00067 #ifndef DOXYGEN_IGNORE
00068
00074 template <class T>
00075 class CPortRefT : public CBaseRefT<T>
00076 {
00077 typedef CBaseRefT<T> ref;
00078
00079 public:
00080
00081
00082
00083
00085 virtual void Read(void *pBuffer, int64_t Address, int64_t Length)
00086 {
00087 if(ref::m_Ptr)
00088 return ref::m_Ptr->Read(pBuffer, Address, Length);
00089 else
00090 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00091 }
00092
00094 virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)
00095 {
00096 if(ref::m_Ptr)
00097 return ref::m_Ptr->Write(pBuffer, Address, Length);
00098 else
00099 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00100 }
00101
00102 };
00103
00106 typedef CPortRefT<IPort> CPortRef;
00107
00108 #endif
00109
00110 }
00111
00112 #ifdef _MSC_VER
00113 # pragma warning ( pop )
00114 #endif
00115
00116 #endif // ifndef GENAPI_IPORT_H