43 if (!writer.
writeString(
"getRemoteProtocolVersion")) {
57 if (!helper_proto.read(connection)) {
67 if(!
yarp().canWrite()) {
68 yError(
" Missing server method ISpeechSynthesizerMsgs::getRemoteProtocolVersion");
73 return helper.helper_proto;}
84 if (remproto.protocol_version != locproto.protocol_version)
86 yCError(SERVICE_LOG_COMPONENT) <<
"Invalid communication protocol.";
87 yCError(SERVICE_LOG_COMPONENT) <<
"Local Protocol Version: " << locproto.toString();
88 yCError(SERVICE_LOG_COMPONENT) <<
"Remote Protocol Version: " << remproto.toString();
163 static constexpr const char*
s_tag{
"set_language"};
167 static constexpr const char*
s_prototype{
"return_set_language ISpeechSynthesizerMsgs::set_language(const std::string& language)"};
221 static constexpr const char*
s_tag{
"get_language"};
225 static constexpr const char*
s_prototype{
"return_get_language ISpeechSynthesizerMsgs::get_language()"};
284 static constexpr const char*
s_tag{
"set_voice"};
288 static constexpr const char*
s_prototype{
"return_set_voice ISpeechSynthesizerMsgs::set_voice(const std::string& language)"};
342 static constexpr const char*
s_tag{
"get_voice"};
346 static constexpr const char*
s_prototype{
"return_get_voice ISpeechSynthesizerMsgs::get_voice()"};
405 static constexpr const char*
s_tag{
"set_speed"};
409 static constexpr const char*
s_prototype{
"return_set_speed ISpeechSynthesizerMsgs::set_speed(const double speed)"};
463 static constexpr const char*
s_tag{
"get_speed"};
467 static constexpr const char*
s_prototype{
"return_get_speed ISpeechSynthesizerMsgs::get_speed()"};
526 static constexpr const char*
s_tag{
"set_pitch"};
530 static constexpr const char*
s_prototype{
"return_set_pitch ISpeechSynthesizerMsgs::set_pitch(const double pitch)"};
584 static constexpr const char*
s_tag{
"get_pitch"};
588 static constexpr const char*
s_prototype{
"return_get_pitch ISpeechSynthesizerMsgs::get_pitch()"};
647 static constexpr const char*
s_tag{
"synthesize"};
651 static constexpr const char*
s_prototype{
"return_synthesize ISpeechSynthesizerMsgs::synthesize(const std::string& text)"};
682 return write(writer);
697 if (!writeTag(writer)) {
700 if (!writeArgs(writer)) {
724 if (!readTag(reader)) {
727 if (!readArgs(reader)) {
766 return write(writer);
781 if (!writer.
write(return_helper)) {
797 if (!reader.
read(return_helper)) {
826 return write(writer);
841 if (!writeTag(writer)) {
844 if (!writeArgs(writer)) {
865 if (!readTag(reader)) {
868 if (!readArgs(reader)) {
899 return write(writer);
914 if (!writer.
write(return_helper)) {
930 if (!reader.
read(return_helper)) {
969 return write(writer);
984 if (!writeTag(writer)) {
987 if (!writeArgs(writer)) {
1011 if (!readTag(reader)) {
1014 if (!readArgs(reader)) {
1053 return write(writer);
1059 return read(reader);
1068 if (!writer.
write(return_helper)) {
1084 if (!reader.
read(return_helper)) {
1113 return write(writer);
1123 return read(reader);
1128 if (!writeTag(writer)) {
1131 if (!writeArgs(writer)) {
1152 if (!readTag(reader)) {
1155 if (!readArgs(reader)) {
1186 return write(writer);
1192 return read(reader);
1201 if (!writer.
write(return_helper)) {
1217 if (!reader.
read(return_helper)) {
1256 return write(writer);
1266 return read(reader);
1271 if (!writeTag(writer)) {
1274 if (!writeArgs(writer)) {
1298 if (!readTag(reader)) {
1301 if (!readArgs(reader)) {
1340 return write(writer);
1346 return read(reader);
1355 if (!writer.
write(return_helper)) {
1371 if (!reader.
read(return_helper)) {
1400 return write(writer);
1410 return read(reader);
1415 if (!writeTag(writer)) {
1418 if (!writeArgs(writer)) {
1439 if (!readTag(reader)) {
1442 if (!readArgs(reader)) {
1473 return write(writer);
1479 return read(reader);
1488 if (!writer.
write(return_helper)) {
1504 if (!reader.
read(return_helper)) {
1543 return write(writer);
1553 return read(reader);
1558 if (!writeTag(writer)) {
1561 if (!writeArgs(writer)) {
1585 if (!readTag(reader)) {
1588 if (!readArgs(reader)) {
1627 return write(writer);
1633 return read(reader);
1642 if (!writer.
write(return_helper)) {
1658 if (!reader.
read(return_helper)) {
1687 return write(writer);
1697 return read(reader);
1702 if (!writeTag(writer)) {
1705 if (!writeArgs(writer)) {
1726 if (!readTag(reader)) {
1729 if (!readArgs(reader)) {
1760 return write(writer);
1766 return read(reader);
1775 if (!writer.
write(return_helper)) {
1791 if (!reader.
read(return_helper)) {
1830 return write(writer);
1840 return read(reader);
1845 if (!writeTag(writer)) {
1848 if (!writeArgs(writer)) {
1872 if (!readTag(reader)) {
1875 if (!readArgs(reader)) {
1914 return write(writer);
1920 return read(reader);
1929 if (!writer.
write(return_helper)) {
1945 if (!reader.
read(return_helper)) {
1960 yarp().setOwner(*
this);
1965 if (!
yarp().canWrite()) {
1969 bool ok =
yarp().write(helper, helper);
1975 if (!
yarp().canWrite()) {
1979 bool ok =
yarp().write(helper, helper);
1985 if (!
yarp().canWrite()) {
1989 bool ok =
yarp().write(helper, helper);
1995 if (!
yarp().canWrite()) {
1999 bool ok =
yarp().write(helper, helper);
2005 if (!
yarp().canWrite()) {
2009 bool ok =
yarp().write(helper, helper);
2015 if (!
yarp().canWrite()) {
2019 bool ok =
yarp().write(helper, helper);
2025 if (!
yarp().canWrite()) {
2029 bool ok =
yarp().write(helper, helper);
2035 if (!
yarp().canWrite()) {
2039 bool ok =
yarp().write(helper, helper);
2045 if (!
yarp().canWrite()) {
2049 bool ok =
yarp().write(helper, helper);
2056 bool showAll = (functionName ==
"--all");
2057 std::vector<std::string> helpString;
2059 helpString.emplace_back(
"*** Available commands:");
2069 helpString.emplace_back(
"help");
2098 if (functionName ==
"help") {
2099 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
2100 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
2101 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");
2102 helpString.emplace_back(
"@return list of strings (one string per line)");
2105 if (helpString.empty()) {
2106 helpString.emplace_back(
"Command not found");
2114 constexpr size_t max_tag_len = 2;
2124 std::string tag = reader.
readTag(1);
2125 bool direct = (tag ==
"__direct__");
2129 while (tag_len <= max_tag_len && !reader.
isError()) {
2130 if(tag ==
"getRemoteProtocolVersion") {
2137 auto proto = getLocalProtocolVersion();
2143 if (!writer.
write(proto)) {
2285 if (tag ==
"help") {
2286 std::string functionName;
2288 functionName =
"--all";
2290 auto help_strings = help(functionName);
2296 if (!writer.
writeTag(
"many", 1, 0)) {
2302 for (
const auto& help_string : help_strings) {
2318 std::string next_tag = reader.
readTag(1);
2319 if (next_tag.empty()) {
2322 tag.append(
"_").append(next_tag);
2323 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 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_set_voice set_voice(const std::string &language)
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 bool checkProtocolVersion()
virtual yarp::os::ApplicationNetworkProtocolVersion getRemoteProtocolVersion()
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