IFloat.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_IFLOAT_H
32 #define GENAPI_IFLOAT_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  // IFloat interface
47  //*************************************************************
48 
53  interface GENAPI_DECL_ABSTRACT IFloat : virtual public IValue
54  {
56 
60  virtual void SetValue(double Value, bool Verify = true) = 0;
61 
63  virtual IFloat& operator=(double Value) = 0;
64 
66 
71  virtual double GetValue(bool Verify = false, bool IgnoreCache = false) = 0;
72 
74  virtual double operator()() = 0;
75 
77  virtual double operator*() = 0;
78 
80  virtual double GetMin() = 0;
81 
83  virtual double GetMax() = 0;
84 
86  virtual bool HasInc() = 0;
87 
89  virtual EIncMode GetIncMode() = 0;
90 
92  virtual double GetInc() = 0;
93 
95  virtual double_autovector_t GetListOfValidValues( bool bounded = true) = 0;
96 
98  virtual ERepresentation GetRepresentation() = 0;
99 
101  virtual GENICAM_NAMESPACE::gcstring GetUnit() const = 0;
102 
104  virtual EDisplayNotation GetDisplayNotation() const = 0;
105 
107  virtual int64_t GetDisplayPrecision() const = 0;
108 
110  virtual void ImposeMin(double Value) = 0;
111 
113  virtual void ImposeMax(double Value) = 0;
114  };
115 
116  //*************************************************************
117  // CFloatRef class
118  //*************************************************************
119 
120  interface IInteger;
121  interface IEnumeration;
122 
123 #ifndef DOXYGEN_IGNORE
124 
130  template <class T>
131  class CFloatRefT : public CValueRefT<T>
132  {
134 
135  public:
136  /*--------------------------------------------------------*/
137  // IFloat
138  /*--------------------------------------------------------*/
139 
141  virtual void SetValue(double Value, bool Verify = true)
142  {
143  if(ref::m_Ptr)
144  return ref::m_Ptr->SetValue(Value, Verify);
145  else
146  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
147  }
148 
150  virtual IFloat& operator=(double Value)
151  {
152  if(ref::m_Ptr)
153  return ref::m_Ptr->operator=(Value);
154  else
155  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
156  }
157 
159  virtual double GetValue(bool Verify = false, bool IgnoreCache = false)
160  {
161  if(ref::m_Ptr)
162  return ref::m_Ptr->GetValue(Verify, IgnoreCache);
163  else
164  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
165  }
166 
168  virtual double operator()()
169  {
170  if(ref::m_Ptr)
171  return ref::m_Ptr->operator()();
172  else
173  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
174  }
175 
177  virtual double operator*()
178  {
179  if(ref::m_Ptr)
180  return ref::m_Ptr->operator*();
181  else
182  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
183  }
184 
186  virtual double GetMin()
187  {
188  if(ref::m_Ptr)
189  return ref::m_Ptr->GetMin();
190  else
191  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
192  }
193 
195  virtual double GetMax()
196  {
197  if(ref::m_Ptr)
198  return ref::m_Ptr->GetMax();
199  else
200  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
201  }
202 
204  virtual bool HasInc()
205  {
206  if(ref::m_Ptr)
207  return ref::m_Ptr->HasInc();
208  else
209  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
210  }
212  {
213  if(ref::m_Ptr)
214  return ref::m_Ptr->GetIncMode();
215  else
216  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
217  }
218 
220  virtual double GetInc()
221  {
222  if(ref::m_Ptr)
223  return ref::m_Ptr->GetInc();
224  else
225  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
226  }
227 
229  virtual double_autovector_t GetListOfValidValues(bool bounded = true)
230  {
231  if(ref::m_Ptr)
232  return ref::m_Ptr->GetListOfValidValues(bounded);
233  else
234  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
235  }
236 
239  {
240  if(ref::m_Ptr)
241  return ref::m_Ptr->GetRepresentation();
242  else
243  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
244  }
245 
248  {
249  if (ref::m_Ptr)
250  return ref::m_Ptr->GetUnit();
251  else
252  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
253  }
254 
257  {
258  if (ref::m_Ptr)
259  return ref::m_Ptr->GetDisplayNotation();
260  else
261  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
262  }
263 
265  virtual int64_t GetDisplayPrecision() const
266  {
267  if (ref::m_Ptr)
268  return ref::m_Ptr->GetDisplayPrecision();
269  else
270  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
271  }
272 
275  {
276  if (ref::m_Ptr)
277  return dynamic_cast<IInteger*>(ref::m_Ptr->GetNode()->GetCastAlias());
278  else
279  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
280  }
281 
284  {
285  if (ref::m_Ptr)
286  return dynamic_cast<IEnumeration*>(ref::m_Ptr->GetNode()->GetCastAlias());
287  else
288  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
289  }
290 
292  virtual void ImposeMin(double Value)
293  {
294  if(ref::m_Ptr)
295  return ref::m_Ptr->ImposeMin(Value);
296  else
297  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
298  }
299 
301  virtual void ImposeMax(double Value)
302  {
303  if(ref::m_Ptr)
304  return ref::m_Ptr->ImposeMax(Value);
305  else
306  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
307  }
308 
309  };
310 
314 
315 #endif
316 
317 }
318 
319 #ifdef _MSC_VER
320 # pragma warning ( pop )
321 #endif
322 
323 #endif // ifndef GENAPI_IFLOAT_H
virtual EIncMode GetIncMode()=0
Get increment mode.
virtual void SetValue(double Value, bool Verify=true)
Set node value.
Definition: IFloat.h:141
virtual IFloat & operator=(double Value)
Set node value.
Definition: IFloat.h:150
virtual ERepresentation GetRepresentation()
Get recommended representation.
Definition: IFloat.h:238
Common types used in the public GenApi interface.
virtual void ImposeMin(double Value)
Restrict minimum value.
Definition: IFloat.h:292
virtual int64_t GetDisplayPrecision() const
Get the precision to be used when converting the float to a string.
Definition: IFloat.h:265
virtual double_autovector_t GetListOfValidValues(bool bounded=true)
Get list of valid value.
Definition: IFloat.h:229
IEnumeration * GetEnumAlias()
gets the interface of an alias node.
Definition: IFloat.h:283
virtual GENICAM_NAMESPACE::gcstring GetUnit() const =0
Get the physical unit name.
virtual double GetMin()
Get minimum value allowed.
Definition: IFloat.h:186
virtual int64_t GetDisplayPrecision() const =0
Get the precision to be used when converting the float to a string.
virtual double_autovector_t GetListOfValidValues(bool bounded=true)=0
Get list of valid value.
virtual double GetInc()
Get the constant increment if there is any.
Definition: IFloat.h:220
IInteger * GetIntAlias()
gets the interface of an alias node.
Definition: IFloat.h:274
virtual bool HasInc()
True if the float has a constant increment.
Definition: IFloat.h:204
virtual bool GetValue(bool Verify=false, bool IgnoreCache=false) const =0
Get node value.
virtual void operator=(bool Value)
Set node value.
Definition: IBoolean.h:64
Vector of doubles with reference counting.
Definition: Autovector.h:76
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 EIncMode GetIncMode()
Definition: IFloat.h:211
virtual void ImposeMin(double Value)=0
Restrict minimum value.
virtual void ImposeMax(double Value)=0
Restrict maximum value.
interface GENAPI_DECL_ABSTRACT IEnumeration
Interface for enumeration properties.
Definition: IEnumeration.h:60
interface GENAPI_DECL_ABSTRACT IInteger
Interface for integer properties.
Definition: IInteger.h:61
interface GENAPI_DECL_ABSTRACT IFloat
Interface for float properties.
Definition: IFloat.h:60
virtual double GetMax()
Get maximum value allowed.
Definition: IFloat.h:195
CFloatRefT< IFloat > CFloatRef
Reference to an IFloat pointer.
Definition: IFloat.h:313
enum GENAPI_NAMESPACE::_ERepresentation ERepresentation
recommended representation of a node value
enum GENAPI_NAMESPACE::_EDisplayNotation EDisplayNotation
typedef for float notation
virtual EDisplayNotation GetDisplayNotation() const =0
Get the way the float should be converted to a string.
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:252
virtual double GetValue(bool Verify=false, bool IgnoreCache=false)
Get node value.
Definition: IFloat.h:159
interface GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition: IValue.h:61
interface GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
virtual double GetInc()=0
Get the constant increment if there is any.
CValueRefT< T > ref
Definition: IFloat.h:133
virtual double operator()()
Get node value.
Definition: IFloat.h:168
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 void ImposeMax(double Value)
Restrict maximum value.
Definition: IFloat.h:301
virtual double operator*()
Get node value.
Definition: IFloat.h:177
virtual double GetMax()=0
Get maximum value allowed.
enum GENAPI_NAMESPACE::_EIncMode EIncMode
typedef for increment mode
declspec&#39;s to be used for GenApi Windows dll
Definition of the interface IValue.
virtual GENICAM_NAMESPACE::gcstring GetUnit() const
Get unit.
Definition: IFloat.h:247
Part of the generic device API.
Definition: Autovector.h:48
virtual EDisplayNotation GetDisplayNotation() const
Get the way the float should be converted to a string.
Definition: IFloat.h:256
virtual bool HasInc()=0
True if the float has a constant increment.


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