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
36namespace GENAPI_NAMESPACE
37{
38 class CLock; // forward
39 class CNodeDataMap;
40 struct INodeMap;
41
56
61 typedef enum
62 {
63 //ContentType_Auto,
66 } EContentType_t;
67
68
69
70
71 //*************************************************************
72 // CNodeMapFactory
73 //*************************************************************
74
135 class GENAPI_DECL CNodeMapFactory
136 {
137 public:
140
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
224
225
227 bool IsLoaded() const;
228
229
231
237 CNodeMapFactory ExtractSubtree(const GENICAM_NAMESPACE::gcstring& SubTreeRootNodeName, bool doRenameToRoot = false);
238
239
241
247
248
250 bool IsPreprocessed() const;
251
252
254
260
261
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
290
291
293 static bool ClearCache();
294
295
300 void GetSupportedSchemaVersions(GENICAM_NAMESPACE::gcstring_vector &SchemaVersions) const;
301
304
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
322
323 private:
324
325 class CNodeMapFactoryImpl;
326
327 CNodeMapFactoryImpl* m_pImpl;
328 };
329}
Portable string vector implementation.
Portable string implementation.
declspec's to be used for GenApi Windows dll
A lock class.
Definition Synch.h:62
The node map factory is used for creating node maps from camera description files.
Definition NodeMapFactory.h:136
void AddInjectionData(CNodeMapFactory &injectionData)
Adds a node map factory representing a camera description file to inject.
CNodeMapFactory(EContentType_t ContentType, const void *pData, size_t DataSize, ECacheUsage_t CacheUsage=CacheUsage_Automatic, bool SuppressStringsOnLoad=false)
Creates the node map factory and simply stores the pointer and the size of the provided camera descri...
void ReleaseCameraDescriptionFileData()
Advanced: Releases any in constructors provided camera description file data buffers or files.
GENICAM_NAMESPACE::gcstring ToXml() const
Outputs the pre-processed node map in XML form (mainly for debug purpose)
static INodeMap * CreateEmptyNodeMap()
Creates an empty node map usable as placeholder, e.g. if certain features are not supported by a modu...
INodeMap * CreateNodeMap(const GENICAM_NAMESPACE::gcstring &DeviceName="Device", bool DoReleaseCameraDescriptionFileData=true)
Creates a node map from the preprocessed memory internal representation of the camera description fil...
CNodeMapFactory ExtractSubtree(const GENICAM_NAMESPACE::gcstring &SubTreeRootNodeName, bool doRenameToRoot=false)
The name of the node that represents the root of the subtree that shall be extracted.
bool IsLoaded() const
Can be used to check whether the LoadAndInject() processing step has been performed....
bool IsCameraDescriptionFileDataReleased() const
Can be used to check whether the ReleaseCameraDescriptionFileData() processing step has been performe...
void LoadAndInject()
Advanced: Loads, Parses, and Injects the camera description files recursively. The result is a memory...
GENICAM_NAMESPACE::gcstring ToString() const
Outputs the pre-processed node map in string form (for debug purpose)
CNodeMapFactory()
Creates an empty node map factory for assigning a non-empty node map factory later.
bool IsEmpty() const
Returns true if nothing is loaded (IsLoaded()) and no source data is available, e....
CNodeMapFactory & operator=(const CNodeMapFactory &)
Creates another reference to the assigned node map factory data. Destroys the "overwritten" node map ...
CNodeMapFactory(const GENICAM_NAMESPACE::gcstring &XmlData, ECacheUsage_t CacheUsage=CacheUsage_Automatic, bool SuppressStringsOnLoad=false)
Creates the node map factory and copies the provided camera description file string.
bool IsPreprocessed() const
Can be used to check whether the Preprocess() processing step has been performed.
INodeMap * CreateNodeMap(CLock &UserProvidedLock, const GENICAM_NAMESPACE::gcstring &DeviceName="Device", bool DoReleaseCameraDescriptionFileData=true)
Creates a node map from the preprocessed memory internal representation of the camera description fil...
static bool ClearCache()
Deletes all preprocessed camera description files from the cache.
void GetSupportedSchemaVersions(GENICAM_NAMESPACE::gcstring_vector &SchemaVersions) const
CNodeMapFactory(const CNodeMapFactory &)
Creates another reference to the node map factory data. No data is copied.
const GENICAM_NAMESPACE::gcstring ApplyStyleSheet(const GENICAM_NAMESPACE::gcstring &StyleSheetFileName)
Applies a style sheet to the pre-processed node map.
virtual ~CNodeMapFactory()
Destroys the node map factory data if all references to the data have been released.
void Preprocess()
Advanced: Creates the preprocessed memory internal representation of the camera description file(s),...
CNodeMapFactory(EContentType_t FileType, const GENICAM_NAMESPACE::gcstring &FileName, ECacheUsage_t CacheUsage=CacheUsage_Automatic, bool SuppressStringsOnLoad=false)
Creates the node map factory and simply stores the full path to the provided camera description file ...
A string class which is a clone of std::string.
Definition GCString.h:51
GENICAM_INTERFACE INodeMap
Interface to access the node map.
Definition INode.h:50
EContentType_t
Lists the processable file types.
Definition NodeMapFactory.h:62
ECacheUsage_t
Lists the cache usage strategies. The cache stores preprocessed camera description xml files providin...
Definition NodeMapFactory.h:48
@ ContentType_ZippedXml
Zipped XML camera description file text.
Definition NodeMapFactory.h:65
@ ContentType_Xml
XML camera description file text.
Definition NodeMapFactory.h:64
@ CacheUsage_Automatic
The use of cache files is determined automatically.
Definition NodeMapFactory.h:49
@ CacheUsage_ForceWrite
Definition NodeMapFactory.h:50
@ CacheUsage_Ignore
Forces the loading and preprocessing of the camera description xml file. No cache file is written.
Definition NodeMapFactory.h:54
@ CacheUsage_ForceRead
Definition NodeMapFactory.h:52