44 if (!writer.
writeString(
"getRemoteProtocolVersion")) {
58 if (!helper_proto.read(connection)) {
68 if(!
yarp().canWrite()) {
69 yError(
" Missing server method ISpeechTranscriptionMsgs::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 ISpeechTranscriptionMsgs::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 ISpeechTranscriptionMsgs::get_language()"};
285 static constexpr const char*
s_tag{
"transcribe"};
289 static constexpr const char*
s_prototype{
"return_transcribe ISpeechTranscriptionMsgs::transcribe(const yarp::sig::Sound& sound)"};
320 return write(writer);
335 if (!writeTag(writer)) {
338 if (!writeArgs(writer)) {
362 if (!readTag(reader)) {
365 if (!readArgs(reader)) {
404 return write(writer);
419 if (!writer.
write(return_helper)) {
435 if (!reader.
read(return_helper)) {
464 return write(writer);
479 if (!writeTag(writer)) {
482 if (!writeArgs(writer)) {
503 if (!readTag(reader)) {
506 if (!readArgs(reader)) {
537 return write(writer);
552 if (!writer.
write(return_helper)) {
568 if (!reader.
read(return_helper)) {
607 return write(writer);
622 if (!writeTag(writer)) {
625 if (!writeArgs(writer)) {
649 if (!readTag(reader)) {
652 if (!readArgs(reader)) {
691 return write(writer);
706 if (!writer.
write(return_helper)) {
722 if (!reader.
read(return_helper)) {
737 yarp().setOwner(*
this);
742 if (!
yarp().canWrite()) {
746 bool ok =
yarp().write(helper, helper);
752 return helper.reply.return_helper;
757 if (!
yarp().canWrite()) {
761 bool ok =
yarp().write(helper, helper);
767 return helper.reply.return_helper;
772 if (!
yarp().canWrite()) {
776 bool ok =
yarp().write(helper, helper);
782 return helper.reply.return_helper;
788 bool showAll = (functionName ==
"--all");
789 std::vector<std::string> helpString;
791 helpString.emplace_back(
"*** Available commands:");
795 helpString.emplace_back(
"help");
806 if (functionName ==
"help") {
807 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
808 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
809 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");
810 helpString.emplace_back(
"@return list of strings (one string per line)");
813 if (helpString.empty()) {
814 helpString.emplace_back(
"Command not found");
822 constexpr size_t max_tag_len = 2;
832 std::string tag = reader.
readTag(1);
833 bool direct = (tag ==
"__direct__");
837 while (tag_len <= max_tag_len && !reader.
isError()) {
838 if(tag ==
"getRemoteProtocolVersion") {
845 auto proto = getLocalProtocolVersion();
851 if (!writer.
write(proto)) {
904 std::string functionName;
906 functionName =
"--all";
908 auto help_strings = help(functionName);
914 if (!writer.
writeTag(
"many", 1, 0)) {
920 for (
const auto& help_string : help_strings) {
936 std::string next_tag = reader.
readTag(1);
937 if (next_tag.empty()) {
940 tag.append(
"_").append(next_tag);
941 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")
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 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