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  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() = 0;
74 
76  virtual int64_t GetAddress() = 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  return ref::m_Ptr->Set(pBuffer, Length, Verify);
106  else
107  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
108  }
109 
111  virtual void Get(uint8_t *pBuffer, int64_t Length, bool Verify = false, bool IgnoreCache = false)
112  {
113  if(ref::m_Ptr)
114  return ref::m_Ptr->Get(pBuffer, Length, Verify, IgnoreCache);
115  else
116  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
117  }
118 
120  virtual int64_t GetLength()
121  {
122  if(ref::m_Ptr)
123  return ref::m_Ptr->GetLength();
124  else
125  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
126  }
127 
129  virtual int64_t GetAddress()
130  {
131  if(ref::m_Ptr)
132  return ref::m_Ptr->GetAddress();
133  else
134  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
135  }
136 
137  };
138 
142 
143 #endif
144 
145 }
146 
147 #ifdef _MSC_VER
148 # pragma warning ( pop )
149 #endif
150 
151 #endif // ifndef GENAPI_IREGISTER_H
Common types used in the public GenApi interface.
__int64 int64_t
Definition: config-win32.h:21
virtual int64_t GetAddress()
Retrieves the Address of the register.
Definition: IRegister.h:129
virtual void Get(uint8_t *pBuffer, int64_t Length, bool Verify=false, bool IgnoreCache=false)
Fills a buffer with the register&#39;s contents.
Definition: IRegister.h:111
interface GENAPI_DECL_ABSTRACT IRegister
Interface for registers.
Definition: IRegister.h:61
CRegisterRefT< IRegister > CRegisterRef
Reference to an IRegister pointer.
Definition: IRegister.h:141
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:252
virtual void Set(const uint8_t *pBuffer, int64_t Length, bool Verify=true)
Set the register&#39;s contents.
Definition: IRegister.h:102
virtual int64_t GetLength()=0
Retrieves the Length of the register [Bytes].
interface GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition: IValue.h:61
interface GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
interface GENAPI_DECL_ABSTRACT int64_t int64_t Length
Definition: IPort.h:57
virtual int64_t GetAddress()=0
Retrieves the Address of the register.
virtual int64_t GetLength()
Retrieves the Length of the register [Bytes].
Definition: IRegister.h:120
declspec&#39;s to be used for GenApi Windows dll
virtual void Get(uint8_t *pBuffer, int64_t Length, bool Verify=false, bool IgnoreCache=false)=0
Fills a buffer with the register&#39;s contents.
Definition of the interface IValue.
Part of the generic device API.
Definition: Autovector.h:48


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:54