GenApi  3.5.1
NodeMapFactory.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2013 by Basler Vision Technologies
3 // Author: Andreas Gau
4 //
5 // License: This file is published under the license of the EMVA GenICam Standard Group.
6 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
7 // If for some reason you are missing this file please contact the EMVA or visit the website
8 // (http://www.genicam.org) for a full copy.
9 //
10 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
11 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
12 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
13 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
14 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
15 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
16 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
17 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
18 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
19 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
20 // POSSIBILITY OF SUCH DAMAGE.
21 //
22 //-----------------------------------------------------------------------------
28 #pragma once
29 
30 #include <GenApi/GenApiVersion.h>
31 #include <GenApi/GenApiDll.h>
32 #include <Base/GCString.h>
33 #include <Base/GCStringVector.h>
34 #include <memory>
35 
36 namespace GENAPI_NAMESPACE
37 {
38  class CLock; // forward
39  class CNodeDataMap;
40  struct INodeMap;
41 
47  typedef enum
48  {
55  } ECacheUsage_t;
56 
61  typedef enum
62  {
63  //ContentType_Auto,
67 
68 
69 
70 
71  //*************************************************************
72  // CNodeMapFactory
73  //*************************************************************
74 
135  class GENAPI_DECL CNodeMapFactory
136  {
137  public:
139  CNodeMapFactory();
140 
142  virtual ~CNodeMapFactory();
143 
148 
153 
154 
156 
166  CNodeMapFactory( EContentType_t FileType, const GENICAM_NAMESPACE::gcstring& FileName, ECacheUsage_t CacheUsage = CacheUsage_Automatic, bool SuppressStringsOnLoad = false);
167 
168 
170 
181  CNodeMapFactory(EContentType_t ContentType, const void* pData, size_t DataSize, ECacheUsage_t CacheUsage = CacheUsage_Automatic, bool SuppressStringsOnLoad = false);
182 
183 
185 
201  CNodeMapFactory(const GENICAM_NAMESPACE::gcstring& XmlData, ECacheUsage_t CacheUsage = CacheUsage_Automatic, bool SuppressStringsOnLoad = false);
202 
203 
205  bool IsEmpty() const;
206 
207 
209 
216  void AddInjectionData(CNodeMapFactory& injectionData);
217 
218 
220 
223  void LoadAndInject();
224 
225 
227  bool IsLoaded() const;
228 
229 
231 
237  CNodeMapFactory ExtractSubtree(const GENICAM_NAMESPACE::gcstring& SubTreeRootNodeName, bool doRenameToRoot = false);
238 
239 
241 
246  void Preprocess();
247 
248 
250  bool IsPreprocessed() const;
251 
252 
254 
259  void ReleaseCameraDescriptionFileData();
260 
261 
263  bool IsCameraDescriptionFileDataReleased() const;
264 
265 
267 
273  INodeMap* CreateNodeMap(const GENICAM_NAMESPACE::gcstring &DeviceName = "Device", bool DoReleaseCameraDescriptionFileData = true);
274 
275 
277 
285  INodeMap* CreateNodeMap(CLock& UserProvidedLock, const GENICAM_NAMESPACE::gcstring &DeviceName = "Device", bool DoReleaseCameraDescriptionFileData = true);
286 
287 
289  static INodeMap* CreateEmptyNodeMap();
290 
291 
293  static bool ClearCache();
294 
295 
300  void GetSupportedSchemaVersions(GENICAM_NAMESPACE::gcstring_vector &SchemaVersions) const;
301 
303  GENICAM_NAMESPACE::gcstring ToString() const;
304 
306  GENICAM_NAMESPACE::gcstring ToXml() const;
307 
308  static CNodeDataMap *CreateNodeDataFromNodeMap( INodeMap* pNodeMap );
309 
310  typedef struct
311  {
312  uint32_t NumNodes;
313  uint32_t NumProperties;
314  uint32_t NumLinks;
315  uint32_t NumStrings;
316  } NodeStatistics_t;
317 
318  void GetNodeStatistics(NodeStatistics_t &NodeStatistics);
319 
321  const GENICAM_NAMESPACE::gcstring ApplyStyleSheet(const GENICAM_NAMESPACE::gcstring& StyleSheetFileName);
322 
323  private:
324 
325  class CNodeMapFactoryImpl;
326 
327  CNodeMapFactoryImpl* m_pImpl;
328  };
329 }
The node map factory is used for creating node maps from camera description files.
Definition: NodeMapFactory.h:135
Zipped XML camera description file text.
Definition: NodeMapFactory.h:65
Portable string vector implementation.
ECacheUsage_t
Lists the cache usage strategies. The cache stores preprocessed camera description xml files providin...
Definition: NodeMapFactory.h:47
The use of cache files is determined automatically.
Definition: NodeMapFactory.h:49
Forces the loading and preprocessing of the camera description xml file. No cache file is written...
Definition: NodeMapFactory.h:54
XML camera description file text.
Definition: NodeMapFactory.h:64
virtual IBoolean & operator=(bool Value)
Set node value.
Definition: IBoolean.h:62
virtual void GetSupportedSchemaVersions(GENICAM_NAMESPACE::gcstring_vector &SchemaVersions)=0
Gets a list of supported schema versions.
Definition: NodeMapFactory.h:52
GENICAM_INTERFACE INodeMap
Interface to access the node map.
Definition: INode.h:50
A string class which is a clone of std::string.
Definition: GCString.h:50
Portable string implementation.
declspec&#39;s to be used for GenApi Windows dll
Definition: NodeMapFactory.h:50
Definition: ChunkAdapter.h:37
A lock class.
Definition: Synch.h:61
EContentType_t
Lists the processable file types.
Definition: NodeMapFactory.h:61