|
Robot Raconteur Core C++ Library
|
Class for constant definitions. More...
#include <ServiceDefinition.h>
Public Member Functions | |
| ConstantDefinition (const boost::shared_ptr< ServiceDefinition > &service) | |
| Construct a new ConstantDefinition with a parent ServiceDefinition. | |
| ConstantDefinition (const boost::shared_ptr< ServiceEntryDefinition > &service_entry) | |
| Construct a new ConstantDefinition with a parent ServiceEntryDefinition. | |
| std::string | ToString () |
| Convert constant definition to string. | |
| void | FromString (boost::string_ref s, const ServiceDefinitionParseInfo *parse_info=NULL) |
| Parse a constant definition from string. | |
| void | Reset () |
| Clear all fields. | |
| bool | VerifyValue () const |
| Verify that this constant definition has a valid value. | |
| template<typename T> | |
| T | ValueToScalar () const |
| Convert the constant value to a numeric scalar. | |
| template<typename T> | |
| boost::intrusive_ptr< RRArray< T > > | ValueToArray () const |
| Convert the constant scalar to a numeric primitive array. | |
| std::string | ValueToString () |
| Convert the constant value to string. | |
| std::vector< ConstantDefinition_StructField > | ValueToStructFields () const |
| Convert the constant value to structure fields. | |
Static Public Member Functions | |
| static bool | VerifyTypeAndValue (TypeDefinition &t, boost::string_ref value) |
| Verify that the specified constant type and value are valid. | |
Public Attributes | |
| std::string | Name |
| The name of the constant. | |
| boost::shared_ptr< TypeDefinition > | Type |
| The value type of the constant. | |
| std::string | Value |
| The value of the constant, as a string. | |
| std::string | DocString |
| Documentation string for the constant. | |
| RR_WEAK_PTR< ServiceDefinition > | service |
| The parent service definition. | |
| RR_WEAK_PTR< ServiceEntryDefinition > | service_entry |
| The parent service entry. | |
| ServiceDefinitionParseInfo | ParseInfo |
| Parsing diagnostic information. | |
Class for constant definitions.
See service_definitions.md for more information.
| RobotRaconteur::ConstantDefinition::ConstantDefinition | ( | const boost::shared_ptr< ServiceDefinition > & | service | ) |
Construct a new ConstantDefinition with a parent ServiceDefinition.
Must be constructed with boost::make_shared<ConstantDefinition>()
| service | The parent service definition |
| RobotRaconteur::ConstantDefinition::ConstantDefinition | ( | const boost::shared_ptr< ServiceEntryDefinition > & | service_entry | ) |
Construct a new ConstantDefinition with a parent ServiceEntryDefinition.
Must be constructed with boost::make_shared<ConstantDefinition>()
| service_entry | The parent service entry definition |
| void RobotRaconteur::ConstantDefinition::FromString | ( | boost::string_ref | s, |
| const ServiceDefinitionParseInfo * | parse_info = NULL ) |
Parse a constant definition from string.
| s | The constant definition string |
| parse_info | Parsing diagnostic information |
| std::string RobotRaconteur::ConstantDefinition::ToString | ( | ) |
Convert constant definition to string.
|
inline |
Convert the constant scalar to a numeric primitive array.
| T | The numeric primitive type |
|
inline |
Convert the constant value to a numeric scalar.
| T | The numeric scalar type |
| std::string RobotRaconteur::ConstantDefinition::ValueToString | ( | ) |
Convert the constant value to string.
| std::vector< ConstantDefinition_StructField > RobotRaconteur::ConstantDefinition::ValueToStructFields | ( | ) | const |
Convert the constant value to structure fields.
|
static |
Verify that the specified constant type and value are valid.
| t | The type of the constant |
| value | The value of the constant |
| bool RobotRaconteur::ConstantDefinition::VerifyValue | ( | ) | const |
Verify that this constant definition has a valid value.
| ServiceDefinitionParseInfo RobotRaconteur::ConstantDefinition::ParseInfo |
Parsing diagnostic information.
The ParseInfo field is populated by FromString()
| RR_WEAK_PTR<ServiceDefinition> RobotRaconteur::ConstantDefinition::service |
The parent service definition.
service and service_entry are mutually exclusive
| RR_WEAK_PTR<ServiceEntryDefinition> RobotRaconteur::ConstantDefinition::service_entry |
The parent service entry.
service and service_entry are mutually exclusive