Robot Raconteur Core C++ Library
Loading...
Searching...
No Matches
RobotRaconteur::EnumDefinition Class Reference

Class for enum definitions. More...

#include <ServiceDefinition.h>

Inheritance diagram for RobotRaconteur::EnumDefinition:
RobotRaconteur::NamedTypeDefinition

Public Member Functions

 EnumDefinition (const boost::shared_ptr< ServiceDefinition > &service)
 Construct a new empty EnumDefinition with a parent ServiceDefinition.
std::string ToString ()
 Convert enum definition to string.
void FromString (boost::string_ref s, const ServiceDefinitionParseInfo *parse_info=NULL)
 Parse an enum definition from string.
bool VerifyValues () const
 Verify that enum values are valid.
void Reset ()
 Clear all fields.
RR_OVIRTUAL DataTypes RRDataType () const RR_OVERRIDE
 The type code of the type.
RR_OVIRTUAL std::string ResolveQualifiedName () RR_OVERRIDE
 Resolves and returns the qualified name.

Public Attributes

std::vector< EnumDefinitionValueValues
 The values in the enum.
RR_WEAK_PTR< ServiceDefinitionservice
 The parent service definition.
ServiceDefinitionParseInfo ParseInfo
 Parsing diagnostic information.
std::string DocString
 Documentation string for the enum.
std::string Name
 The unqualified name of the type.

Detailed Description

Class for enum definitions.

See service_definitions.md for more information.

Constructor & Destructor Documentation

◆ EnumDefinition()

RobotRaconteur::EnumDefinition::EnumDefinition ( const boost::shared_ptr< ServiceDefinition > & service)

Construct a new empty EnumDefinition with a parent ServiceDefinition.

Must be constructed with boost::make_shared<EnumDefinition>()

Parameters
serviceThe parent service definition

Member Function Documentation

◆ FromString()

void RobotRaconteur::EnumDefinition::FromString ( boost::string_ref s,
const ServiceDefinitionParseInfo * parse_info = NULL )

Parse an enum definition from string.

Parameters
sThe enum definition string
parse_infoParsing diagnostic information

◆ ResolveQualifiedName()

RR_OVIRTUAL std::string RobotRaconteur::EnumDefinition::ResolveQualifiedName ( )
virtual

Resolves and returns the qualified name.

The Name field contains the unqualified name, meaning that it does not contain the service definition name. A qualified name contains the service definition name, a dot, and the unqualified name. An example is the qualified name "example.named_example.struct1", where "example.named_example" is the service definition name, and "struct1" is the unqualified name of the struct.

ResolveQualifiedName() will attempt to determine the fully qualified name of the type, or throw an exception if it is unable.

Implements RobotRaconteur::NamedTypeDefinition.

◆ ToString()

std::string RobotRaconteur::EnumDefinition::ToString ( )

Convert enum definition to string.

Returns
std::string The enum definition string

◆ VerifyValues()

bool RobotRaconteur::EnumDefinition::VerifyValues ( ) const

Verify that enum values are valid.

Returns
true Enum values are valid
false Enum values are invalid

Member Data Documentation

◆ ParseInfo

ServiceDefinitionParseInfo RobotRaconteur::EnumDefinition::ParseInfo

Parsing diagnostic information.

The ParseInfo field is populated by FromString()


The documentation for this class was generated from the following file: