IntSwissKnife.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_INTSWISSKNIFE_H
32 #define GENAPI_INTSWISSKNIFE_H
33 
35 #include "PolyReference.h"
36 #include "Node.h"
37 #include "BaseT.h"
38 #include "ValueT.h"
39 #include "IntegerT.h"
40 #include "NodeT.h"
41 #include "NodeMap.h"
42 #include <map>
43 
44 namespace GENAPI_NAMESPACE
45 {
46  //*************************************************************
47  // CIntSwissKnife class
48  //*************************************************************
49 
55  class CIntSwissKnifeImpl : public IInteger, public CNodeImpl
56  {
57  public:
60 
62  virtual ~CIntSwissKnifeImpl();
63 
64  public:
65 
68  {
69  return intfIInteger;
70  }
71 
72  //-------------------------------------------------------------
73  // IInteger implementation
74  //-------------------------------------------------------------
75 
77 
78  virtual int64_t GetValueWithInput(int64_t input, bool Verify = false, bool IgnoreCache = false);
79 
80 
81  protected:
82  // Get access mode
83  virtual EAccessMode InternalGetAccessMode() const;
84 
86  #pragma BullseyeCoverage off
87  virtual void InternalSetValue(int64_t /*Value*/, bool /* Verify = true */)
88  {
89  throw ACCESS_EXCEPTION_NODE("IntSwissKnife is read only.");
90  }
91  #pragma BullseyeCoverage on
92 
94  virtual int64_t InternalGetValue(bool Verify = false, bool IgnoreCache = false);
95 
96 
98  virtual int64_t InternalGetMin() const
99  {
100  return m_Min;
101  }
102 
104  virtual int64_t InternalGetMax() const
105  {
106  return m_Max;
107  }
108 
111  {
112  return int64_autovector_t();
113  }
114 
116  virtual int64_t InternalGetInc() const
117  {
118  return 1LL;
119  }
120 
123  {
125  return m_Representation;
126  else
127  return PureNumber;
128  }
129 
132  {
133  return m_Unit;
134  }
135 
137  virtual ECachingMode InternalGetCachingMode() const;
138 
139  public:
140  //-------------------------------------------------------------
141  // Initializing
142  //-------------------------------------------------------------
143 
144  virtual void FinalConstruct();
145 
146  virtual void SetProperty( CProperty &Property );
147  virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const;
148  virtual void Parse();
149 
150  protected:
151  //-------------------------------------------------------------
152  // Member variables
153  //-------------------------------------------------------------
156 
159 
162 
164  std::map<GENICAM_NAMESPACE::gcstring, GENICAM_NAMESPACE::gcstring> m_Symbolics;
165 
167  std::map<GENICAM_NAMESPACE::gcstring, CIntegerPolyRef> m_Variables;
168 
171 
174 
177 
180 
183 
185 
187 
190 
191  };
192 
193  class CIntSwissKnife : public BaseT< ValueT< NodeT< IntegerT< CIntSwissKnifeImpl > > > >
194  {
195  };
196 
197 }
198 
199 #endif // GENAPI_INTSWISSKNIFE_H
GENICAM_NAMESPACE::gcstring m_Unit
the physical unit name
Definition of the ValueT class template.
virtual int64_t InternalGetInc() const
Get increment.
Parser and evaluator for CIntSwissKnife.
GENICAM_NAMESPACE::gcstring m_InputName
A hard-coded variable name.
virtual int64_t InternalGetMin() const
Get minimum value allowed.
Definition: IntSwissKnife.h:98
GENICAM_INTERFACE IInteger
Interface for integer properties.
Definition: IFloat.h:114
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
virtual ~CIntSwissKnifeImpl()
Destructor.
Decimal number in an edit control.
Definition: Types.h:94
virtual int64_t GetValueWithInput(int64_t input, bool Verify=false, bool IgnoreCache=false)
Get feature value using m_InputName as hard coded variable name.
__int64 int64_t
Definition: config-win32.h:21
int64_t m_Max
maximum value to be stored in the Register
Implementation of the IBase interface.
Definition: BaseT.h:48
Definition of the NodeT class template.
enum GENAPI_NAMESPACE::_ERepresentation ERepresentation
recommended representation of a node value
virtual int64_t InternalGetMax() const
Get maximum value allowed.
enum GENAPI_NAMESPACE::_ECachingMode ECachingMode
caching mode of a register
virtual void InternalSetValue(int64_t, bool)
Set feature value.
Definition: IntSwissKnife.h:87
Vector of integers with reference counting.
Definition: Autovector.h:54
IInteger implementation for a SwissKnife used for formula evaluation.
Definition: IntSwissKnife.h:55
#define ACCESS_EXCEPTION_NODE
Fires a access error exception, e.g. throw ACCESS_ERROR_EXCEPTION("Not everybody") ...
Definition: Exception.h:172
CIntegerPolyRef m_Input
Pointer to the input required when the SwissKnife is used to implement a Converter.
std::map< GENICAM_NAMESPACE::gcstring, CIntegerPolyRef > m_Variables
Mapping of SYMBOLIC names to the references of the variables.
Definition of the IntegerT class template.
Definition of polymorphical smart pointer.
ERepresentation m_Representation
the representation of this integer node
std::map< GENICAM_NAMESPACE::gcstring, GENICAM_NAMESPACE::gcstring > m_Symbolics
Mapping of the variable&#39;s node names to the SYMBOLIC names in the formulas.
Definition of the BaseT class template.
virtual EAccessMode InternalGetAccessMode() const
Get the access mode of the node.
Standard implementation for the INode and the ISelector interface.
Definition: Node.h:86
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const
GENICAM_NAMESPACE::gcstring m_Formula
the formula evaluated by the swiss knife
CInt64MathParser m_MathParser
the parser doing the actual work
GENAPI_NAMESPACE::EInputDirection m_InputDirection
Indicates if the SwissKnife is part of a Converter and shows which direction is implemented.
A string class which is a clone of std::string.
Definition: GCString.h:52
CStrMap m_VariableMap
the vairble used by th parser
virtual int64_t InternalGetValue(bool Verify=false, bool IgnoreCache=false)
Get feature value.
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
access mode of a node
const int64_autovector_t InternalGetListOfValidValues()
Get list of valid value.
enum GENAPI_NAMESPACE::_EInputDirection EInputDirection
typedef for link type
int64_t m_Min
minimum value to be stored in the Register
A reference to an int64 which can bei either an int64 variable, or a pointer to an IInteger...
Definition: PolyReference.h:68
Definition of CInt64MathParser.
virtual ERepresentation InternalGetRepresentation() const
Get recommended representation.
virtual GENICAM_NAMESPACE::gcstring InternalGetUnit()
Get the unit.
virtual EInterfaceType InternalGetPrincipalInterfaceType() const
Implementation of IBase::GetPrincipalInterfaceType()
Definition: IntSwissKnife.h:67
Declaration of CNodeMap.
IInteger interface.
Definition: Types.h:193
Lexical analyzer for CIntSwissKnife.
Definition: Autovector.h:48
enum GENAPI_NAMESPACE::_EInterfaceType EInterfaceType
typedef for interface type
virtual void SetProperty(CProperty &Property)
virtual ECachingMode InternalGetCachingMode() const
Get Caching Mode.


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