The node map factory is used for creating node maps from camera description files. See the following for some examples.
More...
#include <NodeMapFactory.h>
Classes | |
struct | NodeStatistics_t |
Public Member Functions | |
CNodeMapFactory () | |
Creates an empty node map factory for assigning a non-empty node map factory later. | |
virtual | ~CNodeMapFactory () |
Destroys the node map factory data if all references to the data have been released. | |
CNodeMapFactory (const CNodeMapFactory &) | |
Creates another reference to the node map factory data. | |
CNodeMapFactory & | operator= (const CNodeMapFactory &) |
Creates another reference to the assigned node map factory data. | |
CNodeMapFactory (EContentType_t FileType, const GenICam::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 data. | |
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 description file data. | |
CNodeMapFactory (const GenICam::gcstring &XmlData, ECacheUsage_t CacheUsage=CacheUsage_Automatic, bool SuppressStringsOnLoad=false) | |
Creates the node map factory and copies the provided camera description file string. | |
bool | IsEmpty () const |
Returns true if nothing is loaded (IsLoaded()) and no source data is available, e.g. | |
void | AddInjectionData (CNodeMapFactory &injectionData) |
Adds a node map factory representing a camera description file to inject. | |
void | LoadAndInject () |
Advanced: Loads, Parses, and Injects the camera description files recursively. | |
bool | IsLoaded () const |
Can be used to check whether the LoadAndInject() processing step has been performed. | |
CNodeMapFactory | ExtractSubtree (const GenICam::gcstring &SubTreeRootNodeName, bool doRenameToRoot=false) |
The name of the node that represents the root of the subtree that shall be extracted. | |
void | Preprocess () |
Advanced: Creates the preprocessed memory internal representation of the camera description file(s), the CNodeDataMap (not part of the public interface). | |
bool | IsPreprocessed () const |
Can be used to check whether the Preprocess() processing step has been performed. | |
void | ReleaseCameraDescriptionFileData () |
Advanced: Releases any in constructors provided camera description file data buffers or files. | |
bool | IsCameraDescriptionFileDataReleased () const |
Can be used to check whether the ReleaseCameraDescriptionFileData() processing step has been performed. | |
INodeMap * | CreateNodeMap (const GenICam::gcstring &DeviceName="Device", bool DoReleaseCameraDescriptionFileData=true) |
Creates a node map from the preprocessed memory internal representation of the camera description file(s). | |
INodeMap * | CreateNodeMap (CLock &UserProvidedLock, const GenICam::gcstring &DeviceName="Device", bool DoReleaseCameraDescriptionFileData=true) |
Creates a node map from the preprocessed memory internal representation of the camera description file(s). | |
void | GetSupportedSchemaVersions (GenICam::gcstring_vector &SchemaVersions) const |
GenICam::gcstring | ToString () const |
Outputs the pre-processed node map in string form (for debug purpose) | |
GenICam::gcstring | ToXml () const |
Outputs the pre-processed node map in XML form (mainly for debug purpose) | |
void | GetNodeStatistics (NodeStatistics_t &NodeStatistics) |
const GenICam::gcstring | ApplyStyleSheet (const GenICam::gcstring &StyleSheetFileName) |
Applies a style sheet to the pre-processed node map. | |
Static Public Member Functions | |
static INodeMap * | CreateEmptyNodeMap () |
Creates an empty node map usable as placeholder, e.g. | |
static bool | ClearCache () |
Deletes all preprocessed camera description files from the cache. | |
static CNodeDataMap * | CreateNodeDataFromNodeMap (INodeMap *pNodeMap) |
The node map factory is used for creating node maps from camera description files. See the following for some examples.
Note: The CNodeMapFactory is not thread-safe.
You need to take care when camera description file data can be actually be freed, see method documentation of the node map factory for more detail.
CNodeMapFactory | ( | ) |
Creates an empty node map factory for assigning a non-empty node map factory later.
|
virtual |
Destroys the node map factory data if all references to the data have been released.
CNodeMapFactory | ( | const CNodeMapFactory & | ) |
Creates another reference to the node map factory data.
No data is copied.
CNodeMapFactory | ( | EContentType_t | FileType, |
const GenICam::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 data.
[in] | FileType | Defines how the camera description file is stored, e.g. as zipped XML text. |
[in] | FileName | The full path of the camera description file to process. |
[in] | CacheUsage | Defines if and how to use the cache for preprocessed camera description files. |
[in] | SuppressStringsOnLoad | Suppresses loading strings that are not needed for most use cases, e.g. node tooltip or description, for reducing the memory footprint. |
Throws an invalid argument exception if FileName is empty. Throws if environment variables in FileName cannot be resolved.
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 description file data.
[in] | ContentType | Defines how the camera description file is stored, e.g. as zipped XML text. |
[in] | pData | The pointer to the camera description file data. |
[in] | DataSize | The size of the camera description file data. |
[in] | CacheUsage | Defines if and how to use the cache for preprocessed camera description files. |
[in] | SuppressStringsOnLoad | Suppresses loading strings that are not needed for most use cases, e.g. node tooltip or description, for reducing the memory footprint. |
Throws an invalid argument exception if pData is NULL or DataSize is 0.
CNodeMapFactory | ( | const GenICam::gcstring & | XmlData, |
ECacheUsage_t | CacheUsage = CacheUsage_Automatic , |
||
bool | SuppressStringsOnLoad = false |
||
) |
Creates the node map factory and copies the provided camera description file string.
[in] | XmlData | The camera description file data as XML text. The provided text is copied. You can use the overloaded constructor accepting a buffer to avoid that. gcstring cdfData; //... fill cdfData ... CNodeMapFactory factory(ContentType_Xml, cfdData.c_str(), cfdData.size()); // Create the node map. The node map can be destroyed using the IDestroy interface later. INodeMap* pNodeMap = factory.CreateNodeMap(); // The next step is attaching the device port (not shown). |
[in] | CacheUsage | Defines if and how to use the cache for preprocessed camera description files. |
[in] | SuppressStringsOnLoad | Suppresses loading strings that are not needed for most use cases, e.g. node tooltip or description, for reducing the memory footprint. |
Throws an invalid argument exception if XmlData is empty.
void AddInjectionData | ( | CNodeMapFactory & | injectionData | ) |
Adds a node map factory representing a camera description file to inject.
[in] | injectionData | A node map factory representing a camera description file to inject. |
The injected files are injected in the order they are added. InjectionData must not be preprocessed. The IsPreprocessed() method can be used to check if preprocessing has been done before. The cache usage of injection data is ignored.
const GenICam::gcstring ApplyStyleSheet | ( | const GenICam::gcstring & | StyleSheetFileName | ) |
Applies a style sheet to the pre-processed node map.
|
static |
Deletes all preprocessed camera description files from the cache.
|
static |
Creates an empty node map usable as placeholder, e.g.
if certain features are not supported by a module.
|
static |
INodeMap * CreateNodeMap | ( | CLock & | UserProvidedLock, |
const GenICam::gcstring & | DeviceName = "Device" , |
||
bool | DoReleaseCameraDescriptionFileData = true |
||
) |
Creates a node map from the preprocessed memory internal representation of the camera description file(s).
Preprocess() is automatically called if needed. The preprocess step can be omitted by the factory depending on the cache mode setting when a cache file is available, then the cache file is read and converted directly into a node map. ReleaseCameraDescriptionFileData() is called if DoReleaseCameraDescriptionFileData is true. This method can be called multiple times to create multiple instances of a node map. This method allows to provide an external lock to avoid using too many locks in an application.
INodeMap * CreateNodeMap | ( | const GenICam::gcstring & | DeviceName = "Device" , |
bool | DoReleaseCameraDescriptionFileData = true |
||
) |
Creates a node map from the preprocessed memory internal representation of the camera description file(s).
Preprocess() is automatically called if needed. The preprocess step can be omitted by the factory depending on the cache mode setting when a cache file is available, then the cache file is read and converted directly into a node map. ReleaseCameraDescriptionFileData() is called if DoReleaseCameraDescriptionFileData is true. This method can be called multiple times to create multiple instances of a node map.
CNodeMapFactory ExtractSubtree | ( | const GenICam::gcstring & | SubTreeRootNodeName, |
bool | doRenameToRoot = false |
||
) |
The name of the node that represents the root of the subtree that shall be extracted.
[in] | SubTreeRootNodeName | The root of the branch to extract, e.g. "ChunkData". |
[in] | doRenameToRoot | Renames the extracted subtree root node SubTreeRootNodeName to "Root", sets the IsFeature property. Preprocess() is automatically called if needed to create the memory internal representation of the camera description file(s). The preprocessed result can be read from the cache or written to the cache in this step. This depends on the availability of a cache and the used CacheUsage setting. |
void GetNodeStatistics | ( | NodeStatistics_t & | NodeStatistics | ) |
void GetSupportedSchemaVersions | ( | GenICam::gcstring_vector & | SchemaVersions | ) | const |
Each list entry is a string with the format "Major.Minor" were Major and Minor are integers Example: "1.1", "1.2" indicates that the schema v1.1 and v1.2 are supported. The SubMinor version number is not given since it is for fully compatible bug fixes only
bool IsCameraDescriptionFileDataReleased | ( | ) | const |
Can be used to check whether the ReleaseCameraDescriptionFileData() processing step has been performed.
bool IsEmpty | ( | ) | const |
Returns true if nothing is loaded (IsLoaded()) and no source data is available, e.g.
when the node map factory has been created with the default constructor.
bool IsLoaded | ( | ) | const |
Can be used to check whether the LoadAndInject() processing step has been performed.
Returns true if IsPreprocessed() returns true (Preprocessed Data has been loaded from cache).
bool IsPreprocessed | ( | ) | const |
Can be used to check whether the Preprocess() processing step has been performed.
void LoadAndInject | ( | ) |
Advanced: Loads, Parses, and Injects the camera description files recursively.
The result is a memory internal representation of the camera description file(s), the CNodeDataMap (not part of the public interface).
This step is usually done automatically. Prevents cache read if called manually.
CNodeMapFactory & operator= | ( | const CNodeMapFactory & | ) |
Creates another reference to the assigned node map factory data.
Destroys the "overwritten" 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), the CNodeDataMap (not part of the public interface).
This step is usually done automatically. Preprocessed data can be read from the cache or written to the cache in this step. This depends on the availability of a cache and the used CacheUsage setting. By calling this method directly direct cache load is suppressed, see CreateNodeMap() for more information.
void ReleaseCameraDescriptionFileData | ( | ) |
Advanced: Releases any in constructors provided camera description file data buffers or files.
This step is usually done automatically. All references to added injection data are dropped in this step to free the data. After this step any in constructors provided buffers can be freed or any in constructors given files can be deleted.
GenICam::gcstring ToString | ( | ) | const |
Outputs the pre-processed node map in string form (for debug purpose)
GenICam::gcstring ToXml | ( | ) | const |
Outputs the pre-processed node map in XML form (mainly for debug purpose)