IRegister.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2006 by Basler Vision Technologies
3 // Section: Vision Components
4 // Project: GenApi
5 // Author: Margret Albrecht
6 // $Header$
7 //
8 // License: This file is published under the license of the EMVA GenICam Standard Group.
9 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
10 // If for some reason you are missing this file please contact the EMVA or visit the website
11 // (http://www.genicam.org) for a full copy.
12 //
13 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
14 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
17 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 // POSSIBILITY OF SUCH DAMAGE.
24 //-----------------------------------------------------------------------------
31 #ifndef GENAPI_IREGISTER_H
32 #define GENAPI_IREGISTER_H
33 
34 #include <GenApi/GenApiDll.h>
35 #include <GenApi/Types.h>
36 #include <GenApi/IValue.h>
37 
38 #ifdef _MSC_VER
39 # pragma warning ( push )
40 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
41 #endif
42 
43 namespace GENAPI_NAMESPACE
44 {
45  //*************************************************************
46  // IRegister interface
47  //*************************************************************
48 
53  GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IRegister : virtual public IValue
54  {
56 
61  virtual void Set(const uint8_t *pBuffer, int64_t Length, bool Verify = true) = 0;
62 
64 
70  virtual void Get(uint8_t *pBuffer, int64_t Length, bool Verify = false, bool IgnoreCache = false) = 0;
71 
73  virtual int64_t GetLength( bool Verify = false ) = 0;
74 
76  virtual int64_t GetAddress( bool Verify = false ) = 0;
77  };
78 
79  //*************************************************************
80  // CRegisterRef class
81  //*************************************************************
82 
83 
84 #ifndef DOXYGEN_IGNORE
85 
91  template <class T>
92  class CRegisterRefT : public CValueRefT<T>
93  {
94  typedef CValueRefT<T> ref;
95 
96  public:
97  /*--------------------------------------------------------*/
98  // IRegister
99  /*--------------------------------------------------------*/
100 
102  virtual void Set(const uint8_t *pBuffer, int64_t Length, bool Verify = true)
103  {
104  if(!ref::m_Ptr)
105  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
106  ref::m_Ptr->Set(pBuffer, Length, Verify);
107  }
108 
110  virtual void Get(uint8_t *pBuffer, int64_t Length, bool Verify = false, bool IgnoreCache = false)
111  {
112  if(!ref::m_Ptr)
113  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
114  ref::m_Ptr->Get(pBuffer, Length, Verify, IgnoreCache);
115  }
116 
118  virtual int64_t GetLength(bool Verify = false)
119  {
120  if (!ref::m_Ptr)
121  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
122  return ref::m_Ptr->GetLength( Verify );
123  }
124 
126  virtual int64_t GetAddress(bool Verify=false)
127  {
128  if (!ref::m_Ptr)
129  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
130  return ref::m_Ptr->GetAddress(Verify);
131  }
132 
133  };
134 
138 
139 #endif
140 
141 }
142 
143 #ifdef _MSC_VER
144 # pragma warning ( pop )
145 #endif
146 
147 #endif // ifndef GENAPI_IREGISTER_H
GENAPI_NAMESPACE
Lexical analyzer for CIntSwissKnife.
Definition: Destructible.h:30
Types.h
Common types used in the public GenApi interface.
GENICAM_INTERFACE
#define GENICAM_INTERFACE
Definition: GenICamFwd.h:33
GENAPI_NAMESPACE::CRegisterRefT
Definition: IRegister.h:92
GENAPI_NAMESPACE::CRegisterRefT::Get
virtual void Get(uint8_t *pBuffer, int64_t Length, bool Verify=false, bool IgnoreCache=false)
Fills a buffer with the register's contents.
Definition: IRegister.h:110
GENAPI_NAMESPACE::CValueRefT
Definition: IValue.h:95
GENAPI_NAMESPACE::GetAddress
virtual int64_t GetAddress(bool Verify=false)=0
Retrieves the Address of the register.
GENAPI_NAMESPACE::IRegister
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IRegister
Interface for registers.
Definition: IRegister.h:61
GENAPI_NAMESPACE::GetLength
virtual int64_t GetLength(bool Verify=false)=0
Retrieves the Length of the register [Bytes].
GENAPI_NAMESPACE::Verify
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
GENAPI_NAMESPACE::CRegisterRef
CRegisterRefT< IRegister > CRegisterRef
Reference to an IRegister pointer.
Definition: IRegister.h:137
GENAPI_NAMESPACE::Length
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t int64_t Length
Definition: IPort.h:57
GENAPI_NAMESPACE::IValue
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition: IValue.h:61
ACCESS_EXCEPTION
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:253
int64_t
__int64 int64_t
Definition: config-win32.h:21
GENAPI_NAMESPACE::CReferenceT< T, T >::m_Ptr
T * m_Ptr
Pointer to the implementation the reference references to.
Definition: Reference.h:101
GENAPI_NAMESPACE::CRegisterRefT::Set
virtual void Set(const uint8_t *pBuffer, int64_t Length, bool Verify=true)
Set the register's contents.
Definition: IRegister.h:102
GENAPI_NAMESPACE::CRegisterRefT::ref
CValueRefT< T > ref
Definition: IRegister.h:94
IValue.h
Definition of the interface IValue.
GenApiDll.h
declspec's to be used for GenApi Windows dll
GENAPI_NAMESPACE::CRegisterRefT::GetLength
virtual int64_t GetLength(bool Verify=false)
Retrieves the Length of the register [Bytes].
Definition: IRegister.h:118
GENAPI_NAMESPACE::Get
virtual void Get(uint8_t *pBuffer, int64_t Length, bool Verify=false, bool IgnoreCache=false)=0
Fills a buffer with the register's contents.
GENAPI_NAMESPACE::CRegisterRefT::GetAddress
virtual int64_t GetAddress(bool Verify=false)
Retrieves the Address of the register.
Definition: IRegister.h:126


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:11