All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
137  ref::m_Ptr->SetValue(Value, Verify);
138  }
139 
141  virtual IInteger& operator=(int64_t Value)
142  {
143  if(!ref::m_Ptr)
144  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
145  ref::m_Ptr->SetValue(Value);
146  return *this;
147  }
148 
150  virtual int64_t GetValue( bool Verify = false, bool IgnoreCache = false )
151  {
152  if(!ref::m_Ptr)
153  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
154  return ref::m_Ptr->GetValue( Verify, IgnoreCache );
155  }
156 
158  virtual int64_t operator()()
159  {
160  if(!ref::m_Ptr)
161  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
162  return ref::m_Ptr->operator()();
163  }
164 
166  virtual int64_t operator*()
167  {
168  if(!ref::m_Ptr)
169  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
170  return ref::m_Ptr->operator*();
171  }
172 
174  virtual int64_t GetMin()
175  {
176  if(!ref::m_Ptr)
177  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
178  return ref::m_Ptr->GetMin();
179  }
180 
182  virtual int64_t GetMax()
183  {
184  if(!ref::m_Ptr)
185  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
186  return ref::m_Ptr->GetMax();
187  }
188 
191  {
192  if(!ref::m_Ptr)
193  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
194  return ref::m_Ptr->GetIncMode();
195  }
196 
198  virtual int64_t GetInc()
199  {
200  if(!ref::m_Ptr)
201  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
202  return ref::m_Ptr->GetInc();
203  }
204 
206  virtual int64_autovector_t GetListOfValidValues(bool bounded = true)
207  {
208  if(!ref::m_Ptr)
209  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
210  return ref::m_Ptr->GetListOfValidValues(bounded);
211  }
212 
215  {
216  if(!ref::m_Ptr)
217  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
218  return ref::m_Ptr->GetRepresentation();
219  }
220 
223  {
224  if(!ref::m_Ptr)
225  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
226  return ref::m_Ptr->GetUnit();
227  }
228 
231  {
232  if(!ref::m_Ptr)
233  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
234  return dynamic_cast<IFloat*>(ref::m_Ptr->GetNode()->GetCastAlias());
235  }
236 
238  virtual void ImposeMin(int64_t Value)
239  {
240  if(!ref::m_Ptr)
241  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
242  ref::m_Ptr->ImposeMin(Value);
243  }
244 
246  virtual void ImposeMax(int64_t Value)
247  {
248  if(!ref::m_Ptr)
249  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
250  ref::m_Ptr->ImposeMax(Value);
251  }
252 
253  };
254 
258 
259 #endif
260 
261 }
262 
263 #ifdef _MSC_VER
264 # pragma warning ( pop )
265 #endif
266 
267 #endif // ifndef GENAPI_IIINTEGER_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::CIntegerRefT::ImposeMax
virtual void ImposeMax(int64_t Value)
Restrict maximum value.
Definition: IInteger.h:246
GENAPI_NAMESPACE::GetIncMode
virtual EIncMode GetIncMode()=0
Get increment mode.
GENAPI_NAMESPACE::CIntegerRefT::GetMax
virtual int64_t GetMax()
Get maximum value allowed.
Definition: IInteger.h:182
Types.h
Common types used in the public GenApi interface.
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::CIntegerRefT::GetListOfValidValues
virtual int64_autovector_t GetListOfValidValues(bool bounded=true)
Implementation of IInteger::GetListOfValidValues.
Definition: IInteger.h:206
GENAPI_NAMESPACE::CIntegerRefT::GetIncMode
virtual EIncMode GetIncMode()
Get increment.
Definition: IInteger.h:190
GENAPI_NAMESPACE::CValueRefT
Definition: IValue.h:95
GENAPI_NAMESPACE::GetRepresentation
virtual ERepresentation GetRepresentation()=0
Get recommended representation.
GENAPI_NAMESPACE::CIntegerRefT::GetUnit
virtual GENICAM_NAMESPACE::gcstring GetUnit()
Get the physical unit name.
Definition: IInteger.h:222
GENAPI_NAMESPACE::GetMax
virtual double GetMax()=0
Get maximum value allowed.
GENAPI_NAMESPACE::EIncMode
enum GENAPI_NAMESPACE::_EIncMode EIncMode
typedef for increment mode
GENAPI_NAMESPACE::GetInc
virtual double GetInc()=0
Get the constant increment if there is any.
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::CIntegerRefT::GetRepresentation
virtual ERepresentation GetRepresentation()
Get recommended representation.
Definition: IInteger.h:214
GENAPI_NAMESPACE::CIntegerRefT::ref
CValueRefT< T, I > ref
Definition: IInteger.h:125
GENAPI_NAMESPACE::CIntegerRefT::GetInc
virtual int64_t GetInc()
Get increment.
Definition: IInteger.h:198
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::CIntegerRefT::operator()
virtual int64_t operator()()
Get node value.
Definition: IInteger.h:158
GCUtilities.h
GenICam common utilities.
GENAPI_NAMESPACE::CIntegerRefT
Definition: IInteger.h:123
GENAPI_NAMESPACE::CIntegerRefT::GetMin
virtual int64_t GetMin()
Get minimum value allowed.
Definition: IInteger.h:174
GENAPI_NAMESPACE::ImposeMin
virtual void ImposeMin(double Value)=0
Restrict minimum value.
GENAPI_NAMESPACE::IFloat
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IFloat
Interface for float properties.
Definition: IFloat.h:60
GENAPI_NAMESPACE::GetUnit
virtual GENICAM_NAMESPACE::gcstring GetUnit() const =0
Get the physical unit name.
GENAPI_NAMESPACE::IValue
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition: IValue.h:61
GENAPI_NAMESPACE::CIntegerRefT::ImposeMin
virtual void ImposeMin(int64_t Value)
Restrict minimum value.
Definition: IInteger.h:238
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
GENAPI_NAMESPACE::CIntegerRefT::GetValue
virtual int64_t GetValue(bool Verify=false, bool IgnoreCache=false)
Get node value.
Definition: IInteger.h:150
GENAPI_NAMESPACE::CIntegerRef
CIntegerRefT< IInteger > CIntegerRef
Reference to an IInteger pointer.
Definition: IInteger.h:257
IValue.h
Definition of the interface IValue.
GENAPI_NAMESPACE::GetMin
virtual double GetMin()=0
Get minimum value allowed.
GENAPI_NAMESPACE::CIntegerRefT::GetFloatAlias
IFloat * GetFloatAlias()
gets the interface of an alias node.
Definition: IInteger.h:230
GENAPI_NAMESPACE::int64_autovector_t
Vector of integers with reference counting.
Definition: Autovector.h:54
GENAPI_NAMESPACE::operator()
virtual bool operator()() const
Get node value.
Definition: IBoolean.h:79
GENAPI_NAMESPACE::CIntegerRefT::SetValue
virtual void SetValue(int64_t Value, bool Verify=true)
Set node value.
Definition: IInteger.h:133
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::CIntegerRefT::operator=
virtual IInteger & operator=(int64_t Value)
Set node value.
Definition: IInteger.h:141
GENAPI_NAMESPACE::CIntegerRefT::operator*
virtual int64_t operator*()
Get node value.
Definition: IInteger.h:166


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