IInteger.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: Fritz Dierks
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_IIINTEGER_H
32 #define GENAPI_IIINTEGER_H
33 
34 #include <Base/GCUtilities.h>
35 #include <GenApi/GenApiDll.h>
36 #include <GenApi/Types.h>
37 #include <GenApi/IValue.h>
38 
39 #ifdef _MSC_VER
40 # pragma warning ( push )
41 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
42 #endif
43 
44 namespace GENAPI_NAMESPACE
45 {
46  //*************************************************************
47  // IInteger interface
48  //*************************************************************
49 
54  GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IInteger : virtual public IValue
55  {
57 
61  virtual void SetValue(int64_t Value, bool Verify = true) = 0;
62 
64  virtual IInteger& operator=(int64_t Value) = 0;
65 
67 
72  virtual int64_t GetValue(bool Verify = false, bool IgnoreCache = false ) = 0;
73 
75  virtual int64_t operator()() = 0;
76 
78  virtual int64_t operator*() = 0;
79 
81  virtual int64_t GetMin() = 0;
82 
84  virtual int64_t GetMax() = 0;
85 
87  virtual EIncMode GetIncMode() = 0;
88 
90  virtual int64_t GetInc() = 0;
91 
93  virtual int64_autovector_t GetListOfValidValues(bool bounded = true) = 0;
94 
96  virtual ERepresentation GetRepresentation() = 0;
97 
100 
102  virtual void ImposeMin(int64_t Value) = 0;
103 
105  virtual void ImposeMax(int64_t Value) = 0;
106  };
107 
108 
109  //*************************************************************
110  // CIntegerRef class
111  //*************************************************************
112 
113 #ifndef DOXYGEN_IGNORE
114 
116 
122  template <class T, class I=T>
123  class CIntegerRefT : public CValueRefT<T, I>
124  {
126 
127  public:
128  /*--------------------------------------------------------*/
129  // IInteger
130  /*--------------------------------------------------------*/
131 
133  virtual void SetValue(int64_t Value, bool Verify = true)
134  {
135  if(ref::m_Ptr)
136  return ref::m_Ptr->SetValue(Value, Verify);
137  else
138  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
139  }
140 
142  virtual IInteger& operator=(int64_t Value)
143  {
144  if(ref::m_Ptr)
145  {
146  ref::m_Ptr->SetValue(Value);
147  return *this;
148  }
149  else
150  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
151  }
152 
154  virtual int64_t GetValue( bool Verify = false, bool IgnoreCache = false )
155  {
156  if(ref::m_Ptr)
157  return ref::m_Ptr->GetValue( Verify, IgnoreCache );
158  else
159  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
160  }
161 
163  virtual int64_t operator()()
164  {
165  if(ref::m_Ptr)
166  return ref::m_Ptr->operator()();
167  else
168  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
169  }
170 
172  virtual int64_t operator*()
173  {
174  if(ref::m_Ptr)
175  return ref::m_Ptr->operator*();
176  else
177  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
178  }
179 
181  virtual int64_t GetMin()
182  {
183  if(ref::m_Ptr)
184  return ref::m_Ptr->GetMin();
185  else
186  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
187  }
188 
190  virtual int64_t GetMax()
191  {
192  if(ref::m_Ptr)
193  return ref::m_Ptr->GetMax();
194  else
195  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
196  }
197 
200  {
201  if(ref::m_Ptr)
202  return ref::m_Ptr->GetIncMode();
203  else
204  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
205  }
206 
208  virtual int64_t GetInc()
209  {
210  if(ref::m_Ptr)
211  return ref::m_Ptr->GetInc();
212  else
213  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
214  }
215 
217  virtual int64_autovector_t GetListOfValidValues(bool bounded = true)
218  {
219  if(ref::m_Ptr)
220  return ref::m_Ptr->GetListOfValidValues( bounded );
221  else
222  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
223 
224  }
225 
228  {
229  if(ref::m_Ptr)
230  return ref::m_Ptr->GetRepresentation();
231  else
232  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
233  }
234 
237  {
238  if(ref::m_Ptr)
239  return ref::m_Ptr->GetUnit();
240  else
241  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
242  }
243 
245  IFloat *GetFloatAlias()
246  {
247  if(ref::m_Ptr)
248  return dynamic_cast<IFloat*>(ref::m_Ptr->GetNode()->GetCastAlias());
249  else
250  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
251  }
252 
254  virtual void ImposeMin(int64_t Value)
255  {
256  if(ref::m_Ptr)
257  return ref::m_Ptr->ImposeMin(Value);
258  else
259  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
260  }
261 
263  virtual void ImposeMax(int64_t Value)
264  {
265  if(ref::m_Ptr)
266  return ref::m_Ptr->ImposeMax(Value);
267  else
268  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
269  }
270 
271  };
272 
276 
277 #endif
278 
279 }
280 
281 #ifdef _MSC_VER
282 # pragma warning ( pop )
283 #endif
284 
285 #endif // ifndef GENAPI_IIINTEGER_H
virtual EIncMode GetIncMode()=0
Get increment mode.
#define GENICAM_INTERFACE
Definition: GenICamFwd.h:33
virtual int64_t operator*()
Get node value.
Definition: IInteger.h:172
Common types used in the public GenApi interface.
virtual void ImposeMax(int64_t Value)
Restrict maximum value.
Definition: IInteger.h:263
virtual int64_t operator()()
Get node value.
Definition: IInteger.h:163
virtual GENICAM_NAMESPACE::gcstring GetUnit() const =0
Get the physical unit name.
GENICAM_INTERFACE IInteger
Interface for integer properties.
Definition: IFloat.h:114
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
virtual ERepresentation GetRepresentation()
Get recommended representation.
Definition: IInteger.h:227
virtual double_autovector_t GetListOfValidValues(bool bounded=true)=0
Get list of valid value.
virtual bool GetValue(bool Verify=false, bool IgnoreCache=false) const =0
Get node value.
IFloat * GetFloatAlias()
gets the interface of an alias node.
Definition: IInteger.h:245
virtual void SetValue(int64_t Value, bool Verify=true)
Set node value.
Definition: IInteger.h:133
virtual void operator=(bool Value)
Set node value.
Definition: IBoolean.h:64
virtual ERepresentation GetRepresentation()=0
Get recommended representation.
virtual bool operator()() const
Get node value.
Definition: IBoolean.h:75
__int64 int64_t
Definition: config-win32.h:21
virtual GENICAM_NAMESPACE::gcstring GetUnit()
Get the physical unit name.
Definition: IInteger.h:236
virtual int64_autovector_t GetListOfValidValues(bool bounded=true)
Implementation of IInteger::GetListOfValidValues.
Definition: IInteger.h:217
virtual EIncMode GetIncMode()
Get increment.
Definition: IInteger.h:199
virtual int64_t GetMax()
Get maximum value allowed.
Definition: IInteger.h:190
virtual void ImposeMin(double Value)=0
Restrict minimum value.
virtual void ImposeMax(double Value)=0
Restrict maximum value.
virtual int64_t GetValue(bool Verify=false, bool IgnoreCache=false)
Get node value.
Definition: IInteger.h:154
enum GENAPI_NAMESPACE::_ERepresentation ERepresentation
recommended representation of a node value
Vector of integers with reference counting.
Definition: Autovector.h:54
virtual double GetMin()=0
Get minimum value allowed.
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:253
I * m_Ptr
Pointer to the implementation the reference references to.
Definition: Reference.h:101
CValueRefT< T, I > ref
Definition: IInteger.h:125
virtual double GetInc()=0
Get the constant increment if there is any.
virtual int64_t GetInc()
Get increment.
Definition: IInteger.h:208
CIntegerRefT< IInteger > CIntegerRef
Reference to an IInteger pointer.
Definition: IInteger.h:275
virtual GENICAM_NAMESPACE::gcstring operator*()=0
Get string node value.
A string class which is a clone of std::string.
Definition: GCString.h:52
virtual int64_t GetMin()
Get minimum value allowed.
Definition: IInteger.h:181
virtual IInteger & operator=(int64_t Value)
Set node value.
Definition: IInteger.h:142
virtual double GetMax()=0
Get maximum value allowed.
enum GENAPI_NAMESPACE::_EIncMode EIncMode
typedef for increment mode
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IFloat
Interface for float properties.
Definition: IFloat.h:60
declspec&#39;s to be used for GenApi Windows dll
Definition of the interface IValue.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition: IValue.h:61
Lexical analyzer for CIntSwissKnife.
Definition: Autovector.h:48
GenICam common utilities.
virtual void ImposeMin(int64_t Value)
Restrict minimum value.
Definition: IInteger.h:254


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Mar 17 2021 02:48:40