31 #include <boost/tuple/tuple.hpp>
32 #include <boost/range/iterator_range.hpp>
33 #include <boost/algorithm/string.hpp>
34 #include <boost/lexical_cast.hpp>
36 namespace RobotRaconteur
38 class ROBOTRACONTEUR_CORE_API ServiceEntryDefinition;
39 class ROBOTRACONTEUR_CORE_API MemberDefinition;
40 class ROBOTRACONTEUR_CORE_API FunctionDefinition;
41 class ROBOTRACONTEUR_CORE_API PropertyDefinition;
42 class ROBOTRACONTEUR_CORE_API EventDefinition;
43 class ROBOTRACONTEUR_CORE_API ObjRefDefinition;
44 class ROBOTRACONTEUR_CORE_API PipeDefinition;
45 class ROBOTRACONTEUR_CORE_API CallbackDefinition;
46 class ROBOTRACONTEUR_CORE_API WireDefinition;
47 class ROBOTRACONTEUR_CORE_API MemoryDefinition;
48 class ROBOTRACONTEUR_CORE_API TypeDefinition;
49 class ROBOTRACONTEUR_CORE_API ExceptionDefinition;
50 class ROBOTRACONTEUR_CORE_API UsingDefinition;
51 class ROBOTRACONTEUR_CORE_API ConstantDefinition;
52 class ROBOTRACONTEUR_CORE_API EnumDefinition;
53 class ROBOTRACONTEUR_CORE_API EnumDefinitionValue;
55 class ROBOTRACONTEUR_CORE_API ServiceDefinitionParseException;
56 class ROBOTRACONTEUR_CORE_API ServiceDefinitionVerifyException;
168 operator bool()
const;
229 RR_OVIRTUAL
const char* what()
const throw() RR_OVERRIDE;
234 std::string what_store;
283 RR_OVIRTUAL
const char* what()
const throw() RR_OVERRIDE;
288 std::string what_store;
302 class ROBOTRACONTEUR_CORE_API
ServiceDefinition :
public RR_ENABLE_SHARED_FROM_THIS<ServiceDefinition>
309 std::vector<RR_SHARED_PTR<ServiceEntryDefinition> >
Structures;
311 std::vector<RR_SHARED_PTR<ServiceEntryDefinition> >
Pods;
315 std::vector<RR_SHARED_PTR<ServiceEntryDefinition> >
Objects;
324 std::vector<RR_SHARED_PTR<UsingDefinition> >
Using;
330 std::vector<RR_SHARED_PTR<ConstantDefinition> >
Constants;
333 std::vector<RR_SHARED_PTR<EnumDefinition> >
Enums;
388 void FromString(boost::string_ref s, std::vector<ServiceDefinitionParseException>& warnings,
426 void FromStream(std::istream& is, std::vector<ServiceDefinitionParseException>& warnings,
511 std::vector<RR_SHARED_PTR<MemberDefinition> >
Members;
533 std::vector<RR_SHARED_PTR<ConstantDefinition> >
Constants;
600 void FromString(boost::string_ref s, std::vector<ServiceDefinitionParseException>& warnings,
626 void FromStream(std::istream& is, std::vector<ServiceDefinitionParseException>& warnings,
643 RR_OVIRTUAL std::
string ResolveQualifiedName() RR_OVERRIDE;
688 MemberDefinition(
const RR_SHARED_PTR<ServiceEntryDefinition>& ServiceEntry);
731 RR_SHARED_PTR<TypeDefinition>
Type;
749 RR_OVIRTUAL std::string ToString() RR_OVERRIDE;
760 std::
string ToString(
bool isstruct) const;
774 RR_OVIRTUAL
void Reset() RR_OVERRIDE;
816 RR_OVIRTUAL std::string ToString() RR_OVERRIDE;
830 RR_OVIRTUAL
void Reset() RR_OVERRIDE;
869 RR_OVIRTUAL std::string ToString() RR_OVERRIDE;
883 RR_OVIRTUAL
void Reset() RR_OVERRIDE;
934 RR_OVIRTUAL std::string ToString() RR_OVERRIDE;
948 RR_OVIRTUAL
void Reset() RR_OVERRIDE;
964 RR_SHARED_PTR<TypeDefinition>
Type;
975 RR_OVIRTUAL std::string ToString() RR_OVERRIDE;
989 RR_OVIRTUAL
void Reset() RR_OVERRIDE;
1012 bool IsUnreliable() const;
1043 RR_OVIRTUAL std::string ToString() RR_OVERRIDE;
1057 RR_OVIRTUAL
void Reset() RR_OVERRIDE;
1073 RR_SHARED_PTR<TypeDefinition>
Type;
1084 RR_OVIRTUAL std::string ToString() RR_OVERRIDE;
1098 RR_OVIRTUAL
void Reset() RR_OVERRIDE;
1125 RR_SHARED_PTR<TypeDefinition>
Type;
1136 RR_OVIRTUAL std::string ToString() RR_OVERRIDE;
1150 RR_OVIRTUAL
void Reset() RR_OVERRIDE;
1269 RR_SHARED_PTR<TypeDefinition>
Clone()
const;
1339 const std::vector<RR_SHARED_PTR<ServiceDefinition> >& other_defs =
1340 std::vector<RR_SHARED_PTR<ServiceDefinition> >(),
1341 const RR_SHARED_PTR<RobotRaconteurNode>& node = RR_SHARED_PTR<RobotRaconteurNode>(),
1342 const RR_SHARED_PTR<RRObject>& client = RR_SHARED_PTR<RRObject>());
1345 RR_WEAK_PTR<NamedTypeDefinition> ResolveNamedType_cache;
1481 RR_SHARED_PTR<TypeDefinition>
Type;
1572 template <
typename T>
1576 if (!detail::try_convert_string_to_number(boost::trim_copy(Value), v))
1589 template <
typename T>
1592 boost::iterator_range<std::string::const_iterator> value1(Value);
1593 value1 = boost::trim_copy_if(value1, boost::is_any_of(
" \t{}"));
1594 value1 = boost::trim_copy(value1);
1596 return AllocateRRArray<T>(0);
1601 typedef boost::split_iterator<std::string::const_iterator> string_split_iterator;
1602 for (string_split_iterator e = boost::make_split_iterator(
1603 value1, boost::token_finder(boost::is_any_of(
","), boost::token_compress_on));
1604 e != string_split_iterator(); e++)
1609 RR_INTRUSIVE_PTR<RRArray<T> > o = AllocateRRArray<T>(n);
1614 typedef boost::split_iterator<std::string::const_iterator> string_split_iterator;
1615 for (string_split_iterator e = boost::make_split_iterator(
1616 value1, boost::token_finder(boost::is_any_of(
","), boost::token_compress_on));
1617 e != string_split_iterator(); e++)
1619 if (!detail::try_convert_string_to_number(boost::trim_copy(*e), (*o)[i]))
1645 static std::string UnescapeString(boost::string_ref in);
1646 static std::string EscapeString(boost::string_ref in);
1714 RR_OVIRTUAL std::
string ResolveQualifiedName() RR_OVERRIDE;
1759 std::vector<ServiceDefinitionParseException>& warnings);
1785 const RR_SHARED_PTR<ServiceDefinition>& def2);
1796 ROBOTRACONTEUR_CORE_API boost::tuple<boost::string_ref, boost::string_ref>
SplitQualifiedName(boost::string_ref name);
1806 template <
typename T>
1807 RR_SHARED_PTR<T>
TryFindByName(
const std::vector<RR_SHARED_PTR<T> >& v, boost::string_ref name)
1809 for (
typename std::vector<RR_SHARED_PTR<T> >::const_iterator e = v.begin(); e != v.end(); ++e)
1811 const RR_SHARED_PTR<T>& ee = *e;
1814 if (ee->Name == name)
1821 return RR_SHARED_PTR<T>();
1824 ROBOTRACONTEUR_CORE_API
size_t EstimatePodPackedElementSize(
1825 const RR_SHARED_PTR<ServiceEntryDefinition>& def,
1826 const std::vector<RR_SHARED_PTR<ServiceDefinition> >& other_defs = std::vector<RR_SHARED_PTR<ServiceDefinition> >(),
1827 const RR_SHARED_PTR<RobotRaconteurNode>& node = RR_SHARED_PTR<RobotRaconteurNode>(),
1828 const RR_SHARED_PTR<RRObject>& client = RR_SHARED_PTR<RRObject>());
1830 ROBOTRACONTEUR_CORE_API boost::tuple<DataTypes, size_t> GetNamedArrayElementTypeAndCount(
1831 const RR_SHARED_PTR<ServiceEntryDefinition>& def,
1832 const std::vector<RR_SHARED_PTR<ServiceDefinition> >& other_defs = std::vector<RR_SHARED_PTR<ServiceDefinition> >(),
1833 const RR_SHARED_PTR<RobotRaconteurNode>& node = RR_SHARED_PTR<RobotRaconteurNode>(),
1834 const RR_SHARED_PTR<RRObject>& client = RR_SHARED_PTR<RRObject>());
1836 #ifndef ROBOTRACONTEUR_NO_CXX11_TEMPLATE_ALIASES
MemberDefinition_NoLock
Member locking options enum.
Definition: RobotRaconteurConstants.h:550
DataTypes_ContainerTypes
Container type enum for TypeDefinition parser class.
Definition: RobotRaconteurConstants.h:126
MemberDefinition_Direction
Member direction enum.
Definition: RobotRaconteurConstants.h:534
DataTypes
Type codes for types supported by Robot Raconteur.
Definition: RobotRaconteurConstants.h:41
DataTypes_ArrayTypes
Array type enum for TypeDefinition parser class.
Definition: RobotRaconteurConstants.h:112
bool CompareServiceDefinitions(const boost::shared_ptr< ServiceDefinition > &def1, const boost::shared_ptr< ServiceDefinition > &def2)
Compare two service definitions to see if they are identical.
boost::shared_ptr< CallbackDefinition > CallbackDefinitionPtr
Convenience alias for CallbackDefinition shared_ptr.
Definition: ServiceDefinition.h:1856
boost::shared_ptr< ConstantDefinition > ConstantDefinitionPtr
Convenience alias for ConstantDefinition shared_ptr.
Definition: ServiceDefinition.h:1868
boost::shared_ptr< ServiceEntryDefinition > ServiceEntryDefinitionPtr
Convenience alias for ServiceEntryDefinition shared_ptr.
Definition: ServiceDefinition.h:1842
boost::shared_ptr< FunctionDefinition > FunctionDefinitionPtr
Convenience alias for FunctionDefinition shared_ptr.
Definition: ServiceDefinition.h:1846
boost::shared_ptr< WireDefinition > WireDefinitionPtr
Convenience alias for WireDefinition shared_ptr.
Definition: ServiceDefinition.h:1858
void VerifyServiceDefinitions(const std::vector< boost::shared_ptr< ServiceDefinition > > &def, std::vector< ServiceDefinitionParseException > &warnings)
Verify that service definitions are valid.
boost::shared_ptr< PipeDefinition > PipeDefinitionPtr
Convenience alias for PipeDefinition shared_ptr.
Definition: ServiceDefinition.h:1854
boost::shared_ptr< UsingDefinition > UsingDefinitionPtr
Convenience alias for UsingDefinition shared_ptr.
Definition: ServiceDefinition.h:1864
boost::shared_ptr< T > TryFindByName(const std::vector< boost::shared_ptr< T > > &v, boost::string_ref name)
Try finding a vector element by the Name field.
Definition: ServiceDefinition.h:1807
boost::shared_ptr< MemoryDefinition > MemoryDefinitionPtr
Convenience alias for MemoryDefinition shared_ptr.
Definition: ServiceDefinition.h:1860
boost::shared_ptr< ServiceDefinition > ServiceDefinitionPtr
Convenience alias for ServiceDefinition shared_ptr.
Definition: ServiceDefinition.h:1838
boost::shared_ptr< PropertyDefinition > PropertyDefinitionPtr
Convenience alias for PropertyDefinition shared_ptr.
Definition: ServiceDefinition.h:1848
boost::shared_ptr< EventDefinition > EventDefinitionPtr
Convenience alias for EventDefinition shared_ptr.
Definition: ServiceDefinition.h:1850
boost::tuple< boost::string_ref, boost::string_ref > SplitQualifiedName(boost::string_ref name)
Split a qualified name into its service definition name and unqualified name parts.
boost::shared_ptr< EnumDefinition > EnumDefinitionPtr
Convenience alias for EnumDefinition shared_ptr.
Definition: ServiceDefinition.h:1866
boost::shared_ptr< TypeDefinition > TypeDefinitionPtr
Convenience alias for TypeDefinition shared_ptr.
Definition: ServiceDefinition.h:1862
boost::shared_ptr< NamedTypeDefinition > NamedTypeDefinitionPtr
Convenience alias for NamedTypeDefinition shared_ptr.
Definition: ServiceDefinition.h:1840
boost::shared_ptr< ObjRefDefinition > ObjRefDefinitionPtr
Convenience alias for ObjRefDefinition shared_ptr.
Definition: ServiceDefinition.h:1852
boost::shared_ptr< MemberDefinition > MemberDefinitionPtr
Convenience alias for memberDefinition shared_ptr.
Definition: ServiceDefinition.h:1844
Class for callback member definitions.
Definition: ServiceDefinition.h:1025
CallbackDefinition(const boost::shared_ptr< ServiceEntryDefinition > &ServiceEntry)
Construct a new empty CallbackDefinition object.
std::vector< boost::shared_ptr< TypeDefinition > > Parameters
The parameter types and names of the callback.
Definition: ServiceDefinition.h:1032
boost::shared_ptr< TypeDefinition > ReturnType
The return type of the callback. May be void.
Definition: ServiceDefinition.h:1030
Class for constant definitions.
Definition: ServiceDefinition.h:1473
void FromString(boost::string_ref s, const ServiceDefinitionParseInfo *parse_info=NULL)
Parse a constant definition from string.
bool VerifyValue() const
Verify that this constant definition has a valid value.
T ValueToScalar() const
Convert the constant value to a numeric scalar.
Definition: ServiceDefinition.h:1573
boost::intrusive_ptr< RRArray< T > > ValueToArray() const
Convert the constant scalar to a numeric primitive array.
Definition: ServiceDefinition.h:1590
std::vector< ConstantDefinition_StructField > ValueToStructFields() const
Convert the constant value to structure fields.
RR_WEAK_PTR< ServiceEntryDefinition > service_entry
The parent service entry.
Definition: ServiceDefinition.h:1500
ConstantDefinition(const boost::shared_ptr< ServiceEntryDefinition > &service_entry)
Construct a new ConstantDefinition with a parent ServiceEntryDefinition.
std::string ValueToString()
Convert the constant value to string.
std::string Name
The name of the constant.
Definition: ServiceDefinition.h:1478
std::string Value
The value of the constant, as a string.
Definition: ServiceDefinition.h:1484
static bool VerifyTypeAndValue(TypeDefinition &t, boost::string_ref value)
Verify that the specified constant type and value are valid.
std::string DocString
Documentation string for the constant.
Definition: ServiceDefinition.h:1487
boost::shared_ptr< TypeDefinition > Type
The value type of the constant.
Definition: ServiceDefinition.h:1481
RR_WEAK_PTR< ServiceDefinition > service
The parent service definition.
Definition: ServiceDefinition.h:1494
ServiceDefinitionParseInfo ParseInfo
Parsing diagnostic information.
Definition: ServiceDefinition.h:1507
void Reset()
Clear all fields.
ConstantDefinition(const boost::shared_ptr< ServiceDefinition > &service)
Construct a new ConstantDefinition with a parent ServiceDefinition.
std::string ToString()
Convert constant definition to string.
Class for enum definitions.
Definition: ServiceDefinition.h:1655
bool VerifyValues() const
Verify that enum values are valid.
std::string ToString()
Convert enum definition to string.
std::string DocString
Documentation string for the enum.
Definition: ServiceDefinition.h:1673
ServiceDefinitionParseInfo ParseInfo
Parsing diagnostic information.
Definition: ServiceDefinition.h:1670
void Reset()
Clear all fields.
std::vector< EnumDefinitionValue > Values
The values in the enum.
Definition: ServiceDefinition.h:1660
RR_WEAK_PTR< ServiceDefinition > service
The parent service definition.
Definition: ServiceDefinition.h:1663
EnumDefinition(const boost::shared_ptr< ServiceDefinition > &service)
Construct a new empty EnumDefinition with a parent ServiceDefinition.
void FromString(boost::string_ref s, const ServiceDefinitionParseInfo *parse_info=NULL)
Parse an enum definition from string.
Class representing an enum definition value.
Definition: ServiceDefinition.h:1723
EnumDefinitionValue()
Construct a new EnumDefinitionValue.
int32_t Value
The numeric value of the enum value.
Definition: ServiceDefinition.h:1736
std::string DocString
Documentations tring for the enum value.
Definition: ServiceDefinition.h:1743
bool HexValue
Value is represented using a hex literal.
Definition: ServiceDefinition.h:1740
bool ImplicitValue
If true, the enum value is implicitly incremented by 1 from the previous value.
Definition: ServiceDefinition.h:1738
std::string Name
The name of the enum value.
Definition: ServiceDefinition.h:1734
Class for event member definitions.
Definition: ServiceDefinition.h:855
EventDefinition(const boost::shared_ptr< ServiceEntryDefinition > &ServiceEntry)
Construct a new empty EventDefinition object.
std::vector< boost::shared_ptr< TypeDefinition > > Parameters
The parameter types and names of the event.
Definition: ServiceDefinition.h:858
Class for exception definitions.
Definition: ServiceDefinition.h:1354
ServiceDefinitionParseInfo ParseInfo
Parsing diagnostic information.
Definition: ServiceDefinition.h:1371
std::string ToString()
Convert exception definition to string.
void FromString(boost::string_ref s, const ServiceDefinitionParseInfo *parse_info=NULL)
Parse an exception definition from string.
std::string Name
The name of the exception.
Definition: ServiceDefinition.h:1359
void Reset()
Clear all fields.
ExceptionDefinition(const boost::shared_ptr< ServiceDefinition > &service)
Construct a new empty ExceptionDefinition object.
RR_WEAK_PTR< ServiceDefinition > service
The parent service definition.
Definition: ServiceDefinition.h:1364
std::string DocString
Documentation string for the exception.
Definition: ServiceDefinition.h:1361
Class for function member definitions.
Definition: ServiceDefinition.h:800
std::vector< boost::shared_ptr< TypeDefinition > > Parameters
The parameter types and names of the function.
Definition: ServiceDefinition.h:805
FunctionDefinition(const boost::shared_ptr< ServiceEntryDefinition > &ServiceEntry)
Construct a new empty FunctionDefinition object.
boost::shared_ptr< TypeDefinition > ReturnType
The return type of the function. May be void.
Definition: ServiceDefinition.h:803
Exception thrown when an internal error has occurred.
Definition: Error.h:684
Base class for member definitions.
Definition: ServiceDefinition.h:654
virtual MemberDefinition_NoLock NoLock() const
Get member locking behavior.
std::vector< std::string > Modifiers
Modifiers for this member.
Definition: ServiceDefinition.h:673
RR_WEAK_PTR< ServiceEntryDefinition > ServiceEntry
The parent service entry definition.
Definition: ServiceDefinition.h:664
std::string DocString
Documentation string for the member.
Definition: ServiceDefinition.h:686
ServiceDefinitionParseInfo ParseInfo
Parsing diagnostic information.
Definition: ServiceDefinition.h:680
virtual std::string ToString()
Convert member to a string.
Definition: ServiceDefinition.h:712
std::string Name
The name of the member.
Definition: ServiceDefinition.h:657
virtual void Reset()
Clear all fields.
Class for memory member definitions.
Definition: ServiceDefinition.h:1122
boost::shared_ptr< TypeDefinition > Type
The value type of the memory.
Definition: ServiceDefinition.h:1125
MemoryDefinition(const boost::shared_ptr< ServiceEntryDefinition > &ServiceEntry)
Construct a new empty MemoryDefinition object.
Base class for user-defined named types.
Definition: ServiceDefinition.h:463
std::string Name
The unqualified name of the type.
Definition: ServiceDefinition.h:466
virtual DataTypes RRDataType() const =0
The type code of the type.
virtual std::string ResolveQualifiedName()=0
Resolves and returns the qualified name.
Class for objref member definitions.
Definition: ServiceDefinition.h:896
ObjRefDefinition(const boost::shared_ptr< ServiceEntryDefinition > &ServiceEntry)
Construct a new empty ObjRefDefinition object.
std::string ObjectType
The object type name.
Definition: ServiceDefinition.h:903
DataTypes_ArrayTypes ArrayType
The array type of the ObjRef member.
Definition: ServiceDefinition.h:913
DataTypes_ContainerTypes ContainerType
The container type of the ObjRef member.
Definition: ServiceDefinition.h:923
Class for pipe member definitions.
Definition: ServiceDefinition.h:961
boost::shared_ptr< TypeDefinition > Type
The pipe packet value type.
Definition: ServiceDefinition.h:964
PipeDefinition(const boost::shared_ptr< ServiceEntryDefinition > &ServiceEntry)
Construct a new empty PipeDefinition object.
Class for property and field member definitions.
Definition: ServiceDefinition.h:728
boost::shared_ptr< TypeDefinition > Type
The value type of the property or field.
Definition: ServiceDefinition.h:731
PropertyDefinition(const boost::shared_ptr< ServiceEntryDefinition > &ServiceEntry)
Construct a new empty PropertyDefinition object.
Robot Raconteur Version storage class.
Definition: ServiceDefinition.h:94
RobotRaconteurVersion()
Construct a new default RobotRaconteurVersion instance.
uint32_t major
The major version.
Definition: ServiceDefinition.h:171
uint32_t tweak
The tweak version.
Definition: ServiceDefinition.h:177
uint32_t patch
The patch version.
Definition: ServiceDefinition.h:175
std::string ToString() const
Get the version as a string.
ServiceDefinitionParseInfo ParseInfo
Parsing diagnostic information.
Definition: ServiceDefinition.h:180
void FromString(boost::string_ref v, const ServiceDefinitionParseInfo *parse_info=NULL)
Parse a version string and update version fields.
uint32_t minor
The minor version.
Definition: ServiceDefinition.h:173
RobotRaconteurVersion(uint32_t major, uint32_t minor, uint32_t patch=0, uint32_t tweak=0)
Construct a new RobotRaconteurVersion instance with a given version.
RobotRaconteurVersion(boost::string_ref v)
Construct a new RobotRaconteurVersion instance with a version parsed from as string.
Exception thrown when a service definition cannot be parsed or fails verification.
Definition: Error.h:849
Class representing a service definition.
Definition: ServiceDefinition.h:303
virtual void ToStream(std::ostream &os) const
Convert service definition to a text stream.
std::vector< boost::shared_ptr< UsingDefinition > > Using
The using types declared in this service definition.
Definition: ServiceDefinition.h:324
std::vector< boost::shared_ptr< ServiceEntryDefinition > > Pods
The pods declared in the service definition.
Definition: ServiceDefinition.h:311
std::string DocString
Top level documentation string for the service.
Definition: ServiceDefinition.h:349
void Reset()
Clear all fields.
std::vector< std::string > Imports
The names of service definitions imported by this service definition.
Definition: ServiceDefinition.h:321
void CheckVersion(const RobotRaconteurVersion &ver=RobotRaconteurVersion(0, 0)) const
Check that the service definition does not require a newer version of Robot Raconteur.
void FromStream(std::istream &is, std::vector< ServiceDefinitionParseException > &warnings, const ServiceDefinitionParseInfo *parse_info=NULL)
Parse a service definition from a stream with warnings.
void FromStream(std::istream &is, const ServiceDefinitionParseInfo *parse_info=NULL)
Parse a service definition from a stream.
std::vector< std::string > Options
The options declared in the service definition (deprecated)
Definition: ServiceDefinition.h:318
virtual std::string ToString()
Convert service definition to a string.
std::vector< boost::shared_ptr< ServiceEntryDefinition > > Structures
The structures declared in the service definition.
Definition: ServiceDefinition.h:309
std::vector< boost::shared_ptr< ConstantDefinition > > Constants
The top level constants declared in the service definition.
Definition: ServiceDefinition.h:330
std::vector< boost::shared_ptr< ServiceEntryDefinition > > Objects
The objects declared in the service definition.
Definition: ServiceDefinition.h:315
std::vector< boost::shared_ptr< ExceptionDefinition > > Exceptions
The exceptions declared in this service definition.
Definition: ServiceDefinition.h:327
std::vector< boost::shared_ptr< ServiceEntryDefinition > > NamedArrays
The named arrays declared in the service definition.
Definition: ServiceDefinition.h:313
std::vector< boost::shared_ptr< EnumDefinition > > Enums
The enums declared in this service definition.
Definition: ServiceDefinition.h:333
ServiceDefinition()
Construct a new empty ServiceDefinition.
RobotRaconteurVersion StdVer
The service definition standard version required by this service definition.
Definition: ServiceDefinition.h:336
std::string Name
The name of the service definition.
Definition: ServiceDefinition.h:306
ServiceDefinitionParseInfo ParseInfo
Parsing diagnostic information.
Definition: ServiceDefinition.h:343
void FromString(boost::string_ref s, std::vector< ServiceDefinitionParseException > &warnings, const ServiceDefinitionParseInfo *parse_info=NULL)
Parses a service definition from a string with warnings.
void FromString(boost::string_ref s, const ServiceDefinitionParseInfo *parse_info=NULL)
Parses a service definition from a string.
Exception thrown when a parsing error occurs.
Definition: ServiceDefinition.h:191
ServiceDefinitionParseException(const std::string &e, const ServiceDefinitionParseInfo &info)
Construct a new ServiceDefinitionParseException.
ServiceDefinitionParseInfo ParseInfo
Parsing diagnostic information.
Definition: ServiceDefinition.h:195
ServiceDefinitionParseException(const std::string &e)
Construct a new ServiceDefinitionParseException.
virtual std::string ToString() const
Convert exception to string.
std::string ShortMessage
Short description of the error.
Definition: ServiceDefinition.h:203
Exception thrown when a service definition verification failure occurs.
Definition: ServiceDefinition.h:245
ServiceDefinitionParseInfo ParseInfo
Parsing diagnostic information.
Definition: ServiceDefinition.h:249
ServiceDefinitionVerifyException(const std::string &e)
Construct a new ServiceDefinitionVerifyException.
virtual std::string ToString() const
Convert exception to string.
ServiceDefinitionVerifyException(const std::string &e, const ServiceDefinitionParseInfo &info)
Construct a new ServiceDefinitionVerifyException.
std::string ShortMessage
Short description of the error.
Definition: ServiceDefinition.h:257
Class representing a service entry definition.
Definition: ServiceDefinition.h:500
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.
std::vector< std::string > Implements
Object types implemented by this object.
Definition: ServiceDefinition.h:527
std::vector< boost::shared_ptr< ConstantDefinition > > Constants
The constants declared in the service entry definition.
Definition: ServiceDefinition.h:533
ServiceDefinitionParseInfo ParseInfo
Parsing diagnostic information.
Definition: ServiceDefinition.h:540
RR_WEAK_PTR< ServiceDefinition > ServiceDefinition_
The parent service definition.
Definition: ServiceDefinition.h:634
void Reset()
Clear all fields.
std::string DocString
Documentation string for the service entry.
Definition: ServiceDefinition.h:546
void FromString(boost::string_ref s, const ServiceDefinitionParseInfo *parse_info=NULL)
Parse a service entry definition from a string.
void FromStream(std::istream &is, const ServiceDefinitionParseInfo *parse_info=NULL)
Parse a service entry definition from a stream.
std::vector< std::string > Options
The options declared in the service entry definition (deprecated)
Definition: ServiceDefinition.h:530
void FromStream(std::istream &is, std::vector< ServiceDefinitionParseException > &warnings, const ServiceDefinitionParseInfo *parse_info=NULL)
Parse a service entry definition from a stream with warnings.
ServiceEntryDefinition(const boost::shared_ptr< ServiceDefinition > &def)
Construct a new empty ServiceEntryDefinition.
std::vector< boost::shared_ptr< MemberDefinition > > Members
The members of the entry definition.
Definition: ServiceDefinition.h:511
DataTypes EntryType
The type code of the entry type.
Definition: ServiceDefinition.h:520
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.
Class for type definitions.
Definition: ServiceDefinition.h:1170
void FromString(boost::string_ref s, const ServiceDefinitionParseInfo *parse_info=NULL)
Parse a type definition from string.
void RemoveArray()
Removes arrays from the type.
ServiceDefinitionParseInfo ParseInfo
Parsing diagnostic information.
Definition: ServiceDefinition.h:1200
std::vector< int32_t > ArrayLength
The array length.
Definition: ServiceDefinition.h:1191
bool ArrayVarLength
If true, array is variable length. If false, fixed length.
Definition: ServiceDefinition.h:1189
virtual std::string ToString()
Convert property definition to string.
static DataTypes DataTypeFromString(boost::string_ref d)
Get the DataTypes type code from a string.
void QualifyTypeStringWithUsing()
Searches the service definition for a matching using declaration, and replaces type with qualified na...
void CopyTo(TypeDefinition &def) const
Copy type definition to def.
TypeDefinition(const boost::shared_ptr< MemberDefinition > &member)
Construct a new empty TypeDefinition.
DataTypes Type
The type code of the type definition.
Definition: ServiceDefinition.h:1182
DataTypes_ArrayTypes ArrayType
The array type of the type definition.
Definition: ServiceDefinition.h:1187
void Reset()
Clear all fields.
boost::shared_ptr< TypeDefinition > Clone() const
Clones the type definition.
boost::shared_ptr< NamedTypeDefinition > ResolveNamedType(const std::vector< boost::shared_ptr< ServiceDefinition > > &other_defs=std::vector< boost::shared_ptr< ServiceDefinition > >(), const boost::shared_ptr< RobotRaconteurNode > &node=boost::shared_ptr< RobotRaconteurNode >(), const boost::shared_ptr< RRObject > &client=boost::shared_ptr< RRObject >())
Resolve the named type to a NamedTypeDefinition.
DataTypes_ContainerTypes ContainerType
The container type of the type definition.
Definition: ServiceDefinition.h:1194
static std::string StringFromDataType(DataTypes d)
Convert a DataTypes type code to a string.
TypeDefinition()
Construct a new empty TypeDefinition.
void Rename(boost::string_ref name)
Rename the type definition.
void RemoveContainers()
Removes containers from the type.
std::string Name
The name of the type definition.
Definition: ServiceDefinition.h:1179
std::string TypeString
The type name used if Type is DataTypes_namedtype_t.
Definition: ServiceDefinition.h:1184
RR_WEAK_PTR< MemberDefinition > member
The parent member of the type definition.
Definition: ServiceDefinition.h:1197
void UnqualifyTypeStringWithUsing()
Searches the service definition for a matching using declaration, and replaces type with unqualified ...
Class for using definitions.
Definition: ServiceDefinition.h:1410
RR_WEAK_PTR< ServiceDefinition > service
The parent service definition.
Definition: ServiceDefinition.h:1420
ServiceDefinitionParseInfo ParseInfo
Parsing diagnostic information.
Definition: ServiceDefinition.h:1427
std::string ToString()
Convert using definition to string.
std::string UnqualifiedName
The unqualified name of the imported type.
Definition: ServiceDefinition.h:1417
UsingDefinition(const boost::shared_ptr< ServiceDefinition > &service)
Construct a new empty UsingDefinition object.
std::string QualifiedName
The qualified name of the imported type.
Definition: ServiceDefinition.h:1415
void FromString(boost::string_ref s, const ServiceDefinitionParseInfo *parse_info=NULL)
Parse an using definition from string.
Class for wire member definitions.
Definition: ServiceDefinition.h:1070
WireDefinition(const boost::shared_ptr< ServiceEntryDefinition > &ServiceEntry)
Construct a new empty WireDefinition object.
boost::shared_ptr< TypeDefinition > Type
The wire value type.
Definition: ServiceDefinition.h:1073
Class for constant structure field definitions.
Definition: ServiceDefinition.h:1460
std::string ConstantRefName
The name of the constant the field refers to.
Definition: ServiceDefinition.h:1464
std::string Name
The name of the constant structure field.
Definition: ServiceDefinition.h:1462
Service definition parse information.
Definition: ServiceDefinition.h:67
std::string ServiceName
The name of the service containing the declaration.
Definition: ServiceDefinition.h:69
std::string Line
The text of the declaration.
Definition: ServiceDefinition.h:73
void Reset()
Reset all fields.
int32_t LineNumber
The line number of the declaration in the file.
Definition: ServiceDefinition.h:75
std::string RobDefFilePath
The file path of the service definition file containing the declaration.
Definition: ServiceDefinition.h:71
ServiceDefinitionParseInfo()
Construct a new ServiceDefinitionParseInfo structure.