All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
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::EAccessMode
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
access mode of a node
GENAPI_NAMESPACE::CIntSwissKnifeImpl::Parse
virtual void Parse()
GENAPI_NAMESPACE::intfIInteger
@ intfIInteger
IInteger interface.
Definition: Types.h:192
GENAPI_NAMESPACE::CIntSwissKnifeImpl::m_Unit
GENICAM_NAMESPACE::gcstring m_Unit
the physical unit name
Definition: IntSwissKnife.h:179
GENAPI_NAMESPACE::CIntSwissKnifeImpl::m_Min
int64_t m_Min
minimum value to be stored in the Register
Definition: IntSwissKnife.h:155
GENAPI_NAMESPACE::PureNumber
@ PureNumber
Decimal number in an edit control.
Definition: Types.h:93
PolyReference.h
Definition of polymorphical smart pointer.
GENAPI_NAMESPACE::CIntSwissKnife
Definition: IntSwissKnife.h:193
GENAPI_NAMESPACE::CIntSwissKnifeImpl::InternalGetUnit
virtual GENICAM_NAMESPACE::gcstring InternalGetUnit()
Get the unit.
Definition: IntSwissKnife.h:131
GENAPI_NAMESPACE::CIntSwissKnifeImpl::InternalGetListOfValidValues
const int64_autovector_t InternalGetListOfValidValues()
Get list of valid value.
Definition: IntSwissKnife.h:110
GENAPI_NAMESPACE::CIntSwissKnifeImpl::FinalConstruct
virtual void FinalConstruct()
GENAPI_NAMESPACE::CIntSwissKnifeImpl
IInteger implementation for a SwissKnife used for formula evaluation.
Definition: IntSwissKnife.h:55
GENAPI_NAMESPACE::CIntSwissKnifeImpl::InternalGetPrincipalInterfaceType
virtual EInterfaceType InternalGetPrincipalInterfaceType() const
Implementation of IBase::GetPrincipalInterfaceType()
Definition: IntSwissKnife.h:67
GENAPI_NAMESPACE::CInt64MathParser
Parser and evaluator for CIntSwissKnife.
Definition: Int64MathParser.h:54
NodeMap.h
Declaration of CNodeMap.
GENAPI_NAMESPACE::CNodeImpl
Standard implementation for the INode and the ISelector interface.
Definition: Node.h:86
GENICAM_NAMESPACE::gcstring
A string class which is a clone of std::string.
Definition: GCString.h:52
GENAPI_NAMESPACE::CIntSwissKnifeImpl::m_InputDirection
GENAPI_NAMESPACE::EInputDirection m_InputDirection
Indicates if the SwissKnife is part of a Converter and shows which direction is implemented.
Definition: IntSwissKnife.h:182
GENAPI_NAMESPACE::CIntSwissKnifeImpl::SetProperty
virtual void SetProperty(CProperty &Property)
GENAPI_NAMESPACE::_UndefinedRepresentation
@ _UndefinedRepresentation
Definition: Types.h:97
GENAPI_NAMESPACE::CIntSwissKnifeImpl::m_VariableMap
CStrMap m_VariableMap
the vairble used by th parser
Definition: IntSwissKnife.h:170
NodeT.h
Definition of the NodeT class template.
GENAPI_NAMESPACE::CIntegerPolyRef
A reference to an int64 which can bei either an int64 variable, or a pointer to an IInteger,...
Definition: PolyReference.h:68
GENAPI_NAMESPACE::CIntSwissKnifeImpl::m_InputName
GENICAM_NAMESPACE::gcstring m_InputName
A hard-coded variable name.
Definition: IntSwissKnife.h:186
GENAPI_NAMESPACE::CIntSwissKnifeImpl::m_Symbolics
std::map< GENICAM_NAMESPACE::gcstring, GENICAM_NAMESPACE::gcstring > m_Symbolics
Mapping of the variable's node names to the SYMBOLIC names in the formulas.
Definition: IntSwissKnife.h:164
GENAPI_NAMESPACE::BaseT
Implementation of the IBase interface.
Definition: BaseT.h:48
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::EInterfaceType
enum GENAPI_NAMESPACE::_EInterfaceType EInterfaceType
typedef for interface type
GENAPI_NAMESPACE::CIntSwissKnifeImpl::InternalGetCachingMode
virtual ECachingMode InternalGetCachingMode() const
Get Caching Mode.
GENAPI_NAMESPACE::EInputDirection
enum GENAPI_NAMESPACE::_EInputDirection EInputDirection
typedef for link type
GENAPI_NAMESPACE::CIntSwissKnifeImpl::CIntSwissKnifeImpl
CIntSwissKnifeImpl()
Constructor.
BaseT.h
Definition of the BaseT class template.
ACCESS_EXCEPTION_NODE
#define ACCESS_EXCEPTION_NODE
Fires a access error exception, e.g. throw ACCESS_ERROR_EXCEPTION("Not everybody")
Definition: Exception.h:179
GENAPI_NAMESPACE::CStrMap
Definition: StrMap.h:31
Node.h
GENAPI_NAMESPACE::CIntSwissKnifeImpl::InternalGetAccessMode
virtual EAccessMode InternalGetAccessMode() const
Get the access mode of the node.
GENAPI_NAMESPACE::CIntSwissKnifeImpl::m_Input
CIntegerPolyRef m_Input
Pointer to the input required when the SwissKnife is used to implement a Converter.
Definition: IntSwissKnife.h:189
GENAPI_NAMESPACE::CIntSwissKnifeImpl::GetValueWithInput
virtual int64_t GetValueWithInput(int64_t input, bool Verify=false, bool IgnoreCache=false)
Get feature value using m_InputName as hard coded variable name.
GENAPI_NAMESPACE::CIntSwissKnifeImpl::InternalGetInc
virtual int64_t InternalGetInc() const
Get increment.
Definition: IntSwissKnife.h:116
GENAPI_NAMESPACE::CIntSwissKnifeImpl::~CIntSwissKnifeImpl
virtual ~CIntSwissKnifeImpl()
Destructor.
GENAPI_NAMESPACE::CIntSwissKnifeImpl::m_MathParser
CInt64MathParser m_MathParser
the parser doing the actual work
Definition: IntSwissKnife.h:173
int64_t
__int64 int64_t
Definition: config-win32.h:21
Int64MathParser.h
Definition of CInt64MathParser.
GENAPI_NAMESPACE::CIntSwissKnifeImpl::m_Variables
std::map< GENICAM_NAMESPACE::gcstring, CIntegerPolyRef > m_Variables
Mapping of SYMBOLIC names to the references of the variables.
Definition: IntSwissKnife.h:167
GENAPI_NAMESPACE::ECachingMode
enum GENAPI_NAMESPACE::_ECachingMode ECachingMode
caching mode of a register
GENAPI_NAMESPACE::CIntSwissKnifeImpl::m_Max
int64_t m_Max
maximum value to be stored in the Register
Definition: IntSwissKnife.h:158
GENAPI_NAMESPACE::CIntSwissKnifeImpl::GetProperty
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const
GENAPI_NAMESPACE::CIntSwissKnifeImpl::m_Representation
ERepresentation m_Representation
the representation of this integer node
Definition: IntSwissKnife.h:176
ValueT.h
Definition of the ValueT class template.
GENAPI_NAMESPACE::CIntSwissKnifeImpl::InternalGetValue
virtual int64_t InternalGetValue(bool Verify=false, bool IgnoreCache=false)
Get feature value.
GENAPI_NAMESPACE::int64_autovector_t
Vector of integers with reference counting.
Definition: Autovector.h:54
GENAPI_NAMESPACE::CIntSwissKnifeImpl::InternalGetMin
virtual int64_t InternalGetMin() const
Get minimum value allowed.
Definition: IntSwissKnife.h:98
GENAPI_NAMESPACE::CIntSwissKnifeImpl::m_Formula
GENICAM_NAMESPACE::gcstring m_Formula
the formula evaluated by the swiss knife
Definition: IntSwissKnife.h:161
GENAPI_NAMESPACE::CIntSwissKnifeImpl::InternalGetMax
virtual int64_t InternalGetMax() const
Get maximum value allowed.
Definition: IntSwissKnife.h:104
GENAPI_NAMESPACE::CIntSwissKnifeImpl::InternalGetRepresentation
virtual ERepresentation InternalGetRepresentation() const
Get recommended representation.
Definition: IntSwissKnife.h:122
IntegerT.h
Definition of the IntegerT class template.
GENAPI_NAMESPACE::CIntSwissKnifeImpl::InternalSetValue
virtual void InternalSetValue(int64_t, bool)
Set feature value.
Definition: IntSwissKnife.h:87


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