72 static constexpr const char*
s_tag{
"set_language"};
76 static constexpr const char*
s_prototype{
"bool ISpeechTranscriptionMsgs::set_language(const std::string& language)"};
77 static constexpr const char*
s_help{
""};
130 static constexpr const char*
s_tag{
"get_language"};
134 static constexpr const char*
s_prototype{
"return_get_language ISpeechTranscriptionMsgs::get_language()"};
193 static constexpr const char*
s_tag{
"transcribe"};
197 static constexpr const char*
s_prototype{
"return_transcribe ISpeechTranscriptionMsgs::transcribe(const yarp::sig::Sound& sound)"};
228 return write(writer);
243 if (!writeTag(writer)) {
246 if (!writeArgs(writer)) {
270 if (!readTag(reader)) {
273 if (!readArgs(reader)) {
312 return write(writer);
343 if (!reader.
readBool(return_helper)) {
372 return write(writer);
387 if (!writeTag(writer)) {
390 if (!writeArgs(writer)) {
411 if (!readTag(reader)) {
414 if (!readArgs(reader)) {
445 return write(writer);
460 if (!writer.
write(return_helper)) {
476 if (!reader.
read(return_helper)) {
515 return write(writer);
530 if (!writeTag(writer)) {
533 if (!writeArgs(writer)) {
557 if (!readTag(reader)) {
560 if (!readArgs(reader)) {
599 return write(writer);
614 if (!writer.
write(return_helper)) {
630 if (!reader.
read(return_helper)) {
645 yarp().setOwner(*
this);
650 if (!
yarp().canWrite()) {
654 bool ok =
yarp().write(helper, helper);
655 return ok ? helper.reply.return_helper :
bool{};
660 if (!
yarp().canWrite()) {
664 bool ok =
yarp().write(helper, helper);
670 if (!
yarp().canWrite()) {
674 bool ok =
yarp().write(helper, helper);
681 bool showAll = (functionName ==
"--all");
682 std::vector<std::string> helpString;
684 helpString.emplace_back(
"*** Available commands:");
688 helpString.emplace_back(
"help");
699 if (functionName ==
"help") {
700 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
701 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
702 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");
703 helpString.emplace_back(
"@return list of strings (one string per line)");
706 if (helpString.empty()) {
707 helpString.emplace_back(
"Command not found");
715 constexpr size_t max_tag_len = 2;
725 std::string tag = reader.
readTag(1);
726 bool direct = (tag ==
"__direct__");
730 while (tag_len <= max_tag_len && !reader.
isError()) {
777 std::string functionName;
779 functionName =
"--all";
781 auto help_strings = help(functionName);
787 if (!writer.
writeTag(
"many", 1, 0)) {
793 for (
const auto& help_string : help_strings) {
809 std::string next_tag = reader.
readTag(1);
810 if (next_tag.empty()) {
813 tag.append(
"_").append(next_tag);
814 tag_len = std::count(tag.begin(), tag.end(),
'_') + 1;
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.
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
bool(*)(const std::string &) funcptr_t
static constexpr size_t s_tag_len
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 return_transcribe transcribe(const yarp::sig::Sound &sound)
virtual bool 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")
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.
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 writeBool(bool x, bool skip_tag=false) const
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.
The main, catch-all namespace for YARP.