44 if (!writer.
writeString(
"getRemoteProtocolVersion")) {
58 if (!helper_proto.read(connection)) {
68 if(!
yarp().canWrite()) {
69 yError(
" Missing server method ISpeechSynthesizerMsgs::getRemoteProtocolVersion");
74 return helper.helper_proto;}
85 if (remproto.protocol_version != locproto.protocol_version)
87 yCError(SERVICE_LOG_COMPONENT) <<
"Invalid communication protocol.";
88 yCError(SERVICE_LOG_COMPONENT) <<
"Local Protocol Version: " << locproto.toString();
89 yCError(SERVICE_LOG_COMPONENT) <<
"Remote Protocol Version: " << remproto.toString();
164 static constexpr const char*
s_tag{
"set_language"};
168 static constexpr const char*
s_prototype{
"return_set_language ISpeechSynthesizerMsgs::set_language(const std::string& language)"};
222 static constexpr const char*
s_tag{
"get_language"};
226 static constexpr const char*
s_prototype{
"return_get_language ISpeechSynthesizerMsgs::get_language()"};
285 static constexpr const char*
s_tag{
"set_voice"};
289 static constexpr const char*
s_prototype{
"return_set_voice ISpeechSynthesizerMsgs::set_voice(const std::string& voice)"};
343 static constexpr const char*
s_tag{
"get_voice"};
347 static constexpr const char*
s_prototype{
"return_get_voice ISpeechSynthesizerMsgs::get_voice()"};
401 static constexpr const char*
s_tag{
"get_available_voices"};
405 static constexpr const char*
s_prototype{
"return_get_available_voices ISpeechSynthesizerMsgs::get_available_voices()"};
464 static constexpr const char*
s_tag{
"set_speed"};
468 static constexpr const char*
s_prototype{
"return_set_speed ISpeechSynthesizerMsgs::set_speed(const double speed)"};
522 static constexpr const char*
s_tag{
"get_speed"};
526 static constexpr const char*
s_prototype{
"return_get_speed ISpeechSynthesizerMsgs::get_speed()"};
585 static constexpr const char*
s_tag{
"set_pitch"};
589 static constexpr const char*
s_prototype{
"return_set_pitch ISpeechSynthesizerMsgs::set_pitch(const double pitch)"};
643 static constexpr const char*
s_tag{
"get_pitch"};
647 static constexpr const char*
s_prototype{
"return_get_pitch ISpeechSynthesizerMsgs::get_pitch()"};
706 static constexpr const char*
s_tag{
"synthesize"};
710 static constexpr const char*
s_prototype{
"return_synthesize ISpeechSynthesizerMsgs::synthesize(const std::string& text)"};
741 return write(writer);
756 if (!writeTag(writer)) {
759 if (!writeArgs(writer)) {
783 if (!readTag(reader)) {
786 if (!readArgs(reader)) {
825 return write(writer);
840 if (!writer.
write(return_helper)) {
856 if (!reader.
read(return_helper)) {
885 return write(writer);
900 if (!writeTag(writer)) {
903 if (!writeArgs(writer)) {
924 if (!readTag(reader)) {
927 if (!readArgs(reader)) {
958 return write(writer);
973 if (!writer.
write(return_helper)) {
989 if (!reader.
read(return_helper)) {
1028 return write(writer);
1038 return read(reader);
1043 if (!writeTag(writer)) {
1046 if (!writeArgs(writer)) {
1070 if (!readTag(reader)) {
1073 if (!readArgs(reader)) {
1112 return write(writer);
1118 return read(reader);
1127 if (!writer.
write(return_helper)) {
1143 if (!reader.
read(return_helper)) {
1172 return write(writer);
1182 return read(reader);
1187 if (!writeTag(writer)) {
1190 if (!writeArgs(writer)) {
1211 if (!readTag(reader)) {
1214 if (!readArgs(reader)) {
1245 return write(writer);
1251 return read(reader);
1260 if (!writer.
write(return_helper)) {
1276 if (!reader.
read(return_helper)) {
1305 return write(writer);
1315 return read(reader);
1320 if (!writeTag(writer)) {
1323 if (!writeArgs(writer)) {
1344 if (!readTag(reader)) {
1347 if (!readArgs(reader)) {
1378 return write(writer);
1384 return read(reader);
1393 if (!writer.
write(return_helper)) {
1409 if (!reader.
read(return_helper)) {
1448 return write(writer);
1458 return read(reader);
1463 if (!writeTag(writer)) {
1466 if (!writeArgs(writer)) {
1490 if (!readTag(reader)) {
1493 if (!readArgs(reader)) {
1532 return write(writer);
1538 return read(reader);
1547 if (!writer.
write(return_helper)) {
1563 if (!reader.
read(return_helper)) {
1592 return write(writer);
1602 return read(reader);
1607 if (!writeTag(writer)) {
1610 if (!writeArgs(writer)) {
1631 if (!readTag(reader)) {
1634 if (!readArgs(reader)) {
1665 return write(writer);
1671 return read(reader);
1680 if (!writer.
write(return_helper)) {
1696 if (!reader.
read(return_helper)) {
1735 return write(writer);
1745 return read(reader);
1750 if (!writeTag(writer)) {
1753 if (!writeArgs(writer)) {
1777 if (!readTag(reader)) {
1780 if (!readArgs(reader)) {
1819 return write(writer);
1825 return read(reader);
1834 if (!writer.
write(return_helper)) {
1850 if (!reader.
read(return_helper)) {
1879 return write(writer);
1889 return read(reader);
1894 if (!writeTag(writer)) {
1897 if (!writeArgs(writer)) {
1918 if (!readTag(reader)) {
1921 if (!readArgs(reader)) {
1952 return write(writer);
1958 return read(reader);
1967 if (!writer.
write(return_helper)) {
1983 if (!reader.
read(return_helper)) {
2022 return write(writer);
2032 return read(reader);
2037 if (!writeTag(writer)) {
2040 if (!writeArgs(writer)) {
2064 if (!readTag(reader)) {
2067 if (!readArgs(reader)) {
2106 return write(writer);
2112 return read(reader);
2121 if (!writer.
write(return_helper)) {
2137 if (!reader.
read(return_helper)) {
2152 yarp().setOwner(*
this);
2157 if (!
yarp().canWrite()) {
2161 bool ok =
yarp().write(helper, helper);
2165 return failed_reply;
2167 return helper.reply.return_helper;
2172 if (!
yarp().canWrite()) {
2176 bool ok =
yarp().write(helper, helper);
2180 return failed_reply;
2182 return helper.reply.return_helper;
2187 if (!
yarp().canWrite()) {
2191 bool ok =
yarp().write(helper, helper);
2195 return failed_reply;
2197 return helper.reply.return_helper;
2202 if (!
yarp().canWrite()) {
2206 bool ok =
yarp().write(helper, helper);
2210 return failed_reply;
2212 return helper.reply.return_helper;
2217 if (!
yarp().canWrite()) {
2221 bool ok =
yarp().write(helper, helper);
2225 return failed_reply;
2227 return helper.reply.return_helper;
2232 if (!
yarp().canWrite()) {
2236 bool ok =
yarp().write(helper, helper);
2240 return failed_reply;
2242 return helper.reply.return_helper;
2247 if (!
yarp().canWrite()) {
2251 bool ok =
yarp().write(helper, helper);
2255 return failed_reply;
2257 return helper.reply.return_helper;
2262 if (!
yarp().canWrite()) {
2266 bool ok =
yarp().write(helper, helper);
2270 return failed_reply;
2272 return helper.reply.return_helper;
2277 if (!
yarp().canWrite()) {
2281 bool ok =
yarp().write(helper, helper);
2285 return failed_reply;
2287 return helper.reply.return_helper;
2292 if (!
yarp().canWrite()) {
2296 bool ok =
yarp().write(helper, helper);
2300 return failed_reply;
2302 return helper.reply.return_helper;
2308 bool showAll = (functionName ==
"--all");
2309 std::vector<std::string> helpString;
2311 helpString.emplace_back(
"*** Available commands:");
2322 helpString.emplace_back(
"help");
2354 if (functionName ==
"help") {
2355 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
2356 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
2357 helpString.emplace_back(
"@param functionName name of command for which to get a detailed description. If none or '--all' is provided, print list of available commands");
2358 helpString.emplace_back(
"@return list of strings (one string per line)");
2361 if (helpString.empty()) {
2362 helpString.emplace_back(
"Command not found");
2370 constexpr size_t max_tag_len = 3;
2380 std::string tag = reader.
readTag(1);
2381 bool direct = (tag ==
"__direct__");
2385 while (tag_len <= max_tag_len && !reader.
isError()) {
2386 if(tag ==
"getRemoteProtocolVersion") {
2393 auto proto = getLocalProtocolVersion();
2399 if (!writer.
write(proto)) {
2556 if (tag ==
"help") {
2557 std::string functionName;
2559 functionName =
"--all";
2561 auto help_strings = help(functionName);
2567 if (!writer.
writeTag(
"many", 1, 0)) {
2573 for (
const auto& help_string : help_strings) {
2589 std::string next_tag = reader.
readTag(1);
2590 if (next_tag.empty()) {
2593 tag.append(
"_").append(next_tag);
2594 tag_len = std::count(tag.begin(), tag.end(),
'_') + 1;
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
ISpeechSynthesizerMsgs_getRemoteProtocolVersion_helper()=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
yarp::os::ApplicationNetworkProtocolVersion helper_proto
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readTag(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
~Command() override=default
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
~Reply() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
return_get_available_voices return_helper
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
return_get_available_voices(*)() funcptr_t
static constexpr size_t s_cmd_len
static constexpr size_t s_reply_len
static constexpr const char * s_prototype
static constexpr const char * s_help
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
ISpeechSynthesizerMsgs_get_available_voices_helper()=default
static constexpr size_t s_tag_len
void call(ISpeechSynthesizerMsgs *ptr)
static constexpr const char * s_tag
bool readArgs(yarp::os::idl::WireReader &reader)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readTag(yarp::os::idl::WireReader &reader)
~Command() override=default
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
return_get_language return_helper
~Reply() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
ISpeechSynthesizerMsgs_get_language_helper()=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr const char * s_prototype
static constexpr size_t s_cmd_len
static constexpr size_t s_tag_len
static constexpr const char * s_help
return_get_language(*)() funcptr_t
void call(ISpeechSynthesizerMsgs *ptr)
static constexpr const char * s_tag
static constexpr size_t s_reply_len
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readTag(yarp::os::idl::WireReader &reader)
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
~Command() override=default
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
return_get_pitch return_helper
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
~Reply() override=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
void call(ISpeechSynthesizerMsgs *ptr)
static constexpr size_t s_tag_len
static constexpr const char * s_tag
static constexpr size_t s_reply_len
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr const char * s_help
return_get_pitch(*)() funcptr_t
static constexpr size_t s_cmd_len
static constexpr const char * s_prototype
ISpeechSynthesizerMsgs_get_pitch_helper()=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readTag(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
~Command() override=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
return_get_speed return_helper
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Reply() override=default
static constexpr const char * s_prototype
ISpeechSynthesizerMsgs_get_speed_helper()=default
static constexpr size_t s_cmd_len
static constexpr size_t s_tag_len
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
void call(ISpeechSynthesizerMsgs *ptr)
static constexpr const char * s_tag
static constexpr const char * s_help
return_get_speed(*)() funcptr_t
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr size_t s_reply_len
~Command() override=default
bool readArgs(yarp::os::idl::WireReader &reader)
bool readTag(yarp::os::idl::WireReader &reader)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
~Reply() override=default
return_get_voice return_helper
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr size_t s_cmd_len
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
ISpeechSynthesizerMsgs_get_voice_helper()=default
static constexpr size_t s_tag_len
static constexpr const char * s_tag
return_get_voice(*)() funcptr_t
static constexpr const char * s_prototype
void call(ISpeechSynthesizerMsgs *ptr)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr const char * s_help
static constexpr size_t s_reply_len
~Command() override=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readTag(yarp::os::idl::WireReader &reader)
return_set_language return_helper
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Reply() override=default
static constexpr const char * s_help
static constexpr size_t s_tag_len
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr const char * s_tag
static constexpr size_t s_cmd_len
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
ISpeechSynthesizerMsgs_set_language_helper()=default
static constexpr const char * s_prototype
static constexpr size_t s_reply_len
void call(ISpeechSynthesizerMsgs *ptr)
return_set_language(*)(const std::string &) funcptr_t
~Command() override=default
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool readTag(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
return_set_pitch return_helper
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Reply() override=default
static constexpr const char * s_tag
static constexpr const char * s_prototype
static constexpr size_t s_reply_len
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
ISpeechSynthesizerMsgs_set_pitch_helper()=default
static constexpr size_t s_cmd_len
void call(ISpeechSynthesizerMsgs *ptr)
static constexpr size_t s_tag_len
return_set_pitch(*)(const double) funcptr_t
static constexpr const char * s_help
~Command() override=default
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool readTag(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
return_set_speed return_helper
~Reply() override=default
ISpeechSynthesizerMsgs_set_speed_helper()=default
static constexpr const char * s_help
static constexpr const char * s_prototype
static constexpr size_t s_cmd_len
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
return_set_speed(*)(const double) funcptr_t
static constexpr const char * s_tag
static constexpr size_t s_reply_len
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr size_t s_tag_len
void call(ISpeechSynthesizerMsgs *ptr)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool readTag(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
~Command() override=default
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
return_set_voice return_helper
~Reply() override=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
return_set_voice(*)(const std::string &) funcptr_t
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr const char * s_help
static constexpr const char * s_tag
static constexpr const char * s_prototype
ISpeechSynthesizerMsgs_set_voice_helper()=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr size_t s_reply_len
static constexpr size_t s_tag_len
void call(ISpeechSynthesizerMsgs *ptr)
static constexpr size_t s_cmd_len
~Command() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readTag(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
return_synthesize return_helper
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Reply() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr const char * s_help
static constexpr size_t s_reply_len
static constexpr const char * s_prototype
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr const char * s_tag
return_synthesize(*)(const std::string &) funcptr_t
static constexpr size_t s_cmd_len
void call(ISpeechSynthesizerMsgs *ptr)
ISpeechSynthesizerMsgs_synthesize_helper()=default
static constexpr size_t s_tag_len
virtual return_set_speed set_speed(const double speed)
virtual return_get_speed get_speed()
virtual return_set_pitch set_pitch(const double pitch)
virtual return_synthesize synthesize(const std::string &text)
virtual yarp::os::ApplicationNetworkProtocolVersion getLocalProtocolVersion()
virtual std::vector< std::string > help(const std::string &functionName="--all")
virtual return_get_pitch get_pitch()
virtual return_get_language get_language()
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual return_get_voice get_voice()
virtual return_set_language set_language(const std::string &language)
virtual return_set_voice set_voice(const std::string &voice)
virtual bool checkProtocolVersion()
virtual return_get_available_voices get_available_voices()
virtual yarp::os::ApplicationNetworkProtocolVersion getRemoteProtocolVersion()
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
@ return_value_error_nws_nwc_communication_error
Method is not (yet) implemented.
short int protocol_version
An interface for reading from a network connection.
An interface for writing to a network connection.
This is a base class for objects that can be both read from and be written to the YARP network.
bool write(PortWriter &writer)
Write a message to the associated port or reader.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
IDL-friendly connection reader.
bool readString(std::string &str, bool *is_vocab=nullptr)
std::string readTag(size_t len=static_cast< size_t >(-1))
bool read(WirePortable &obj)
bool readFloat64(yarp::conf::float64_t &x)
IDL-friendly connection writer.
bool write(const WirePortable &obj) const
bool writeListHeader(int len) const
bool writeTag(const char *tag, int split, int len) const
bool writeFloat64(yarp::conf::float64_t x, bool skip_tag=false) const
bool writeString(const std::string &str, bool skip_tag=false) const
bool writeListEnd() const
bool writeListBegin(int tag, size_t len) const
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
The main, catch-all namespace for YARP.
#define YARP_VERSION_PATCH
#define YARP_VERSION_MAJOR
#define YARP_VERSION_MINOR