43 if (!writer.
writeString(
"getRemoteProtocolVersion")) {
57 if (!helper_proto.read(connection)) {
67 if(!
yarp().canWrite()) {
68 yError(
" Missing server method ISpeechTranscriptionMsgs::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 ISpeechTranscriptionMsgs::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 ISpeechTranscriptionMsgs::get_language()"};
284 static constexpr const char*
s_tag{
"transcribe"};
288 static constexpr const char*
s_prototype{
"return_transcribe ISpeechTranscriptionMsgs::transcribe(const yarp::sig::Sound& sound)"};
319 return write(writer);
334 if (!writeTag(writer)) {
337 if (!writeArgs(writer)) {
361 if (!readTag(reader)) {
364 if (!readArgs(reader)) {
403 return write(writer);
418 if (!writer.
write(return_helper)) {
434 if (!reader.
read(return_helper)) {
463 return write(writer);
478 if (!writeTag(writer)) {
481 if (!writeArgs(writer)) {
502 if (!readTag(reader)) {
505 if (!readArgs(reader)) {
536 return write(writer);
551 if (!writer.
write(return_helper)) {
567 if (!reader.
read(return_helper)) {
606 return write(writer);
621 if (!writeTag(writer)) {
624 if (!writeArgs(writer)) {
648 if (!readTag(reader)) {
651 if (!readArgs(reader)) {
690 return write(writer);
705 if (!writer.
write(return_helper)) {
721 if (!reader.
read(return_helper)) {
736 yarp().setOwner(*
this);
741 if (!
yarp().canWrite()) {
745 bool ok =
yarp().write(helper, helper);
751 if (!
yarp().canWrite()) {
755 bool ok =
yarp().write(helper, helper);
761 if (!
yarp().canWrite()) {
765 bool ok =
yarp().write(helper, helper);
772 bool showAll = (functionName ==
"--all");
773 std::vector<std::string> helpString;
775 helpString.emplace_back(
"*** Available commands:");
779 helpString.emplace_back(
"help");
790 if (functionName ==
"help") {
791 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
792 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
793 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");
794 helpString.emplace_back(
"@return list of strings (one string per line)");
797 if (helpString.empty()) {
798 helpString.emplace_back(
"Command not found");
806 constexpr size_t max_tag_len = 2;
816 std::string tag = reader.
readTag(1);
817 bool direct = (tag ==
"__direct__");
821 while (tag_len <= max_tag_len && !reader.
isError()) {
822 if(tag ==
"getRemoteProtocolVersion") {
829 auto proto = getLocalProtocolVersion();
835 if (!writer.
write(proto)) {
888 std::string functionName;
890 functionName =
"--all";
892 auto help_strings = help(functionName);
898 if (!writer.
writeTag(
"many", 1, 0)) {
904 for (
const auto& help_string : help_strings) {
920 std::string next_tag = reader.
readTag(1);
921 if (next_tag.empty()) {
924 tag.append(
"_").append(next_tag);
925 tag_len = std::count(tag.begin(), tag.end(),
'_') + 1;
ISpeechTranscriptionMsgs_getRemoteProtocolVersion_helper()=default
yarp::os::ApplicationNetworkProtocolVersion helper_proto
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 readArgs(yarp::os::idl::WireReader &reader)
~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 write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
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.
~Reply() override=default
return_get_language return_helper
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr size_t s_reply_len
static constexpr const char * s_help
ISpeechTranscriptionMsgs_get_language_helper()=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
return_get_language(*)() funcptr_t
static constexpr const char * s_tag
static constexpr const char * s_prototype
static constexpr size_t s_cmd_len
static constexpr size_t s_tag_len
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
void call(ISpeechTranscriptionMsgs *ptr)
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.
bool readTag(yarp::os::idl::WireReader &reader)
~Command() override=default
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
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.
~Reply() override=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
return_set_language return_helper
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr size_t s_reply_len
static constexpr size_t s_cmd_len
static constexpr const char * s_prototype
static constexpr const char * s_tag
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr const char * s_help
static constexpr size_t s_tag_len
return_set_language(*)(const std::string &) funcptr_t
void call(ISpeechTranscriptionMsgs *ptr)
ISpeechTranscriptionMsgs_set_language_helper()=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 readTag(yarp::os::idl::WireReader &reader)
bool writeArgs(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
return_transcribe return_helper
~Reply() override=default
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 read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr size_t s_tag_len
void call(ISpeechTranscriptionMsgs *ptr)
static constexpr const char * s_tag
static constexpr const char * s_help
static constexpr size_t s_reply_len
static constexpr const char * s_prototype
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
return_transcribe(*)(const yarp::sig::Sound &) funcptr_t
static constexpr size_t s_cmd_len
ISpeechTranscriptionMsgs_transcribe_helper()=default
virtual yarp::os::ApplicationNetworkProtocolVersion getLocalProtocolVersion()
virtual return_transcribe transcribe(const yarp::sig::Sound &sound)
virtual yarp::os::ApplicationNetworkProtocolVersion getRemoteProtocolVersion()
virtual bool checkProtocolVersion()
virtual return_set_language set_language(const std::string &language)
ISpeechTranscriptionMsgs()
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual return_get_language get_language()
virtual std::vector< std::string > help(const std::string &functionName="--all")
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 readNested(WirePortable &obj)
bool readString(std::string &str, bool *is_vocab=nullptr)
std::string readTag(size_t len=static_cast< size_t >(-1))
bool read(WirePortable &obj)
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 writeString(const std::string &str, bool skip_tag=false) const
bool writeListEnd() const
bool writeNested(const WirePortable &obj) const
bool writeListBegin(int tag, size_t len) const
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
#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