IRegister.h
Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //  (c) 2006 by Basler Vision Technologies
00003 //  Section: Vision Components
00004 //  Project: GenApi
00005 //  Author:  Margret Albrecht
00006 //  $Header$
00007 //
00008 //  License: This file is published under the license of the EMVA GenICam  Standard Group.
00009 //  A text file describing the legal terms is included in  your installation as 'GenICam_license.pdf'.
00010 //  If for some reason you are missing  this file please contact the EMVA or visit the website
00011 //  (http://www.genicam.org) for a full copy.
00012 //
00013 //  THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
00014 //  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00015 //  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00016 //  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD  GROUP
00017 //  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,  SPECIAL,
00018 //  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT  LIMITED TO,
00019 //  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  DATA, OR PROFITS;
00020 //  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  THEORY OF LIABILITY,
00021 //  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE)
00022 //  ARISING IN ANY WAY OUT OF THE USE  OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00023 //  POSSIBILITY OF SUCH DAMAGE.
00024 //-----------------------------------------------------------------------------
00031 #ifndef GENAPI_IREGISTER_H
00032 #define GENAPI_IREGISTER_H
00033 
00034 #include <GenApi/GenApiDll.h>
00035 #include <GenApi/Types.h>
00036 #include <GenApi/IValue.h>
00037 
00038 #pragma warning ( push )
00039 #pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
00040 
00041 namespace GENAPI_NAMESPACE
00042 {
00043     //*************************************************************
00044     // IRegister interface
00045     //*************************************************************
00046 
00051     interface GENAPI_DECL_ABSTRACT IRegister  : virtual public IValue
00052     {
00054 
00059         virtual void Set(const uint8_t *pBuffer, int64_t Length, bool Verify = true) = 0;
00060 
00062 
00068         virtual void Get(uint8_t *pBuffer, int64_t Length, bool Verify = false, bool IgnoreCache = false) = 0;
00069 
00071         virtual int64_t GetLength() = 0;
00072 
00074         virtual int64_t GetAddress() = 0;
00075     };
00076 
00077     //*************************************************************
00078     // CRegisterRef class
00079     //*************************************************************
00080 
00081 
00082 #ifndef DOXYGEN_IGNORE
00083 
00089     template <class T>
00090     class CRegisterRefT : public CValueRefT<T>
00091     {
00092         typedef CValueRefT<T> ref;
00093 
00094     public:
00095         /*--------------------------------------------------------*/
00096         // IRegister
00097         /*--------------------------------------------------------*/
00098 
00100         virtual void Set(const uint8_t *pBuffer, int64_t Length, bool Verify = true)
00101         {
00102             if(ref::m_Ptr)
00103                 return ref::m_Ptr->Set(pBuffer, Length, Verify);
00104             else
00105                 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00106         }
00107 
00109         virtual void Get(uint8_t *pBuffer, int64_t Length, bool Verify = false, bool IgnoreCache = false)
00110         {
00111             if(ref::m_Ptr)
00112                 return ref::m_Ptr->Get(pBuffer, Length, Verify, IgnoreCache);
00113             else
00114                 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00115         }
00116 
00118         virtual int64_t GetLength()
00119         {
00120             if(ref::m_Ptr)
00121                 return ref::m_Ptr->GetLength();
00122             else
00123                 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00124         }
00125 
00127         virtual int64_t GetAddress()
00128         {
00129             if(ref::m_Ptr)
00130                 return ref::m_Ptr->GetAddress();
00131             else
00132                 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00133         }
00134 
00135     };
00136 
00139     typedef CRegisterRefT<IRegister> CRegisterRef;
00140 
00141 #endif
00142 
00143 }
00144 
00145 #pragma warning ( pop )
00146 
00147 #endif // ifndef GENAPI_IREGISTER_H


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:05