All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  GENICAM_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 
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  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
145  ref::m_Ptr->SetValue(Value, Verify);
146  }
147 
149  virtual IFloat& operator=(double Value)
150  {
151  if(!ref::m_Ptr)
152  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
153  return ref::m_Ptr->operator=(Value);
154  }
155 
157  virtual double GetValue(bool Verify = false, bool IgnoreCache = false)
158  {
159  if(!ref::m_Ptr)
160  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
161  return ref::m_Ptr->GetValue(Verify, IgnoreCache);
162  }
163 
165  virtual double operator()()
166  {
167  if(!ref::m_Ptr)
168  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
169  return ref::m_Ptr->operator()();
170  }
171 
173  virtual double operator*()
174  {
175  if(!ref::m_Ptr)
176  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
177  return ref::m_Ptr->operator*();
178  }
179 
181  virtual double GetMin()
182  {
183  if(!ref::m_Ptr)
184  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
185  return ref::m_Ptr->GetMin();
186  }
187 
189  virtual double GetMax()
190  {
191  if(!ref::m_Ptr)
192  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
193  return ref::m_Ptr->GetMax();
194  }
195 
197  virtual bool HasInc()
198  {
199  if(!ref::m_Ptr)
200  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
201  return ref::m_Ptr->HasInc();
202  }
204  {
205  if(!ref::m_Ptr)
206  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
207  return ref::m_Ptr->GetIncMode();
208  }
209 
211  virtual double GetInc()
212  {
213  if(!ref::m_Ptr)
214  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
215  return ref::m_Ptr->GetInc();
216  }
217 
219  virtual double_autovector_t GetListOfValidValues(bool bounded = true)
220  {
221  if(!ref::m_Ptr)
222  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
223  return ref::m_Ptr->GetListOfValidValues(bounded);
224  }
225 
228  {
229  if(!ref::m_Ptr)
230  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
231  return ref::m_Ptr->GetRepresentation();
232  }
233 
236  {
237  if (!ref::m_Ptr)
238  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
239  return ref::m_Ptr->GetUnit();
240  }
241 
244  {
245  if (!ref::m_Ptr)
246  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
247  return ref::m_Ptr->GetDisplayNotation();
248  }
249 
251  virtual int64_t GetDisplayPrecision() const
252  {
253  if(!ref::m_Ptr)
254  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
255  return ref::m_Ptr->GetDisplayPrecision();
256  }
257 
260  {
261  if (!ref::m_Ptr)
262  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
263  return dynamic_cast<IInteger*>(ref::m_Ptr->GetNode()->GetCastAlias());
264  }
265 
268  {
269  if(!ref::m_Ptr)
270  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
271  return dynamic_cast<IEnumeration*>(ref::m_Ptr->GetNode()->GetCastAlias());
272  }
273 
275  virtual void ImposeMin(double Value)
276  {
277  if(!ref::m_Ptr)
278  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
279  ref::m_Ptr->ImposeMin(Value);
280  }
281 
283  virtual void ImposeMax(double Value)
284  {
285  if(!ref::m_Ptr)
286  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
287  ref::m_Ptr->ImposeMax(Value);
288  }
289 
290  };
291 
295 
296 #endif
297 
298 }
299 
300 #ifdef _MSC_VER
301 # pragma warning ( pop )
302 #endif
303 
304 #endif // ifndef GENAPI_IFLOAT_H
GENAPI_NAMESPACE::IInteger
GENICAM_INTERFACE IInteger
Interface for integer properties.
Definition: IFloat.h:114
GENAPI_NAMESPACE
Lexical analyzer for CIntSwissKnife.
Definition: Destructible.h:30
GENAPI_NAMESPACE::CFloatRefT::GetValue
virtual double GetValue(bool Verify=false, bool IgnoreCache=false)
Get node value.
Definition: IFloat.h:157
GENAPI_NAMESPACE::GetIncMode
virtual EIncMode GetIncMode()=0
Get increment mode.
GENAPI_NAMESPACE::CFloatRefT::operator=
virtual IFloat & operator=(double Value)
Set node value.
Definition: IFloat.h:149
GENAPI_NAMESPACE::CFloatRefT::GetMax
virtual double GetMax()
Get maximum value allowed.
Definition: IFloat.h:189
GENAPI_NAMESPACE::CFloatRefT::GetMin
virtual double GetMin()
Get minimum value allowed.
Definition: IFloat.h:181
Types.h
Common types used in the public GenApi interface.
GENAPI_NAMESPACE::double_autovector_t
Vector of doubles with reference counting.
Definition: Autovector.h:76
GENAPI_NAMESPACE::EDisplayNotation
enum GENAPI_NAMESPACE::_EDisplayNotation EDisplayNotation
typedef for float notation
GENAPI_NAMESPACE::CFloatRefT::ImposeMax
virtual void ImposeMax(double Value)
Restrict maximum value.
Definition: IFloat.h:283
GENICAM_INTERFACE
#define GENICAM_INTERFACE
Definition: GenICamFwd.h:33
GENICAM_NAMESPACE::gcstring
A string class which is a clone of std::string.
Definition: GCString.h:52
GENAPI_NAMESPACE::CFloatRefT::GetRepresentation
virtual ERepresentation GetRepresentation()
Get recommended representation.
Definition: IFloat.h:227
GENAPI_NAMESPACE::CFloatRefT::ImposeMin
virtual void ImposeMin(double Value)
Restrict minimum value.
Definition: IFloat.h:275
GENAPI_NAMESPACE::CValueRefT
Definition: IValue.h:95
GENAPI_NAMESPACE::GetRepresentation
virtual ERepresentation GetRepresentation()=0
Get recommended representation.
GENAPI_NAMESPACE::GetMax
virtual double GetMax()=0
Get maximum value allowed.
GENAPI_NAMESPACE::CFloatRefT::GetListOfValidValues
virtual double_autovector_t GetListOfValidValues(bool bounded=true)
Get list of valid value.
Definition: IFloat.h:219
GENAPI_NAMESPACE::EIncMode
enum GENAPI_NAMESPACE::_EIncMode EIncMode
typedef for increment mode
GENAPI_NAMESPACE::CFloatRefT::GetInc
virtual double GetInc()
Get the constant increment if there is any.
Definition: IFloat.h:211
GENAPI_NAMESPACE::GetInc
virtual double GetInc()=0
Get the constant increment if there is any.
GENAPI_NAMESPACE::CFloatRefT::HasInc
virtual bool HasInc()
True if the float has a constant increment.
Definition: IFloat.h:197
GENAPI_NAMESPACE::ERepresentation
enum GENAPI_NAMESPACE::_ERepresentation ERepresentation
recommended representation of a node value
GENAPI_NAMESPACE::Verify
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
GENAPI_NAMESPACE::CFloatRefT::GetDisplayPrecision
virtual int64_t GetDisplayPrecision() const
Get the precision to be used when converting the float to a string.
Definition: IFloat.h:251
GENAPI_NAMESPACE::operator*
virtual GENICAM_NAMESPACE::gcstring operator*()=0
Get string node value.
GENAPI_NAMESPACE::ImposeMax
virtual void ImposeMax(double Value)=0
Restrict maximum value.
GENAPI_NAMESPACE::CFloatRefT::GetUnit
virtual GENICAM_NAMESPACE::gcstring GetUnit() const
Get unit.
Definition: IFloat.h:235
GENAPI_NAMESPACE::IEnumeration
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IEnumeration
Interface for enumeration properties.
Definition: IEnumeration.h:60
GENAPI_NAMESPACE::CFloatRefT::operator*
virtual double operator*()
Get node value.
Definition: IFloat.h:173
GENAPI_NAMESPACE::ImposeMin
virtual void ImposeMin(double Value)=0
Restrict minimum value.
GENAPI_NAMESPACE::CFloatRefT
Definition: IFloat.h:131
GENAPI_NAMESPACE::IFloat
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IFloat
Interface for float properties.
Definition: IFloat.h:60
GENAPI_NAMESPACE::CFloatRefT::GetIncMode
virtual EIncMode GetIncMode()
Definition: IFloat.h:203
GENAPI_NAMESPACE::GetUnit
virtual GENICAM_NAMESPACE::gcstring GetUnit() const =0
Get the physical unit name.
GENAPI_NAMESPACE::CFloatRefT::ref
CValueRefT< T > ref
Definition: IFloat.h:133
GENAPI_NAMESPACE::IValue
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition: IValue.h:61
GENAPI_NAMESPACE::CFloatRefT::GetDisplayNotation
virtual EDisplayNotation GetDisplayNotation() const
Get the way the float should be converted to a string.
Definition: IFloat.h:243
GENAPI_NAMESPACE::CFloatRefT::GetIntAlias
IInteger * GetIntAlias()
gets the interface of an alias node.
Definition: IFloat.h:259
GENAPI_NAMESPACE::CFloatRefT::SetValue
virtual void SetValue(double Value, bool Verify=true)
Set node value.
Definition: IFloat.h:141
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::GetValue
virtual bool GetValue(bool Verify=false, bool IgnoreCache=false) const =0
Get node value.
GENAPI_NAMESPACE::CReferenceT< T, T >::m_Ptr
T * m_Ptr
Pointer to the implementation the reference references to.
Definition: Reference.h:101
IValue.h
Definition of the interface IValue.
GENAPI_NAMESPACE::GetDisplayNotation
virtual EDisplayNotation GetDisplayNotation() const =0
Get the way the float should be converted to a string.
GENAPI_NAMESPACE::GetMin
virtual double GetMin()=0
Get minimum value allowed.
GENAPI_NAMESPACE::CFloatRefT::GetEnumAlias
IEnumeration * GetEnumAlias()
gets the interface of an alias node.
Definition: IFloat.h:267
GENAPI_NAMESPACE::HasInc
virtual bool HasInc()=0
True if the float has a constant increment.
GENAPI_NAMESPACE::GetDisplayPrecision
virtual int64_t GetDisplayPrecision() const =0
Get the precision to be used when converting the float to a string.
GENAPI_NAMESPACE::operator()
virtual bool operator()() const
Get node value.
Definition: IBoolean.h:79
GENAPI_NAMESPACE::operator=
virtual IBoolean & operator=(bool Value)
Set node value.
Definition: IBoolean.h:64
GenApiDll.h
declspec's to be used for GenApi Windows dll
GENAPI_NAMESPACE::GetListOfValidValues
virtual double_autovector_t GetListOfValidValues(bool bounded=true)=0
Get list of valid value.
GENAPI_NAMESPACE::CFloatRef
CFloatRefT< IFloat > CFloatRef
Reference to an IFloat pointer.
Definition: IFloat.h:294
GENAPI_NAMESPACE::CFloatRefT::operator()
virtual double operator()()
Get node value.
Definition: IFloat.h:165


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