Robot Raconteur Companion C++ Library
Loading...
Searching...
No Matches
InfoFileLoader.h File Reference

Go to the source code of this file.

Functions

template<typename T>
static T RobotRaconteur::Companion::Util::LoadInfoFileFromString (const std::string &file_text, std::vector< LocalIdentifierLockPtr > &identifier_locks, const std::string &category="unspecified", boost::shared_ptr< RobotRaconteur::RobotRaconteurNode > node=boost::shared_ptr< RobotRaconteur::RobotRaconteurNode >())
 Load an info file from a string.
template<typename T>
static T RobotRaconteur::Companion::Util::LoadInfoFile (const std::string &file_name, std::vector< LocalIdentifierLockPtr > &identifier_locks, const std::string &category="unspecified", boost::shared_ptr< RobotRaconteur::RobotRaconteurNode > node=boost::shared_ptr< RobotRaconteur::RobotRaconteurNode >())
 Load an info file from a file.
template<typename T>
static T RobotRaconteur::Companion::Util::LoadInfoFileFromNode (YAML::Node &node, std::vector< LocalIdentifierLockPtr > &identifier_locks, const std::string &category="unspecified", boost::shared_ptr< RobotRaconteur::RobotRaconteurNode > rr_node=boost::shared_ptr< RobotRaconteur::RobotRaconteurNode >())
 Load an info file from a YAML node.

Detailed Description

Author
John Wason, PhD
License
Software License Agreement (Apache License)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ LoadInfoFile()

template<typename T>
T RobotRaconteur::Companion::Util::LoadInfoFile ( const std::string & file_name,
std::vector< LocalIdentifierLockPtr > & identifier_locks,
const std::string & category = "unspecified",
boost::shared_ptr< RobotRaconteur::RobotRaconteurNode > node = boost::shared_ptr<RobotRaconteur::RobotRaconteurNode>() )
static

Load an info file from a file.

Device information structures store metadata about devices that are provided to clients at runtime. The metadata is used to allow clients to determine the parameters and capabilities of the device. The exact type of the device info file depends on the device type. A number of device info structures are supported; see the documentation and examples.

The device info file is loaded from a file. The file is parsed as YAML. The YAML must be a valid representation of the device info structure.

The loader will "lock" the device identifier on the filesystem. It will automatically generate a UUID for the device name that will be persisted to the filesystem. This allows the device to be uniquely identified. Keep the contents of identifiers_lock in scope for the lifetime of the device.

Template Parameters
TThe type of the device info structure
Parameters
file_nameThe file name
identifier_locksThe vector to store the identifier locks
categoryThe category of the device. Should be "device" for most cases
nodeThe Robot Raconteur node
Returns
T The populated device info structure

◆ LoadInfoFileFromNode()

template<typename T>
T RobotRaconteur::Companion::Util::LoadInfoFileFromNode ( YAML::Node & node,
std::vector< LocalIdentifierLockPtr > & identifier_locks,
const std::string & category = "unspecified",
boost::shared_ptr< RobotRaconteur::RobotRaconteurNode > rr_node = boost::shared_ptr<RobotRaconteur::RobotRaconteurNode>() )
static

Load an info file from a YAML node.

Device information structures store metadata about devices that are provided to clients at runtime. The metadata is used to allow clients to determine the parameters and capabilities of the device. The exact type of the device info file depends on the device type. A number of device info structures are supported; see the documentation and examples.

The device info file is loaded from a YAML node. The YAML must be a valid representation of the device info structure.

The loader will "lock" the device identifier on the filesystem. It will automatically generate a UUID for the device name that will be persisted to the filesystem. This allows the device to be uniquely identified. Keep the contents of identifiers_lock in scope for the lifetime of the device.

Template Parameters
TThe type of the device info structure
Parameters
nodeThe YAML node
identifier_locksThe vector to store the identifier locks
categoryThe category of the device. Should be "device" for most cases
rr_nodeThe Robot Raconteur node
Returns
T The populated device info structure

◆ LoadInfoFileFromString()

template<typename T>
T RobotRaconteur::Companion::Util::LoadInfoFileFromString ( const std::string & file_text,
std::vector< LocalIdentifierLockPtr > & identifier_locks,
const std::string & category = "unspecified",
boost::shared_ptr< RobotRaconteur::RobotRaconteurNode > node = boost::shared_ptr<RobotRaconteur::RobotRaconteurNode>() )
static

Load an info file from a string.

Device information structures store metadata about devices that are provided to clients at runtime. The metadata is used to allow clients to determine the parameters and capabilities of the device. The exact type of the device info file depends on the device type. A number of device info structures are supported; see the documentation and examples.

The device info file is loaded from a string. The string is parsed as YAML. The YAML must be a valid representation of the device info structure.

The loader will "lock" the device identifier on the filesystem. It will automatically generate a UUID for the device name that will be persisted to the filesystem. This allows the device to be uniquely identified. Keep the contents of identifiers_lock in scope for the lifetime of the device.

Template Parameters
TThe type of the device info structure
Parameters
file_textThe YAML text
identifier_locksVector to store the identifier locks
categoryThe category of the device. Should be "device" for most cases
nodeThe Robot Raconteur node
Returns
T The populated device info structure