NodeMap.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2006 by Basler
3 // Project: GenApi
4 // Author: Fritz Dierks
5 //
6 // License: This file is published under the license of the EMVA GenICam Standard Group.
7 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
8 // If for some reason you are missing this file please contact the EMVA or visit the website
9 // (http://www.genicam.org) for a full copy.
10 //
11 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
12 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
13 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
14 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
15 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
16 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
17 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
18 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
19 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
20 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
21 // POSSIBILITY OF SUCH DAMAGE.
22 //-----------------------------------------------------------------------------
29 #ifndef GENAPI_NODEMAP_H
30 #define GENAPI_NODEMAP_H
31 
32 #include "GenApi/GenApiVersion.h"
33 #include "GenApi/GenApiDll.h"
36 #include "GenApi/IDestroy.h"
37 #include "GenApi/IDeviceInfo.h"
38 #include "GenApi/Synch.h"
39 #include "Base/GCString.h"
40 #include "Base/GCStringVector.h"
42 #include "GenApi/IUserData.h"
43 #include "GenApi/impl/ConcatenatedWriteImpl.h"
44 #include "GenApi/impl/Port.h"
45 #include <map>
46 
47 #ifdef _MSC_VER
48 # pragma warning(push)
49 # pragma warning(disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of class 'yyy'
50 #endif
51 
52 namespace GENAPI_NAMESPACE
53 {
54 
55  typedef INodePrivate*(*CreateFunc_t)( const GENICAM_NAMESPACE::gcstring& );
56 
57  class string2node_t;
61  class CNodeMap
62  : virtual public INodeMapPrivate
63  , public IDeviceInfo
64  , public IDestroy
65  , public IUserData
66  {
67  public:
68  //----------------------------------------------------------------
69  // Construction
70  //----------------------------------------------------------------
71 
73  CNodeMap(const GENICAM_NAMESPACE::gcstring& DeviceName = "Device", CLock* pUserProvidedLock = NULL);
74 
75  //-------------------------------------------------------------
77 
78  virtual void GetNodes(NodeList_t &Nodes) const;
79  virtual INode* GetNode(const GENICAM_NAMESPACE::gcstring& Name) const;
80  virtual void InvalidateNodes() const;
81  virtual bool Connect(IPort* pPort, const GENICAM_NAMESPACE::gcstring& PortName) const;
82  virtual bool Connect(IPort* pPort) const;
83  virtual bool Connect(IPortStacked* pPort, const GENICAM_NAMESPACE::gcstring& PortName);
84  virtual bool Connect(IPortStacked* pPort);
86  virtual void Poll(int64_t ElapsedTime);
87  virtual CLock& GetLock() const;
88  virtual uint64_t GetNumNodes() const;
90  virtual bool ConcatenatedWrite(CNodeWriteConcatenator *, bool featureStreaming = true, GENICAM_NAMESPACE::gcstring_vector *pErrorList = NULL);
91  virtual bool ParseSwissKnifes( GENICAM_NAMESPACE::gcstring_vector *pErrorList = NULL ) const;
94 
95  //-------------------------------------------------------------
97 
98  virtual void RegisterNode(INodePrivate* pNode, CNodeData::ENodeType_t NodeType, NodeID_t NodeID);
99  virtual void FinalConstruct(bool DetermineDependencies);
100  virtual void SetNumNodes(size_t NumNodes);
101  virtual INodePrivate* GetNodeByID(NodeID_t NodeID);
102  virtual void SetProperty(CProperty &Property);
103  virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const;
104  virtual bool IsCallbackSuppressed() { return m_suppressCallback!=csmOff; };
105  virtual Counter& GetBathometer() { return m_Bathometer; }
106  virtual void SetEntryPoint(EMethod EntryMethod, const INodePrivate *pEntryNode, bool stremable, bool IgnoreCache);
107  virtual void ResetEntryPoint();
109  virtual bool IsGenApiLoggingEnabled();
110  virtual bool IsGenApiDeviceLoggingEnabled();
111  virtual bool EntryIsStremable();
112  virtual void SetGenApiPersistenceMode(bool);
114 
115  //-------------------------------------------------------------
117 
122  virtual void GetGenApiVersion(Version_t &Version, uint16_t &Build);
123  virtual void GetSchemaVersion(Version_t &Version);
124  virtual void GetDeviceVersion(Version_t &Version);
128  private:
129  //-------------------------------------------------------------
131 
132  virtual UserData_t GetUserData() const;
133  virtual UserData_t SetUserData( UserData_t userdata );
135  public:
136  //-------------------------------------------------------------
139  virtual void Destroy();
141 
142  // Fast Track...
143  inline INodePrivate* _GetNodeByID( NodeID_t NodeID )
144  {
145  assert((size_t)NodeID.ToIndex() < m_Node2NodeID.size());
146  return m_Node2NodeID[(size_t)NodeID.ToIndex()];
147  }
148 
149  protected:
150  //-------------------------------------------------------------
151  // DeviceInfo members
152  //-------------------------------------------------------------
153 
156 
159 
162 
165 
168 
171 
174 
177 
179  GENICAM_NAMESPACE::gcstring_vector m_PropertyNames;
180 
183 
186 
187  //-------------------------------------------------------------
188  // Node containers
189  //-------------------------------------------------------------
190 
192  typedef std::vector<INodePrivate*> Node2NodeID_t;
193  Node2NodeID_t m_Node2NodeID;
194 
196  string2node_t *m_pMap;
197 
199  string2node_t& Map();
200 
202  const string2node_t& Map() const;
203 
204  //-------------------------------------------------------------
205  // Destruction
206  //-------------------------------------------------------------
207 
209  virtual ~CNodeMap();
210 
212  void ClearAllNodes();
213 
214  //-------------------------------------------------------------
215  // Call-stack implementation
216  //-------------------------------------------------------------
217 
220 
223 
226 
229 
232 
235 
238 
241 
244 
247 
250 
251  private:
255  private:
259 
260  protected:
264 
265  private:
266  std::list<CPort *> m_connectedPort;
267 
268  protected:
269 
272  {
273  public:
276  {
277  assert(pThis);
278  m_pNodeMapPrivate = pThis;
279  }
280 
283  {
285  {
287  }
288  }
289 
290  private:
293  };
294 
295  //-------------------------------------------------------------
296  // No copying of this class
297  //-------------------------------------------------------------
298  private:
300  CNodeMap(const CNodeMap&);
301 
303  CNodeMap& operator=(const CNodeMap&);
304 
305  };
306 }
307 
308 #ifdef _MSC_VER
309 # pragma warning(pop)
310 #endif
311 
312 #endif // GENAPI_NODEMAP_H
Definition of value2string and string2value functions.
virtual CNodeWriteConcatenator * NewNodeWriteConcatenator() const
central versioning counters
GENAPI_NAMESPACE::EStandardNameSpace m_StandardNameSpace
standard name space
Definition: NodeMap.h:164
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IDeviceInfo
Interface to get information about the device (= nodemap)
Definition: IDeviceInfo.h:54
virtual uint64_t GetNumNodes() const
virtual bool ConcatenatedWrite(CNodeWriteConcatenator *, bool featureStreaming=true, GENICAM_NAMESPACE::gcstring_vector *pErrorList=NULL)
virtual void GetSchemaVersion(Version_t &Version)
const INodePrivate * m_pEntryNode
The node where a call entered the tree.
Definition: NodeMap.h:225
GENICAM_NAMESPACE::gcstring m_DeviceName
The name of the device.
Definition: NodeMap.h:182
virtual Counter & GetBathometer()
Definition: NodeMap.h:105
virtual GENICAM_NAMESPACE::gcstring GetToolTip()
Definition of interface IDestroy.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IUserData
Interface to manage user data stored in nodes or nodemaps.
Definition: IUserData.h:34
Counter m_Bathometer
counts the depth of SetValue call-chains
Definition: NodeMap.h:222
bool m_GenApiPersistenceMode
indicates who GenApi deals with the verify flag.
Definition: NodeMap.h:249
Portable string vector implementation.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT INodeMapPrivate
NodeMap functions used for initialization.
std::vector< INodePrivate *> NodePrivateVector_t
a vector of node references using the INodePrivate interface
Definition: INodePrivate.h:58
virtual CLock & GetLock() const
GENICAM_INTERFACE INodePrivate
Interface including the methods for node construction common to all nodes.
Definition: INodePrivate.h:54
EMethod m_EntryMethod
The node where a call entered the tree.
Definition: NodeMap.h:228
__int64 int64_t
Definition: config-win32.h:21
enum GENAPI_NAMESPACE::_ECallbackSuppressMode ECallbackSuppressMode
typedef for callback suppression mod
EntryMethodFinalizer(CNodeMap *pThis)
Constructor.
Definition: NodeMap.h:275
uint64_t m_suppressCallback
counts the depth of SetValue call-chains
Definition: NodeMap.h:219
string2node_t & Map()
Retrieve the map.
virtual void SetGenApiPersistenceMode(bool)
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const
bool m_EntryPointStreamable
Indicate if the entry point has the stremable flag.
Definition: NodeMap.h:237
string2node_t * m_pMap
Holds the Node pointers referenced by NodeName.
Definition: NodeMap.h:196
virtual bool EntryIsStremable()
Indicates suppression is used once.
Definition: Types.h:251
virtual GENICAM_NAMESPACE::gcstring GetProductGuid()
Hold a map of all nodes.
Definition: NodeMap.h:61
virtual void FinalConstruct(bool DetermineDependencies)
virtual void RegisterNode(INodePrivate *pNode, CNodeData::ENodeType_t NodeType, NodeID_t NodeID)
std::list< CPort * > m_connectedPort
Definition: NodeMap.h:266
GENICAM_NAMESPACE::gcstring m_VersionGuid
Guid describing the product version.
Definition: NodeMap.h:176
CNodeMap & operator=(const CNodeMap &)
forbidden operator=
GENICAM_NAMESPACE::gcstring m_VendorName
Get the vendor name.
Definition: NodeMap.h:158
Used to ensure that PostSetValue() is called in any case.
Definition: NodeMap.h:271
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortStacked
Interface for ports.
Definition: IPortStacked.h:63
node_vector NodeList_t
a list of node references
Definition: INode.h:55
virtual GENICAM_NAMESPACE::gcstring GetVendorName()
virtual void SetEntryPoint(EMethod EntryMethod, const INodePrivate *pEntryNode, bool stremable, bool IgnoreCache)
Indicates suppression is turned off.
Definition: Types.h:249
Version_t m_DeviceVersion
device description file&#39;s version number
Definition: NodeMap.h:170
virtual GENICAM_NAMESPACE::gcstring GetEntryPoint()
CNodeMap * m_pNodeMapPrivate
Private cache for the INodeMapPrivate pointer.
Definition: NodeMap.h:292
virtual void ResetEntryPoint()
Node2NodeID_t m_Node2NodeID
Definition: NodeMap.h:193
virtual INodePrivate * GetNodeByID(NodeID_t NodeID)
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT CNodeData::ENodeType_t NodeID_t NodeID
std::vector< INodePrivate * > Node2NodeID_t
Holds the Node pointers referenced by NodeID.
Definition: NodeMap.h:192
bool m_GenApiLoggingEnabled
indicates GenApi logging is enabled (caches the returnvalue of CLog::Exists("GenApi") ) ...
Definition: NodeMap.h:243
GENICAM_NAMESPACE::gcstring m_ModelName
model name
Definition: NodeMap.h:155
virtual void InvalidateNodes() const
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IDestroy
Interface to destroy an object.
Definition: IDestroy.h:35
int m_EntryPointDepth
Number of call pairs to SetEntryPoint/ResetEntryPoint.
Definition: NodeMap.h:231
CLock & m_Lock
The pointer to the lock guarding access to the node map This may be changed by the user if he decides...
Definition: NodeMap.h:263
UserData_t m_pUserData
Storage of user defined data. Ownership remains by the user!. Use IUserData interface to access the d...
Definition: NodeMap.h:258
EMethod
denotes through which method call the node tree was entered
Definition: Exception.h:40
GENICAM_NAMESPACE::gcstring m_ToolTip
tool tip
Definition: NodeMap.h:161
GENICAM_NAMESPACE::gcstring m_ProductGuid
Guid describing the product.
Definition: NodeMap.h:173
virtual void SetSuppressCallbackMode(ECallbackSuppressMode mode)
INodePrivate * _GetNodeByID(NodeID_t NodeID)
Definition: NodeMap.h:143
void ClearAllNodes()
Clear the map.
virtual bool IsGenApiLoggingEnabled()
virtual ~CNodeMap()
Destructor (note that in order to destroy the node map you need to call IDestroy::Destroy() ...
virtual bool IsGenApiDeviceLoggingEnabled()
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPort
Interface for ports.
Definition: IPort.h:57
GENICAM_NAMESPACE::gcstring_vector m_PropertyNames
A list with all properties set.
Definition: NodeMap.h:179
Definition of interface IUserData.
A string class which is a clone of std::string.
Definition: GCString.h:52
virtual void SetNumNodes(size_t NumNodes)
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT CNodeData::ENodeType_t NodeType
enum GENAPI_NAMESPACE::_EStandardNameSpace EStandardNameSpace
Defines from which standard namespace a node name comes from.
virtual void GetGenApiVersion(Version_t &Version, uint16_t &Build)
Definition of CPort.
virtual bool Connect(IPort *pPort, const GENICAM_NAMESPACE::gcstring &PortName) const
virtual void GetNodes(NodeList_t &Nodes) const
Portable string implementation.
bool m_GenApiDeviceLoggingEnabled
indicates GenApi logging is enabled (caches the returnvalue of CLog::Exists("GenApi.Device") )
Definition: NodeMap.h:246
CLock m_zzz_OwnLock_DoNotUse
The own lock guarding access to the node map Do not use this directly! Use GetLock() instead...
Definition: NodeMap.h:254
virtual GENICAM_NAMESPACE::gcstring GetModelName()
declspec&#39;s to be used for GenApi Windows dll
GENICAM_INTERFACE INode
Interface common to all nodes.
Definition: ICategory.h:51
Definition of Lock classes.
virtual UserData_t GetUserData() const
virtual bool IsCallbackSuppressed()
Definition: NodeMap.h:104
Definition of interface INodeMapPrivate.
virtual GENICAM_NAMESPACE::gcstring GetVersionGuid()
virtual void SetProperty(CProperty &Property)
CNodeMap(const GENICAM_NAMESPACE::gcstring &DeviceName="Device", CLock *pUserProvidedLock=NULL)
Constructor.
virtual void Poll(int64_t ElapsedTime)
Version_t m_SchemaVersion
schema version number
Definition: NodeMap.h:167
virtual GENICAM_NAMESPACE::gcstring GetDeviceName()
void * UserData_t
Definition: IUserData.h:24
bool m_EntryPointIgnoreCache
Indicates if the entry point had the Ignore Cache flag set.
Definition: NodeMap.h:234
virtual bool ParseSwissKnifes(GENICAM_NAMESPACE::gcstring_vector *pErrorList=NULL) const
virtual INode * GetNode(const GENICAM_NAMESPACE::gcstring &Name) const
virtual void GetDeviceVersion(Version_t &Version)
virtual UserData_t SetUserData(UserData_t userdata)
NodePrivateVector_t * m_pPollingNodes
List of pointers to nodes which need to be polled.
Definition: NodeMap.h:240
virtual GENICAM_NAMESPACE::gcstring GetStandardNameSpace()
Definition of interface INodeMap.
Lexical analyzer for CIntSwissKnife.
Definition: Destructible.h:30
A lock class.
Definition: Synch.h:63
Definition of interface INodePrivate.
GENICAM_NAMESPACE::gcstring m_Name
Dummy name, used only for loading.
Definition: NodeMap.h:185


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Sun Jun 18 2023 02:43:55