C++ Interface

The file nxLibFunctions.h provides an object oriented interface to access the tree items and execute commands.


An instance of the NxLibItem class represents a single tree node. The object itself only has the item’s path as member variable. It provides member functions that wrap the C API functions.


This class can be instantiated to simplify the execution of commands. It takes a command name as parameter in its constructor and provides access to the Parameters and Result node. Its execute() member function allows for automatic synchronous or asynchronous command execution.


Please note the different types of error handling in C++, namely exceptions and return codes and then choose the corresponding overloaded function!

Error Handling

When using the NxLibItem and NxLibCommand classes error handling can be accomplished with the C++ exception mechanism by catching the NxLibException or by using return codes. For this reason, all class member functions are provided in two overloaded variants: one taking an int* as first parameter to return the error code, and one taking only the required function parameters. The latter will throw an exception of type NxLibException whenever an API call fails. The corresponding API return code can then be extracted from the exception object.