CVB++ 14.0
NodeMap Class Reference

Contains all nodes of a device or module. More...

#include <cvb/genapi/node_map.hpp>

Inherits enable_shared_from_this< NodeMap >.

Classes

class  GenApiVersion
 Version information for GenICam related objects. More...
 

Public Member Functions

void * Handle () const noexcept
 Classic API node map handle. More...
 
String Name () const noexcept
 Name used to access this node map. More...
 
String Description () const noexcept
 Gets the descriptive text of this node map. More...
 
String VendorName () const
 Gets the name of the vendor, who created the XML description. More...
 
String ModelName () const
 Gets the name of the model, that the XML description is for. More...
 
String TransportLayerNamespace () const
 Gets the transport layer type of the device. More...
 
String ToolTip () const
 Gets the short descriptive text, if any is available. More...
 
GenApiVersion XmlFileVersion () const
 Gets the XML version. More...
 
GenApiVersion XmlFileSchemaVersion () const
 Gets the XML schema version. More...
 
void PollNodes ()
 Polls all nodes of this node map that have a polling time. More...
 
void LoadSettings (const String &fileName)
 Loads the node values from the gcs file and sets the node values accordingly. More...
 
void SaveSettings (const String &fileName) const
 Saves all nodes which are streamable. More...
 
template<class RANGE >
TypedRange< void, String, RANGE >::type SaveSettings (const String &fileName, const RANGE &range) const
 Saves all nodes that are in a specific container. More...
 
template<class RANGE >
TypedRange< void, NodePtr, RANGE >::type SaveSettings (const String &fileName, const RANGE &range) const
 Saves all nodes which are in a given container. More...
 
template<class... NAMES>
VarArgRange< void, constString &, NAMES... >::type SaveSettings (const String &fileName, const NAMES &... names) const
 Saves all nodes which are in a given as argument. More...
 
template<class... NODES>
VarArgRange< void, constNode &, NODES... >::type SaveSettings (const String &fileName, const NODES &... nodes) const
 Saves all nodes which are in a given as argument. More...
 
std::vector< StringAvailableFiles () const
 Gets the currently available file identifiers, which can be downloaded or uploaded. More...
 
void DownloadFile (const String &fileName, const String &fileSelectorEntryName) const
 Downloads a file from the camera via the GenApi file download. More...
 
void UploadFile (const String &fileName, const String &fileSelectorEntryName)
 Uploads a file to the camera via the GenApi file upload. More...
 
template<class T >
std::shared_ptr< T > Node (const String &name) const
 Get the node with the given name from the node map. More...
 
NodePtr Node (const String &name) const
 Get the node with the given name from the node map. More...
 
std::map< String, NodePtrNodes () const
 Get a dictionary contain all nodes of this node map. More...
 

Static Public Member Functions

static NodeMapPtr FromHandle (HandleGuard< NodeMap > &&guard, const String &name, const Device &device)
 Creates a node map from a classic API handle. More...
 
static NodeMapPtr FromHandle (HandleGuard< NodeMap > &&guard, const String &name, void *provider)
 Creates a node map from a classic API handle. More...
 

Detailed Description

Contains all nodes of a device or module.

Example

Member Function Documentation

◆ AvailableFiles()

std::vector< String > AvailableFiles ( ) const
inline

Gets the currently available file identifiers, which can be downloaded or uploaded.

Returns
vector containing the file identifiers; empty array for none.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
DownloadFile
UploadFile

◆ Description()

String Description ( ) const
inlinenoexcept

Gets the descriptive text of this node map.

Returns
Descriptive text.
Exceptions
Doesnot throw any exception.

◆ DownloadFile()

void DownloadFile ( const String fileName,
const String fileSelectorEntryName 
) const
inline

Downloads a file from the camera via the GenApi file download.

Parameters
[in]fileNameComplete path to the file in which the data is to be stored.
[in]fileSelectorEntryNameSymbolic name of the EnumerationNode identifying the file to download.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
AvailableFiles for file ids which can be downloaded.

◆ FromHandle() [1/2]

NodeMapPtr FromHandle ( HandleGuard< NodeMap > &&  guard,
const String name,
const Device device 
)
inlinestatic

Creates a node map from a classic API handle.

Parameters
[in]guardLife time guard for C-API handle.
[in]nameName of the node map.
[in]deviceThe device this node map belongs to.
Returns
The node map created from the classic API handle.
Exceptions
Anyexception derived from std::exception including CvbException.

The node map takes ownership of the handle, so you must share it before using this function.

◆ FromHandle() [2/2]

static NodeMapPtr FromHandle ( HandleGuard< NodeMap > &&  guard,
const String name,
void *  provider 
)
inlinestatic

Creates a node map from a classic API handle.

Parameters
[in]guardLife time guard for C-API handle.
[in]nameName of the node map.
[in]providerThe raw handle the nodemap belongs to.
Returns
The node map created from the classic API handle.
Exceptions
Anyexception derived from std::exception including CvbException.

The node map takes ownership of the handle, so you must share it before using this function.

Attention
The provider handel must support the INodeMap2 interface. It may be a CVDSTREAM or DEVOBJ etc.

◆ Handle()

void * Handle ( ) const
inlinenoexcept

Classic API node map handle.

Returns
Classic API handle.
Exceptions
Doesnot throw any exception.

It is normally not necessary to work with this handle.

◆ LoadSettings()

void LoadSettings ( const String fileName)
inline

Loads the node values from the gcs file and sets the node values accordingly.

Parameters
[in]fileNameThe gcs file name.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ ModelName()

String ModelName ( ) const
inline

Gets the name of the model, that the XML description is for.

Returns
The model name.
Exceptions
Anyexception derived from std::exception including CvbException.
Attention
Often this name does not match the information of the GenTL port (discovery information).

◆ Name()

String Name ( ) const
inlinenoexcept

Name used to access this node map.

Returns
The node map name.
Exceptions
Doesnot throw any exception.

◆ Node() [1/2]

std::shared_ptr< T > Node ( const String name) const
inline

Get the node with the given name from the node map.

Parameters
[in]nameName of the node.
Returns
A pointer to the node, cast to the provided type.
Exceptions
Anyexception derived from std::exception including CvbException.

If a name without a namespace prefix is provided "Cust" is searched before "Std."

◆ Node() [2/2]

NodePtr Node ( const String name) const
inline

Get the node with the given name from the node map.

Parameters
[in]nameName of the node.
Returns
A pointer to the node
Exceptions
Anyexception derived from std::exception including CvbException.

If a name without a namespace prefix is provided "Cust" is searched before "Std."

Usually you should prefer the template version to get the appropriate node type.

auto booleanNode = nodeMap->Node<Cvb::BooleanNode>("NodeName");
Node representing a true / false value.
Definition: boolean_node.hpp:19

However, is some cases the actual node type might be unknown. In order to get the the node type you may use typeid.

auto node = nodeMap->Node("NodeName");
if(typeid(*node) == typeid(Cvb::BooleanNode))
{
auto booleanNode = std::dynamic_pointer_cast<Cvb::BooleanNode>(node);
}

◆ Nodes()

std::map< String, NodePtr > Nodes ( ) const
inline

Get a dictionary contain all nodes of this node map.

Returns
Dictionary with all nodes of the node map.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ PollNodes()

void PollNodes ( )
inline

Polls all nodes of this node map that have a polling time.

Exceptions
Anyexception derived from std::exception including CvbException.

◆ SaveSettings() [1/5]

void SaveSettings ( const String fileName) const
inline

Saves all nodes which are streamable.

Parameters
[in]fileNameFull path to gcs file to contain the settings.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SaveSettings() [2/5]

VarArgRange< void, constString &, NAMES... >::type SaveSettings ( const String fileName,
const NAMES &...  names 
) const
inline

Saves all nodes which are in a given as argument.

Parameters
[in]fileNameComplete path to gcs file that contains the settings.
[in]namesNames of the nodes to save.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SaveSettings() [3/5]

VarArgRange< void, constNode &, NODES... >::type SaveSettings ( const String fileName,
const NODES &...  nodes 
) const
inline

Saves all nodes which are in a given as argument.

Parameters
[in]fileNameComplete path to gcs file that contains the settings.
[in]nodesNodes to save.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SaveSettings() [4/5]

TypedRange< void, String, RANGE >::type SaveSettings ( const String fileName,
const RANGE &  range 
) const
inline

Saves all nodes that are in a specific container.

Parameters
[in]fileNameComplete path to gcs file that contains the settings.
[in]rangeWith node names as Strings.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SaveSettings() [5/5]

TypedRange< void, NodePtr, RANGE >::type SaveSettings ( const String fileName,
const RANGE &  range 
) const
inline

Saves all nodes which are in a given container.

Parameters
[in]fileNameComplete path to gcs file that contains the settings.
[in]rangeWith nodes as pointers.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ ToolTip()

String ToolTip ( ) const
inline

Gets the short descriptive text, if any is available.

Returns
The short descriptive text.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ TransportLayerNamespace()

String TransportLayerNamespace ( ) const
inline

Gets the transport layer type of the device.

Returns
The transport layer type.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ UploadFile()

void UploadFile ( const String fileName,
const String fileSelectorEntryName 
)
inline

Uploads a file to the camera via the GenApi file upload.

Parameters
[in]fileNameComplete path to the file to store data to.
[in]fileSelectorEntryNameSymbolic name of the EnumerationNode identifying the file to upload.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
AvailableFiles for file ids which can be uploaded.

◆ VendorName()

String VendorName ( ) const
inline

Gets the name of the vendor, who created the XML description.

Returns
The vendor name.
Exceptions
Anyexception derived from std::exception including CvbException.
Attention
Often this name does not match the information of the GenTL port (discovery information).

◆ XmlFileSchemaVersion()

GenApiVersion XmlFileSchemaVersion ( ) const
inline

Gets the XML schema version.

Returns
The XML schema version.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ XmlFileVersion()

GenApiVersion XmlFileVersion ( ) const
inline

Gets the XML version.

Returns
The XML version.
Exceptions
Anyexception derived from std::exception including CvbException.