<< Click to Display Table of Contents >> Navigation: NxLib API > C++ Interface > NxLibCommand |
This class simplifies the execution of NxLib commands. The command name must be specified on construction. The parameters() and result() functions provide access to the corresponding Parameters and Result nodes of the tree. The execute() then writes the previously specified command name into the Command item and allows for synchronous and asynchronous command execution.
NxLibCommand(std::string const& commandName)
When using this constructor the NxLibCommand object creates a temporary slot within the Execute node on construction and automatically deletes it when the command object and any exceptions it might have thrown got destructed.
NxLibCommand(std::string const& commandName, std::string const& nodeName)
With this constructor, the NxLibCommand gets executed in the given slot in the Execute node. This slot is persistent and doesn't get deleted when the command object is destroyed.