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

Class representing a service entry definition. More...

#include <ServiceDefinition.h>

Inheritance diagram for RobotRaconteur::ServiceEntryDefinition:
RobotRaconteur::NamedTypeDefinition

Public Member Functions

 ServiceEntryDefinition (const boost::shared_ptr< ServiceDefinition > &def)
 Construct a new empty ServiceEntryDefinition.
virtual std::string ToString ()
 Convert service entry definition to a string.
virtual void ToStream (std::ostream &os) const
 Convert service definition to a text stream.
void FromString (boost::string_ref s, const ServiceDefinitionParseInfo *parse_info=NULL)
 Parse a service entry definition from a string.
void FromString (boost::string_ref s, std::vector< ServiceDefinitionParseException > &warnings, const ServiceDefinitionParseInfo *parse_info=NULL)
 Parse a service entry definition from a string with warnings.
void FromStream (std::istream &is, const ServiceDefinitionParseInfo *parse_info=NULL)
 Parse a service entry definition from a stream.
void FromStream (std::istream &is, std::vector< ServiceDefinitionParseException > &warnings, const ServiceDefinitionParseInfo *parse_info=NULL)
 Parse a service entry definition from a stream with warnings.
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< boost::shared_ptr< MemberDefinition > > Members
 The members of the entry definition.
DataTypes EntryType
 The type code of the entry type.
std::vector< std::string > Implements
 Object types implemented by this object.
std::vector< std::string > Options
 The options declared in the service entry definition (deprecated).
std::vector< boost::shared_ptr< ConstantDefinition > > Constants
 The constants declared in the service entry definition.
ServiceDefinitionParseInfo ParseInfo
 Parsing diagnostic information.
std::string DocString
 Documentation string for the service entry.
RR_WEAK_PTR< ServiceDefinitionServiceDefinition_
 The parent service definition.
std::string Name
 The unqualified name of the type.

Detailed Description

Class representing a service entry definition.

Structures, Pods, NamedArrays, and Objects are service entries.

Service entries are contained within a parent ServiceDefinition.

See service_definitions.md for more information on service entry definitions and service definitions.

Use FromString() or FromStream() to parse a service entry definition. Use ToString() or ToStream() to convert the service entry definition to text.

Constructor & Destructor Documentation

◆ ServiceEntryDefinition()

RobotRaconteur::ServiceEntryDefinition::ServiceEntryDefinition ( const boost::shared_ptr< ServiceDefinition > & def)

Construct a new empty ServiceEntryDefinition.

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

Parameters
defThe parent service definition containing this service entry

Member Function Documentation

◆ FromStream() [1/2]

void RobotRaconteur::ServiceEntryDefinition::FromStream ( std::istream & is,
const ServiceDefinitionParseInfo * parse_info = NULL )

Parse a service entry definition from a stream.

Parsing individual service entries is not recommended. Use ServiceDefinition::FromStream() to parse the entire service definition instead.

Parameters
isThe stream containing the service entry definition text
parse_infoParsing diagnostic information

◆ FromStream() [2/2]

void RobotRaconteur::ServiceEntryDefinition::FromStream ( std::istream & is,
std::vector< ServiceDefinitionParseException > & warnings,
const ServiceDefinitionParseInfo * parse_info = NULL )

Parse a service entry definition from a stream with warnings.

Parsing individual service entries is not recommended. Use ServiceDefinition::FromStream() to parse the entire service definition instead.

Parameters
isThe stream containing the service entry definition text
warningsA vector to receive parse warnings
parse_infoParsing diagnostic information

◆ FromString() [1/2]

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

Parse a service entry definition from a string.

Parsing individual service entries is not recommended. Use ServiceDefinition::FromString() to parse the entire service definition instead.

Parameters
sThe service entry definition as a string
parse_infoParsing diagnostic information

◆ FromString() [2/2]

void RobotRaconteur::ServiceEntryDefinition::FromString ( boost::string_ref s,
std::vector< ServiceDefinitionParseException > & warnings,
const ServiceDefinitionParseInfo * parse_info = NULL )

Parse a service entry definition from a string with warnings.

Parsing individual service entries is not recommended. Use ServiceDefinition::FromString() to parse the entire service definition instead.

Parameters
sThe service entry definition as a string
warningsA vector to receive parse warnings
parse_infoParsing diagnostic information

◆ ResolveQualifiedName()

RR_OVIRTUAL std::string RobotRaconteur::ServiceEntryDefinition::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.

◆ ToStream()

virtual void RobotRaconteur::ServiceEntryDefinition::ToStream ( std::ostream & os) const
virtual

Convert service definition to a text stream.

Writes service entry definition to a stream

Parameters
osThe stream to write the service entry definition to

◆ ToString()

virtual std::string RobotRaconteur::ServiceEntryDefinition::ToString ( )
virtual

Convert service entry definition to a string.

Converts service entry definition to a string

Returns
std::string The service entry definition as a string

Member Data Documentation

◆ EntryType

DataTypes RobotRaconteur::ServiceEntryDefinition::EntryType

The type code of the entry type.

Valid type codes for service entries are DataTypes_structure_t, DataTypes_pod_t, DataTypes_namedarray_t, and DataTypes_object_t

◆ Implements

std::vector<std::string> RobotRaconteur::ServiceEntryDefinition::Implements

Object types implemented by this object.

Only valid for objects

◆ Members

std::vector<boost::shared_ptr<MemberDefinition> > RobotRaconteur::ServiceEntryDefinition::Members

The members of the entry definition.

Structure, Pods, and NamedArrays can only contain Field members.

Objects may contain Property, Function, Event, ObjRef, Pipe, Callback, Wire, and Memory members.

◆ ParseInfo

ServiceDefinitionParseInfo RobotRaconteur::ServiceEntryDefinition::ParseInfo

Parsing diagnostic information.

The ParseInfo field is populated by the FromString() or FromStream() functions

◆ ServiceDefinition_

RR_WEAK_PTR<ServiceDefinition> RobotRaconteur::ServiceEntryDefinition::ServiceDefinition_

The parent service definition.

Stored as a weak_ptr to prevent circular reference counts


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