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 <map>
42 
43 namespace GENAPI_NAMESPACE
44 {
45  //*************************************************************
46  // CIntSwissKnife class
47  //*************************************************************
48 
54  class CIntSwissKnifeImpl : public IInteger, public CNodeImpl
55  {
56  public:
59 
61  virtual ~CIntSwissKnifeImpl();
62 
63  public:
64 
67  {
68  return intfIInteger;
69  }
70 
71  //-------------------------------------------------------------
72  // IInteger implementation
73  //-------------------------------------------------------------
74 
76 
77  virtual int64_t GetValueWithInput(int64_t input, bool Verify = false, bool IgnoreCache = false);
78 
79 
80  protected:
81  // Get access mode
82  virtual EAccessMode InternalGetAccessMode() const;
83 
85  #pragma BullseyeCoverage off
86  virtual void InternalSetValue(int64_t /*Value*/, bool /* Verify = true */)
87  {
88  throw ACCESS_EXCEPTION_NODE("IntSwissKnife is read only.");
89  }
90  #pragma BullseyeCoverage on
91 
93  virtual int64_t InternalGetValue(bool Verify = false, bool IgnoreCache = false);
94 
95 
97  virtual int64_t InternalGetMin() const
98  {
99  return m_Min;
100  }
101 
103  virtual int64_t InternalGetMax() const
104  {
105  return m_Max;
106  }
107 
110  {
111  return int64_autovector_t();
112  }
113 
115  virtual int64_t InternalGetInc() const
116  {
117  return 1LL;
118  }
119 
122  {
124  return m_Representation;
125  else
126  return PureNumber;
127  }
128 
131  {
132  return m_Unit;
133  }
134 
136  virtual ECachingMode InternalGetCachingMode() const;
137 
138  public:
139  //-------------------------------------------------------------
140  // Initializing
141  //-------------------------------------------------------------
142 
143  virtual void FinalConstruct();
144 
145  virtual void SetProperty( CProperty &Property );
146  virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const;
147  virtual void Parse();
148 
149  protected:
150  //-------------------------------------------------------------
151  // Member variables
152  //-------------------------------------------------------------
155 
158 
161 
163  std::map<GENICAM_NAMESPACE::gcstring, GENICAM_NAMESPACE::gcstring> m_Symbolics;
164 
166  std::map<GENICAM_NAMESPACE::gcstring, CIntegerPolyRef> m_Variables;
167 
170 
173 
176 
179 
182 
184 
186 
189 
190  };
191 
192  class CIntSwissKnife : public BaseT< ValueT< NodeT< IntegerT< CIntSwissKnifeImpl > > > >
193  {
194  };
195 
196 }
197 
198 #endif // GENAPI_INTSWISSKNIFE_H
Map for variables in swissknife expression.
Definition: StrMap.h:27
GENICAM_NAMESPACE::gcstring m_Unit
the physical unit name
Definition of the ValueT class template.
Parser and evaluator for CIntSwissKnife.
virtual int64_t InternalGetInc() const
Get increment.
GENICAM_NAMESPACE::gcstring m_InputName
A hard-coded variable name.
virtual int64_t InternalGetMin() const
Get minimum value allowed.
Definition: IntSwissKnife.h:97
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
interface GENAPI_DECL_ABSTRACT IInteger
Interface for integer properties.
Definition: IInteger.h:61
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:86
Vector of integers with reference counting.
Definition: Autovector.h:54
IInteger implementation for a SwissKnife used for formula evaluation.
Definition: IntSwissKnife.h:54
#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.
interface GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
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:85
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:66
IInteger interface.
Definition: Types.h:193
Part of the generic device API.
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 Thu Jun 6 2019 19:10:54