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"
41 #include "GenApi/IUserData.h"
42 #include <map>
43 
44 #ifdef _MSC_VER
45 # pragma warning(push)
46 # pragma warning(disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of class 'yyy'
47 #endif
48 
49 namespace GENAPI_NAMESPACE
50 {
51 
52  typedef INodePrivate*(*CreateFunc_t)( const GENICAM_NAMESPACE::gcstring& );
53 
54  class string2node_t;
58  class CNodeMap
59  : virtual public INodeMapPrivate
60  , public IDeviceInfo
61  , public IDestroy
62  , public IUserData
63  {
64  public:
65  //----------------------------------------------------------------
66  // Construction
67  //----------------------------------------------------------------
68 
70  CNodeMap(const GENICAM_NAMESPACE::gcstring& DeviceName = "Device", CLock* pUserProvidedLock = NULL);
71 
72  //-------------------------------------------------------------
74 
75  virtual void GetNodes(NodeList_t &Nodes) const;
76  virtual INode* GetNode(const GENICAM_NAMESPACE::gcstring& Name) const;
77  virtual void InvalidateNodes() const;
78  virtual bool Connect(IPort* pPort, const GENICAM_NAMESPACE::gcstring& PortName) const;
79  virtual bool Connect(IPort* pPort) const;
81  virtual void Poll(int64_t ElapsedTime);
82  virtual CLock& GetLock() const;
83  virtual uint64_t GetNumNodes() const;
84  virtual bool ParseSwissKnifes( GENICAM_NAMESPACE::gcstring_vector *pErrorList = NULL ) const;
86 
87  //-------------------------------------------------------------
89 
90  virtual void RegisterNode(INodePrivate* pNode, CNodeData::ENodeType_t NodeType, NodeID_t NodeID);
91  virtual void FinalConstruct(bool DetermineDependencies);
92  virtual void SetNumNodes(size_t NumNodes);
93  virtual INodePrivate* GetNodeByID(NodeID_t NodeID);
94  virtual void SetProperty(CProperty &Property);
95  virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const;
96  virtual Counter& GetBathometer() { return m_Bathometer; }
97  virtual void SetEntryPoint(EMethod EntryMethod, const INodePrivate *pEntryNode, bool IgnoreCache);
98  virtual void ResetEntryPoint();
100  virtual bool IsGenApiLoggingEnabled();
101  virtual bool IsGenApiDeviceLoggingEnabled();
103 
104  //-------------------------------------------------------------
106 
111  virtual void GetGenApiVersion(Version_t &Version, uint16_t &Build);
112  virtual void GetSchemaVersion(Version_t &Version);
113  virtual void GetDeviceVersion(Version_t &Version);
117  private:
118  //-------------------------------------------------------------
120 
121  virtual UserData_t GetUserData() const;
122  virtual UserData_t SetUserData( UserData_t userdata );
124  public:
125  //-------------------------------------------------------------
128  virtual void Destroy();
130 
131  // Fast Track...
132  inline INodePrivate* _GetNodeByID( NodeID_t NodeID )
133  {
134  assert((size_t)NodeID.ToIndex() < m_Node2NodeID.size());
135  return m_Node2NodeID[(size_t)NodeID.ToIndex()];
136  }
137 
138  protected:
139  //-------------------------------------------------------------
140  // DeviceInfo members
141  //-------------------------------------------------------------
142 
145 
148 
151 
154 
157 
160 
163 
166 
168  GENICAM_NAMESPACE::gcstring_vector m_PropertyNames;
169 
172 
175 
176  //-------------------------------------------------------------
177  // Node containers
178  //-------------------------------------------------------------
179 
181  typedef std::vector<INodePrivate*> Node2NodeID_t;
182  Node2NodeID_t m_Node2NodeID;
183 
185  string2node_t *m_pMap;
186 
188  string2node_t& Map();
189 
191  const string2node_t& Map() const;
192 
193  //-------------------------------------------------------------
194  // Destruction
195  //-------------------------------------------------------------
196 
198  virtual ~CNodeMap();
199 
201  void ClearAllNodes();
202 
203  //-------------------------------------------------------------
204  // Call-stack implementation
205  //-------------------------------------------------------------
206 
209 
212 
215 
218 
221 
224 
227 
230 
231  private:
235  private:
239 
240  protected:
244 
245 
246  //-------------------------------------------------------------
247  // No copying of this class
248  //-------------------------------------------------------------
249  private:
251  CNodeMap(const CNodeMap&);
252 
254  CNodeMap& operator=(const CNodeMap&);
255 
256  };
257 }
258 
259 #ifdef _MSC_VER
260 # pragma warning(pop)
261 #endif
262 
263 #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:153
virtual void InvalidateNodes() const
virtual bool Connect(IPort *pPort, const GENICAM_NAMESPACE::gcstring &PortName) const
virtual void GetSchemaVersion(Version_t &Version)
const INodePrivate * m_pEntryNode
The node where a call entered the tree.
Definition: NodeMap.h:211
GENICAM_NAMESPACE::gcstring m_DeviceName
The name of the device.
Definition: NodeMap.h:171
interface GENAPI_DECL_ABSTRACT INodePrivate
Interface including the methods for node construction common to all nodes.
Definition: INodePrivate.h:69
virtual Counter & GetBathometer()
Definition: NodeMap.h:96
virtual GENICAM_NAMESPACE::gcstring GetToolTip()
Definition of interface IDestroy.
Counter m_Bathometer
counts the depth of SetValue call-chains
Definition: NodeMap.h:208
std::vector< INodePrivate * > NodePrivateVector_t
a vector of node references using the INodePrivate interface
Definition: INodePrivate.h:58
interface GENAPI_DECL_ABSTRACT IPort
Interface for ports.
Definition: IPort.h:57
EMethod m_EntryMethod
The node where a call entered the tree.
Definition: NodeMap.h:214
__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:185
interface GENAPI_DECL_ABSTRACT IDeviceInfo
Interface to get information about the device (= nodemap)
Definition: IDeviceInfo.h:53
virtual GENICAM_NAMESPACE::gcstring GetProductGuid()
Hold a map of all nodes.
Definition: NodeMap.h:58
virtual void FinalConstruct(bool DetermineDependencies)
virtual void RegisterNode(INodePrivate *pNode, CNodeData::ENodeType_t NodeType, NodeID_t NodeID)
GENICAM_NAMESPACE::gcstring m_VersionGuid
Guid describing the product version.
Definition: NodeMap.h:165
CNodeMap & operator=(const CNodeMap &)
forbidden operator=
GENICAM_NAMESPACE::gcstring m_VendorName
Get the vendor name.
Definition: NodeMap.h:147
virtual INode * GetNode(const GENICAM_NAMESPACE::gcstring &Name) const
node_vector NodeList_t
a list of node references
Definition: INode.h:55
virtual GENICAM_NAMESPACE::gcstring GetVendorName()
interface GENAPI_DECL_ABSTRACT CNodeData::ENodeType_t NodeID_t NodeID
Version_t m_DeviceVersion
device description file&#39;s version number
Definition: NodeMap.h:159
virtual GENICAM_NAMESPACE::gcstring GetEntryPoint()
virtual void ResetEntryPoint()
Node2NodeID_t m_Node2NodeID
Definition: NodeMap.h:182
virtual INodePrivate * GetNodeByID(NodeID_t NodeID)
std::vector< INodePrivate * > Node2NodeID_t
Holds the Node pointers referenced by NodeID.
Definition: NodeMap.h:181
bool m_GenApiLoggingEnabled
indicates GenApi logging is enabled (caches the returnvalue of CLog::Exists("GenApi") ) ...
Definition: NodeMap.h:226
GENICAM_NAMESPACE::gcstring m_ModelName
model name
Definition: NodeMap.h:144
int m_EntryPointDepth
Number of call pairs to SetEntryPoint/ResetEntryPoint.
Definition: NodeMap.h:217
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:243
interface GENAPI_DECL_ABSTRACT CNodeData::ENodeType_t NodeType
virtual bool ParseSwissKnifes(GENICAM_NAMESPACE::gcstring_vector *pErrorList=NULL) const
UserData_t m_pUserData
Storage of user defined data.
Definition: NodeMap.h:238
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:150
GENICAM_NAMESPACE::gcstring m_ProductGuid
Guid describing the product.
Definition: NodeMap.h:162
INodePrivate * _GetNodeByID(NodeID_t NodeID)
Definition: NodeMap.h:132
interface GENAPI_DECL_ABSTRACT IUserData
Interface to manage user data stored in nodes or nodemaps.
Definition: IUserData.h:34
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() ...
interface GENAPI_DECL_ABSTRACT INodeMapPrivate
NodeMap functions used for initialization.
virtual uint64_t GetNumNodes() const
virtual bool IsGenApiDeviceLoggingEnabled()
GENICAM_NAMESPACE::gcstring_vector m_PropertyNames
A list with all properties set.
Definition: NodeMap.h:168
Definition of interface IUserData.
A string class which is a clone of std::string.
Definition: GCString.h:52
virtual void SetNumNodes(size_t NumNodes)
enum GENAPI_NAMESPACE::_EStandardNameSpace EStandardNameSpace
Defines from which standard namespace a node name comes from.
virtual void GetGenApiVersion(Version_t &Version, uint16_t &Build)
Portable string implementation.
bool m_GenApiDeviceLoggingEnabled
indicates GenApi logging is enabled (caches the returnvalue of CLog::Exists("GenApi.Device") )
Definition: NodeMap.h:229
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:234
virtual GENICAM_NAMESPACE::gcstring GetModelName()
declspec&#39;s to be used for GenApi Windows dll
Definition of Lock classes.
Definition of interface INodeMapPrivate.
interface GENAPI_DECL_ABSTRACT INode
Interface common to all nodes.
Definition: INode.h:60
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:156
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:220
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:223
virtual CLock & GetLock() const
virtual GENICAM_NAMESPACE::gcstring GetStandardNameSpace()
Definition of interface INodeMap.
Part of the generic device API.
Definition: Autovector.h:48
A lock class.
Definition: Synch.h:63
Definition of interface INodePrivate.
interface GENAPI_DECL_ABSTRACT IDestroy
Interface to destroy an object.
Definition: IDestroy.h:35
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:174


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:54