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 
92  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 Counter& GetBathometer() { return m_Bathometer; }
105  virtual void SetEntryPoint(EMethod EntryMethod, const INodePrivate *pEntryNode, bool IgnoreCache);
106  virtual void ResetEntryPoint();
108  virtual bool IsGenApiLoggingEnabled();
109  virtual bool IsGenApiDeviceLoggingEnabled();
111 
112  //-------------------------------------------------------------
114 
119  virtual void GetGenApiVersion(Version_t &Version, uint16_t &Build);
120  virtual void GetSchemaVersion(Version_t &Version);
121  virtual void GetDeviceVersion(Version_t &Version);
125  private:
126  //-------------------------------------------------------------
128 
129  virtual UserData_t GetUserData() const;
130  virtual UserData_t SetUserData( UserData_t userdata );
132  public:
133  //-------------------------------------------------------------
136  virtual void Destroy();
138 
139  // Fast Track...
140  inline INodePrivate* _GetNodeByID( NodeID_t NodeID )
141  {
142  assert((size_t)NodeID.ToIndex() < m_Node2NodeID.size());
143  return m_Node2NodeID[(size_t)NodeID.ToIndex()];
144  }
145 
146  protected:
147  //-------------------------------------------------------------
148  // DeviceInfo members
149  //-------------------------------------------------------------
150 
153 
156 
159 
162 
165 
168 
171 
174 
176  GENICAM_NAMESPACE::gcstring_vector m_PropertyNames;
177 
180 
183 
184  //-------------------------------------------------------------
185  // Node containers
186  //-------------------------------------------------------------
187 
189  typedef std::vector<INodePrivate*> Node2NodeID_t;
190  Node2NodeID_t m_Node2NodeID;
191 
193  string2node_t *m_pMap;
194 
196  string2node_t& Map();
197 
199  const string2node_t& Map() const;
200 
201  //-------------------------------------------------------------
202  // Destruction
203  //-------------------------------------------------------------
204 
206  virtual ~CNodeMap();
207 
209  void ClearAllNodes();
210 
211  //-------------------------------------------------------------
212  // Call-stack implementation
213  //-------------------------------------------------------------
214 
217 
220 
223 
226 
229 
232 
235 
238 
239  private:
243  private:
247 
248  protected:
252 
253  private:
254  std::list<CPort *> m_connectedPort;
255 
256 
257  //-------------------------------------------------------------
258  // No copying of this class
259  //-------------------------------------------------------------
260  private:
262  CNodeMap(const CNodeMap&);
263 
265  CNodeMap& operator=(const CNodeMap&);
266 
267  };
268 }
269 
270 #ifdef _MSC_VER
271 # pragma warning(pop)
272 #endif
273 
274 #endif // GENAPI_NODEMAP_H
Definition of value2string and string2value functions.
central versioning counters
virtual UserData_t GetUserData() const
GENAPI_NAMESPACE::EStandardNameSpace m_StandardNameSpace
standard name space
Definition: NodeMap.h:161
virtual void InvalidateNodes() const
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IDeviceInfo
Interface to get information about the device (= nodemap)
Definition: IDeviceInfo.h:54
virtual bool Connect(IPort *pPort, const GENICAM_NAMESPACE::gcstring &PortName) 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:219
GENICAM_NAMESPACE::gcstring m_DeviceName
The name of the device.
Definition: NodeMap.h:179
virtual Counter & GetBathometer()
Definition: NodeMap.h:104
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:216
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
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:222
__int64 int64_t
Definition: config-win32.h:21
string2node_t & Map()
Retrieve the map.
virtual void SetEntryPoint(EMethod EntryMethod, const INodePrivate *pEntryNode, bool IgnoreCache)
virtual void GetNodes(NodeList_t &Nodes) const
string2node_t * m_pMap
Holds the Node pointers referenced by NodeName.
Definition: NodeMap.h:193
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:254
GENICAM_NAMESPACE::gcstring m_VersionGuid
Guid describing the product version.
Definition: NodeMap.h:173
CNodeMap & operator=(const CNodeMap &)
forbidden operator=
GENICAM_NAMESPACE::gcstring m_VendorName
Get the vendor name.
Definition: NodeMap.h:155
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortStacked
Interface for ports.
Definition: IPortStacked.h:63
virtual INode * GetNode(const GENICAM_NAMESPACE::gcstring &Name) const
virtual CNodeWriteConcatenator * NewNodeWriteConcatenator() const
node_vector NodeList_t
a list of node references
Definition: INode.h:55
virtual GENICAM_NAMESPACE::gcstring GetVendorName()
Version_t m_DeviceVersion
device description file&#39;s version number
Definition: NodeMap.h:167
virtual GENICAM_NAMESPACE::gcstring GetEntryPoint()
virtual void ResetEntryPoint()
Node2NodeID_t m_Node2NodeID
Definition: NodeMap.h:190
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:189
bool m_GenApiLoggingEnabled
indicates GenApi logging is enabled (caches the returnvalue of CLog::Exists("GenApi") ) ...
Definition: NodeMap.h:234
GENICAM_NAMESPACE::gcstring m_ModelName
model name
Definition: NodeMap.h:152
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:225
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:251
virtual bool ParseSwissKnifes(GENICAM_NAMESPACE::gcstring_vector *pErrorList=NULL) const
UserData_t m_pUserData
Storage of user defined data. Ownership remains by the user!. Use IUserData interface to access the d...
Definition: NodeMap.h:246
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:158
GENICAM_NAMESPACE::gcstring m_ProductGuid
Guid describing the product.
Definition: NodeMap.h:170
INodePrivate * _GetNodeByID(NodeID_t NodeID)
Definition: NodeMap.h:140
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 uint64_t GetNumNodes() const
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:176
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.
Portable string implementation.
bool m_GenApiDeviceLoggingEnabled
indicates GenApi logging is enabled (caches the returnvalue of CLog::Exists("GenApi.Device") )
Definition: NodeMap.h:237
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:242
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.
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:164
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:228
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:231
virtual CLock & GetLock() const
virtual GENICAM_NAMESPACE::gcstring GetStandardNameSpace()
Definition of interface INodeMap.
Lexical analyzer for CIntSwissKnife.
Definition: Autovector.h:48
A lock class.
Definition: Synch.h:63
Definition of interface INodePrivate.
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const
GENICAM_NAMESPACE::gcstring m_Name
Dummy name, used only for loading.
Definition: NodeMap.h:182


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