/*
 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
 * SPDX-License-Identifier: BSD-3-Clause
 */

// Autogenerated by Thrift Compiler (0.14.1-yarped)
//
// This is an automatically generated file.
// It could get re-generated if the ALLOW_IDL_GENERATION flag is on.

#include <FakeBatteryService.h>

#include <yarp/os/idl/WireTypes.h>

// setBatteryVoltage helper class declaration
class FakeBatteryService_setBatteryVoltage_helper :
        public yarp::os::Portable
{
public:
    FakeBatteryService_setBatteryVoltage_helper() = default;
    explicit FakeBatteryService_setBatteryVoltage_helper(const double voltage);
    bool write(yarp::os::ConnectionWriter& connection) const override;
    bool read(yarp::os::ConnectionReader& connection) override;

    class Command :
            public yarp::os::idl::WirePortable
    {
    public:
        Command() = default;
        explicit Command(const double voltage);

        ~Command() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool writeTag(const yarp::os::idl::WireWriter& writer) const;
        bool writeArgs(const yarp::os::idl::WireWriter& writer) const;

        bool read(yarp::os::idl::WireReader& reader) override;
        bool readTag(yarp::os::idl::WireReader& reader);
        bool readArgs(yarp::os::idl::WireReader& reader);

        double voltage{0.0};
    };

    class Reply :
            public yarp::os::idl::WirePortable
    {
    public:
        Reply() = default;
        ~Reply() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool read(yarp::os::idl::WireReader& reader) override;
    };

    using funcptr_t = void (*)(const double);
    void call(FakeBatteryService* ptr) const;

    Command cmd;
    Reply reply;

    static constexpr const char* s_tag{"setBatteryVoltage"};
    static constexpr size_t s_tag_len{1};
    static constexpr size_t s_cmd_len{2};
    static constexpr size_t s_reply_len{0};
    static constexpr const char* s_prototype{"void FakeBatteryService::setBatteryVoltage(const double voltage)"};
    static constexpr const char* s_help{""};
};

// setBatteryCurrent helper class declaration
class FakeBatteryService_setBatteryCurrent_helper :
        public yarp::os::Portable
{
public:
    FakeBatteryService_setBatteryCurrent_helper() = default;
    explicit FakeBatteryService_setBatteryCurrent_helper(const double current);
    bool write(yarp::os::ConnectionWriter& connection) const override;
    bool read(yarp::os::ConnectionReader& connection) override;

    class Command :
            public yarp::os::idl::WirePortable
    {
    public:
        Command() = default;
        explicit Command(const double current);

        ~Command() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool writeTag(const yarp::os::idl::WireWriter& writer) const;
        bool writeArgs(const yarp::os::idl::WireWriter& writer) const;

        bool read(yarp::os::idl::WireReader& reader) override;
        bool readTag(yarp::os::idl::WireReader& reader);
        bool readArgs(yarp::os::idl::WireReader& reader);

        double current{0.0};
    };

    class Reply :
            public yarp::os::idl::WirePortable
    {
    public:
        Reply() = default;
        ~Reply() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool read(yarp::os::idl::WireReader& reader) override;
    };

    using funcptr_t = void (*)(const double);
    void call(FakeBatteryService* ptr) const;

    Command cmd;
    Reply reply;

    static constexpr const char* s_tag{"setBatteryCurrent"};
    static constexpr size_t s_tag_len{1};
    static constexpr size_t s_cmd_len{2};
    static constexpr size_t s_reply_len{0};
    static constexpr const char* s_prototype{"void FakeBatteryService::setBatteryCurrent(const double current)"};
    static constexpr const char* s_help{""};
};

// setBatteryCharge helper class declaration
class FakeBatteryService_setBatteryCharge_helper :
        public yarp::os::Portable
{
public:
    FakeBatteryService_setBatteryCharge_helper() = default;
    explicit FakeBatteryService_setBatteryCharge_helper(const double charge);
    bool write(yarp::os::ConnectionWriter& connection) const override;
    bool read(yarp::os::ConnectionReader& connection) override;

    class Command :
            public yarp::os::idl::WirePortable
    {
    public:
        Command() = default;
        explicit Command(const double charge);

        ~Command() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool writeTag(const yarp::os::idl::WireWriter& writer) const;
        bool writeArgs(const yarp::os::idl::WireWriter& writer) const;

        bool read(yarp::os::idl::WireReader& reader) override;
        bool readTag(yarp::os::idl::WireReader& reader);
        bool readArgs(yarp::os::idl::WireReader& reader);

        double charge{0.0};
    };

    class Reply :
            public yarp::os::idl::WirePortable
    {
    public:
        Reply() = default;
        ~Reply() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool read(yarp::os::idl::WireReader& reader) override;
    };

    using funcptr_t = void (*)(const double);
    void call(FakeBatteryService* ptr) const;

    Command cmd;
    Reply reply;

    static constexpr const char* s_tag{"setBatteryCharge"};
    static constexpr size_t s_tag_len{1};
    static constexpr size_t s_cmd_len{2};
    static constexpr size_t s_reply_len{0};
    static constexpr const char* s_prototype{"void FakeBatteryService::setBatteryCharge(const double charge)"};
    static constexpr const char* s_help{""};
};

// setBatteryInfo helper class declaration
class FakeBatteryService_setBatteryInfo_helper :
        public yarp::os::Portable
{
public:
    FakeBatteryService_setBatteryInfo_helper() = default;
    explicit FakeBatteryService_setBatteryInfo_helper(const std::string& info);
    bool write(yarp::os::ConnectionWriter& connection) const override;
    bool read(yarp::os::ConnectionReader& connection) override;

    class Command :
            public yarp::os::idl::WirePortable
    {
    public:
        Command() = default;
        explicit Command(const std::string& info);

        ~Command() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool writeTag(const yarp::os::idl::WireWriter& writer) const;
        bool writeArgs(const yarp::os::idl::WireWriter& writer) const;

        bool read(yarp::os::idl::WireReader& reader) override;
        bool readTag(yarp::os::idl::WireReader& reader);
        bool readArgs(yarp::os::idl::WireReader& reader);

        std::string info{};
    };

    class Reply :
            public yarp::os::idl::WirePortable
    {
    public:
        Reply() = default;
        ~Reply() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool read(yarp::os::idl::WireReader& reader) override;
    };

    using funcptr_t = void (*)(const std::string&);
    void call(FakeBatteryService* ptr) const;

    Command cmd;
    Reply reply;

    static constexpr const char* s_tag{"setBatteryInfo"};
    static constexpr size_t s_tag_len{1};
    static constexpr size_t s_cmd_len{2};
    static constexpr size_t s_reply_len{0};
    static constexpr const char* s_prototype{"void FakeBatteryService::setBatteryInfo(const std::string& info)"};
    static constexpr const char* s_help{""};
};

// setBatteryTemperature helper class declaration
class FakeBatteryService_setBatteryTemperature_helper :
        public yarp::os::Portable
{
public:
    FakeBatteryService_setBatteryTemperature_helper() = default;
    explicit FakeBatteryService_setBatteryTemperature_helper(const double temperature);
    bool write(yarp::os::ConnectionWriter& connection) const override;
    bool read(yarp::os::ConnectionReader& connection) override;

    class Command :
            public yarp::os::idl::WirePortable
    {
    public:
        Command() = default;
        explicit Command(const double temperature);

        ~Command() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool writeTag(const yarp::os::idl::WireWriter& writer) const;
        bool writeArgs(const yarp::os::idl::WireWriter& writer) const;

        bool read(yarp::os::idl::WireReader& reader) override;
        bool readTag(yarp::os::idl::WireReader& reader);
        bool readArgs(yarp::os::idl::WireReader& reader);

        double temperature{0.0};
    };

    class Reply :
            public yarp::os::idl::WirePortable
    {
    public:
        Reply() = default;
        ~Reply() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool read(yarp::os::idl::WireReader& reader) override;
    };

    using funcptr_t = void (*)(const double);
    void call(FakeBatteryService* ptr) const;

    Command cmd;
    Reply reply;

    static constexpr const char* s_tag{"setBatteryTemperature"};
    static constexpr size_t s_tag_len{1};
    static constexpr size_t s_cmd_len{2};
    static constexpr size_t s_reply_len{0};
    static constexpr const char* s_prototype{"void FakeBatteryService::setBatteryTemperature(const double temperature)"};
    static constexpr const char* s_help{""};
};

// getBatteryVoltage helper class declaration
class FakeBatteryService_getBatteryVoltage_helper :
        public yarp::os::Portable
{
public:
    FakeBatteryService_getBatteryVoltage_helper() = default;
    bool write(yarp::os::ConnectionWriter& connection) const override;
    bool read(yarp::os::ConnectionReader& connection) override;

    class Command :
            public yarp::os::idl::WirePortable
    {
    public:
        Command() = default;
        ~Command() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool writeTag(const yarp::os::idl::WireWriter& writer) const;
        bool writeArgs(const yarp::os::idl::WireWriter& writer) const;

        bool read(yarp::os::idl::WireReader& reader) override;
        bool readTag(yarp::os::idl::WireReader& reader);
        bool readArgs(yarp::os::idl::WireReader& reader);
    };

    class Reply :
            public yarp::os::idl::WirePortable
    {
    public:
        Reply() = default;
        ~Reply() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool read(yarp::os::idl::WireReader& reader) override;

        double return_helper{0.0};
    };

    using funcptr_t = double (*)();
    void call(FakeBatteryService* ptr);

    Command cmd;
    Reply reply;

    static constexpr const char* s_tag{"getBatteryVoltage"};
    static constexpr size_t s_tag_len{1};
    static constexpr size_t s_cmd_len{1};
    static constexpr size_t s_reply_len{1};
    static constexpr const char* s_prototype{"double FakeBatteryService::getBatteryVoltage()"};
    static constexpr const char* s_help{""};
};

// getBatteryCurrent helper class declaration
class FakeBatteryService_getBatteryCurrent_helper :
        public yarp::os::Portable
{
public:
    FakeBatteryService_getBatteryCurrent_helper() = default;
    bool write(yarp::os::ConnectionWriter& connection) const override;
    bool read(yarp::os::ConnectionReader& connection) override;

    class Command :
            public yarp::os::idl::WirePortable
    {
    public:
        Command() = default;
        ~Command() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool writeTag(const yarp::os::idl::WireWriter& writer) const;
        bool writeArgs(const yarp::os::idl::WireWriter& writer) const;

        bool read(yarp::os::idl::WireReader& reader) override;
        bool readTag(yarp::os::idl::WireReader& reader);
        bool readArgs(yarp::os::idl::WireReader& reader);
    };

    class Reply :
            public yarp::os::idl::WirePortable
    {
    public:
        Reply() = default;
        ~Reply() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool read(yarp::os::idl::WireReader& reader) override;

        double return_helper{0.0};
    };

    using funcptr_t = double (*)();
    void call(FakeBatteryService* ptr);

    Command cmd;
    Reply reply;

    static constexpr const char* s_tag{"getBatteryCurrent"};
    static constexpr size_t s_tag_len{1};
    static constexpr size_t s_cmd_len{1};
    static constexpr size_t s_reply_len{1};
    static constexpr const char* s_prototype{"double FakeBatteryService::getBatteryCurrent()"};
    static constexpr const char* s_help{""};
};

// getBatteryCharge helper class declaration
class FakeBatteryService_getBatteryCharge_helper :
        public yarp::os::Portable
{
public:
    FakeBatteryService_getBatteryCharge_helper() = default;
    bool write(yarp::os::ConnectionWriter& connection) const override;
    bool read(yarp::os::ConnectionReader& connection) override;

    class Command :
            public yarp::os::idl::WirePortable
    {
    public:
        Command() = default;
        ~Command() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool writeTag(const yarp::os::idl::WireWriter& writer) const;
        bool writeArgs(const yarp::os::idl::WireWriter& writer) const;

        bool read(yarp::os::idl::WireReader& reader) override;
        bool readTag(yarp::os::idl::WireReader& reader);
        bool readArgs(yarp::os::idl::WireReader& reader);
    };

    class Reply :
            public yarp::os::idl::WirePortable
    {
    public:
        Reply() = default;
        ~Reply() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool read(yarp::os::idl::WireReader& reader) override;

        double return_helper{0.0};
    };

    using funcptr_t = double (*)();
    void call(FakeBatteryService* ptr);

    Command cmd;
    Reply reply;

    static constexpr const char* s_tag{"getBatteryCharge"};
    static constexpr size_t s_tag_len{1};
    static constexpr size_t s_cmd_len{1};
    static constexpr size_t s_reply_len{1};
    static constexpr const char* s_prototype{"double FakeBatteryService::getBatteryCharge()"};
    static constexpr const char* s_help{""};
};

// getBatteryStatus helper class declaration
class FakeBatteryService_getBatteryStatus_helper :
        public yarp::os::Portable
{
public:
    FakeBatteryService_getBatteryStatus_helper() = default;
    bool write(yarp::os::ConnectionWriter& connection) const override;
    bool read(yarp::os::ConnectionReader& connection) override;

    class Command :
            public yarp::os::idl::WirePortable
    {
    public:
        Command() = default;
        ~Command() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool writeTag(const yarp::os::idl::WireWriter& writer) const;
        bool writeArgs(const yarp::os::idl::WireWriter& writer) const;

        bool read(yarp::os::idl::WireReader& reader) override;
        bool readTag(yarp::os::idl::WireReader& reader);
        bool readArgs(yarp::os::idl::WireReader& reader);
    };

    class Reply :
            public yarp::os::idl::WirePortable
    {
    public:
        Reply() = default;
        ~Reply() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool read(yarp::os::idl::WireReader& reader) override;

        std::string return_helper{};
    };

    using funcptr_t = std::string (*)();
    void call(FakeBatteryService* ptr);

    Command cmd;
    Reply reply;

    static constexpr const char* s_tag{"getBatteryStatus"};
    static constexpr size_t s_tag_len{1};
    static constexpr size_t s_cmd_len{1};
    static constexpr size_t s_reply_len{1};
    static constexpr const char* s_prototype{"std::string FakeBatteryService::getBatteryStatus()"};
    static constexpr const char* s_help{""};
};

// getBatteryInfo helper class declaration
class FakeBatteryService_getBatteryInfo_helper :
        public yarp::os::Portable
{
public:
    FakeBatteryService_getBatteryInfo_helper() = default;
    bool write(yarp::os::ConnectionWriter& connection) const override;
    bool read(yarp::os::ConnectionReader& connection) override;

    class Command :
            public yarp::os::idl::WirePortable
    {
    public:
        Command() = default;
        ~Command() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool writeTag(const yarp::os::idl::WireWriter& writer) const;
        bool writeArgs(const yarp::os::idl::WireWriter& writer) const;

        bool read(yarp::os::idl::WireReader& reader) override;
        bool readTag(yarp::os::idl::WireReader& reader);
        bool readArgs(yarp::os::idl::WireReader& reader);
    };

    class Reply :
            public yarp::os::idl::WirePortable
    {
    public:
        Reply() = default;
        ~Reply() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool read(yarp::os::idl::WireReader& reader) override;

        std::string return_helper{};
    };

    using funcptr_t = std::string (*)();
    void call(FakeBatteryService* ptr);

    Command cmd;
    Reply reply;

    static constexpr const char* s_tag{"getBatteryInfo"};
    static constexpr size_t s_tag_len{1};
    static constexpr size_t s_cmd_len{1};
    static constexpr size_t s_reply_len{1};
    static constexpr const char* s_prototype{"std::string FakeBatteryService::getBatteryInfo()"};
    static constexpr const char* s_help{""};
};

// getBatteryTemperature helper class declaration
class FakeBatteryService_getBatteryTemperature_helper :
        public yarp::os::Portable
{
public:
    FakeBatteryService_getBatteryTemperature_helper() = default;
    bool write(yarp::os::ConnectionWriter& connection) const override;
    bool read(yarp::os::ConnectionReader& connection) override;

    class Command :
            public yarp::os::idl::WirePortable
    {
    public:
        Command() = default;
        ~Command() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool writeTag(const yarp::os::idl::WireWriter& writer) const;
        bool writeArgs(const yarp::os::idl::WireWriter& writer) const;

        bool read(yarp::os::idl::WireReader& reader) override;
        bool readTag(yarp::os::idl::WireReader& reader);
        bool readArgs(yarp::os::idl::WireReader& reader);
    };

    class Reply :
            public yarp::os::idl::WirePortable
    {
    public:
        Reply() = default;
        ~Reply() override = default;

        bool write(yarp::os::ConnectionWriter& connection) const override;
        bool read(yarp::os::ConnectionReader& connection) override;

        bool write(const yarp::os::idl::WireWriter& writer) const override;
        bool read(yarp::os::idl::WireReader& reader) override;

        double return_helper{0.0};
    };

    using funcptr_t = double (*)();
    void call(FakeBatteryService* ptr);

    Command cmd;
    Reply reply;

    static constexpr const char* s_tag{"getBatteryTemperature"};
    static constexpr size_t s_tag_len{1};
    static constexpr size_t s_cmd_len{1};
    static constexpr size_t s_reply_len{1};
    static constexpr const char* s_prototype{"double FakeBatteryService::getBatteryTemperature()"};
    static constexpr const char* s_help{""};
};

// setBatteryVoltage helper class implementation
FakeBatteryService_setBatteryVoltage_helper::FakeBatteryService_setBatteryVoltage_helper(const double voltage) :
        cmd{voltage}
{
}

bool FakeBatteryService_setBatteryVoltage_helper::write(yarp::os::ConnectionWriter& connection) const
{
    return cmd.write(connection);
}

bool FakeBatteryService_setBatteryVoltage_helper::read(yarp::os::ConnectionReader& connection)
{
    return reply.read(connection);
}

FakeBatteryService_setBatteryVoltage_helper::Command::Command(const double voltage) :
        voltage{voltage}
{
}

bool FakeBatteryService_setBatteryVoltage_helper::Command::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(s_cmd_len)) {
        return false;
    }
    return write(writer);
}

bool FakeBatteryService_setBatteryVoltage_helper::Command::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    if (!reader.readListHeader()) {
        reader.fail();
        return false;
    }
    return read(reader);
}

bool FakeBatteryService_setBatteryVoltage_helper::Command::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writeTag(writer)) {
        return false;
    }
    if (!writeArgs(writer)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryVoltage_helper::Command::writeTag(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeTag(s_tag, 1, s_tag_len)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryVoltage_helper::Command::writeArgs(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeFloat64(voltage)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryVoltage_helper::Command::read(yarp::os::idl::WireReader& reader)
{
    if (!readTag(reader)) {
        return false;
    }
    if (!readArgs(reader)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryVoltage_helper::Command::readTag(yarp::os::idl::WireReader& reader)
{
    std::string tag = reader.readTag();
    if (reader.isError()) {
        return false;
    }
    if (tag != s_tag) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryVoltage_helper::Command::readArgs(yarp::os::idl::WireReader& reader)
{
    if (reader.noMore()) {
        reader.fail();
        return false;
    }
    if (!reader.readFloat64(voltage)) {
        reader.fail();
        return false;
    }
    if (!reader.noMore()) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryVoltage_helper::Reply::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    return write(writer);
}

bool FakeBatteryService_setBatteryVoltage_helper::Reply::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    return read(reader);
}

bool FakeBatteryService_setBatteryVoltage_helper::Reply::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.isNull()) {
        if (!writer.writeOnewayResponse()) {
            return false;
        }
    }
    return true;
}

bool FakeBatteryService_setBatteryVoltage_helper::Reply::read(yarp::os::idl::WireReader& reader [[maybe_unused]])
{
    return true;
}

void FakeBatteryService_setBatteryVoltage_helper::call(FakeBatteryService* ptr) const
{
    ptr->setBatteryVoltage(cmd.voltage);
}

// setBatteryCurrent helper class implementation
FakeBatteryService_setBatteryCurrent_helper::FakeBatteryService_setBatteryCurrent_helper(const double current) :
        cmd{current}
{
}

bool FakeBatteryService_setBatteryCurrent_helper::write(yarp::os::ConnectionWriter& connection) const
{
    return cmd.write(connection);
}

bool FakeBatteryService_setBatteryCurrent_helper::read(yarp::os::ConnectionReader& connection)
{
    return reply.read(connection);
}

FakeBatteryService_setBatteryCurrent_helper::Command::Command(const double current) :
        current{current}
{
}

bool FakeBatteryService_setBatteryCurrent_helper::Command::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(s_cmd_len)) {
        return false;
    }
    return write(writer);
}

bool FakeBatteryService_setBatteryCurrent_helper::Command::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    if (!reader.readListHeader()) {
        reader.fail();
        return false;
    }
    return read(reader);
}

bool FakeBatteryService_setBatteryCurrent_helper::Command::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writeTag(writer)) {
        return false;
    }
    if (!writeArgs(writer)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryCurrent_helper::Command::writeTag(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeTag(s_tag, 1, s_tag_len)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryCurrent_helper::Command::writeArgs(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeFloat64(current)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryCurrent_helper::Command::read(yarp::os::idl::WireReader& reader)
{
    if (!readTag(reader)) {
        return false;
    }
    if (!readArgs(reader)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryCurrent_helper::Command::readTag(yarp::os::idl::WireReader& reader)
{
    std::string tag = reader.readTag();
    if (reader.isError()) {
        return false;
    }
    if (tag != s_tag) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryCurrent_helper::Command::readArgs(yarp::os::idl::WireReader& reader)
{
    if (reader.noMore()) {
        reader.fail();
        return false;
    }
    if (!reader.readFloat64(current)) {
        reader.fail();
        return false;
    }
    if (!reader.noMore()) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryCurrent_helper::Reply::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    return write(writer);
}

bool FakeBatteryService_setBatteryCurrent_helper::Reply::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    return read(reader);
}

bool FakeBatteryService_setBatteryCurrent_helper::Reply::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.isNull()) {
        if (!writer.writeOnewayResponse()) {
            return false;
        }
    }
    return true;
}

bool FakeBatteryService_setBatteryCurrent_helper::Reply::read(yarp::os::idl::WireReader& reader [[maybe_unused]])
{
    return true;
}

void FakeBatteryService_setBatteryCurrent_helper::call(FakeBatteryService* ptr) const
{
    ptr->setBatteryCurrent(cmd.current);
}

// setBatteryCharge helper class implementation
FakeBatteryService_setBatteryCharge_helper::FakeBatteryService_setBatteryCharge_helper(const double charge) :
        cmd{charge}
{
}

bool FakeBatteryService_setBatteryCharge_helper::write(yarp::os::ConnectionWriter& connection) const
{
    return cmd.write(connection);
}

bool FakeBatteryService_setBatteryCharge_helper::read(yarp::os::ConnectionReader& connection)
{
    return reply.read(connection);
}

FakeBatteryService_setBatteryCharge_helper::Command::Command(const double charge) :
        charge{charge}
{
}

bool FakeBatteryService_setBatteryCharge_helper::Command::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(s_cmd_len)) {
        return false;
    }
    return write(writer);
}

bool FakeBatteryService_setBatteryCharge_helper::Command::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    if (!reader.readListHeader()) {
        reader.fail();
        return false;
    }
    return read(reader);
}

bool FakeBatteryService_setBatteryCharge_helper::Command::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writeTag(writer)) {
        return false;
    }
    if (!writeArgs(writer)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryCharge_helper::Command::writeTag(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeTag(s_tag, 1, s_tag_len)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryCharge_helper::Command::writeArgs(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeFloat64(charge)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryCharge_helper::Command::read(yarp::os::idl::WireReader& reader)
{
    if (!readTag(reader)) {
        return false;
    }
    if (!readArgs(reader)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryCharge_helper::Command::readTag(yarp::os::idl::WireReader& reader)
{
    std::string tag = reader.readTag();
    if (reader.isError()) {
        return false;
    }
    if (tag != s_tag) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryCharge_helper::Command::readArgs(yarp::os::idl::WireReader& reader)
{
    if (reader.noMore()) {
        reader.fail();
        return false;
    }
    if (!reader.readFloat64(charge)) {
        reader.fail();
        return false;
    }
    if (!reader.noMore()) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryCharge_helper::Reply::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    return write(writer);
}

bool FakeBatteryService_setBatteryCharge_helper::Reply::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    return read(reader);
}

bool FakeBatteryService_setBatteryCharge_helper::Reply::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.isNull()) {
        if (!writer.writeOnewayResponse()) {
            return false;
        }
    }
    return true;
}

bool FakeBatteryService_setBatteryCharge_helper::Reply::read(yarp::os::idl::WireReader& reader [[maybe_unused]])
{
    return true;
}

void FakeBatteryService_setBatteryCharge_helper::call(FakeBatteryService* ptr) const
{
    ptr->setBatteryCharge(cmd.charge);
}

// setBatteryInfo helper class implementation
FakeBatteryService_setBatteryInfo_helper::FakeBatteryService_setBatteryInfo_helper(const std::string& info) :
        cmd{info}
{
}

bool FakeBatteryService_setBatteryInfo_helper::write(yarp::os::ConnectionWriter& connection) const
{
    return cmd.write(connection);
}

bool FakeBatteryService_setBatteryInfo_helper::read(yarp::os::ConnectionReader& connection)
{
    return reply.read(connection);
}

FakeBatteryService_setBatteryInfo_helper::Command::Command(const std::string& info) :
        info{info}
{
}

bool FakeBatteryService_setBatteryInfo_helper::Command::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(s_cmd_len)) {
        return false;
    }
    return write(writer);
}

bool FakeBatteryService_setBatteryInfo_helper::Command::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    if (!reader.readListHeader()) {
        reader.fail();
        return false;
    }
    return read(reader);
}

bool FakeBatteryService_setBatteryInfo_helper::Command::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writeTag(writer)) {
        return false;
    }
    if (!writeArgs(writer)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryInfo_helper::Command::writeTag(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeTag(s_tag, 1, s_tag_len)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryInfo_helper::Command::writeArgs(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeString(info)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryInfo_helper::Command::read(yarp::os::idl::WireReader& reader)
{
    if (!readTag(reader)) {
        return false;
    }
    if (!readArgs(reader)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryInfo_helper::Command::readTag(yarp::os::idl::WireReader& reader)
{
    std::string tag = reader.readTag();
    if (reader.isError()) {
        return false;
    }
    if (tag != s_tag) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryInfo_helper::Command::readArgs(yarp::os::idl::WireReader& reader)
{
    if (reader.noMore()) {
        reader.fail();
        return false;
    }
    if (!reader.readString(info)) {
        reader.fail();
        return false;
    }
    if (!reader.noMore()) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryInfo_helper::Reply::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    return write(writer);
}

bool FakeBatteryService_setBatteryInfo_helper::Reply::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    return read(reader);
}

bool FakeBatteryService_setBatteryInfo_helper::Reply::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.isNull()) {
        if (!writer.writeOnewayResponse()) {
            return false;
        }
    }
    return true;
}

bool FakeBatteryService_setBatteryInfo_helper::Reply::read(yarp::os::idl::WireReader& reader [[maybe_unused]])
{
    return true;
}

void FakeBatteryService_setBatteryInfo_helper::call(FakeBatteryService* ptr) const
{
    ptr->setBatteryInfo(cmd.info);
}

// setBatteryTemperature helper class implementation
FakeBatteryService_setBatteryTemperature_helper::FakeBatteryService_setBatteryTemperature_helper(const double temperature) :
        cmd{temperature}
{
}

bool FakeBatteryService_setBatteryTemperature_helper::write(yarp::os::ConnectionWriter& connection) const
{
    return cmd.write(connection);
}

bool FakeBatteryService_setBatteryTemperature_helper::read(yarp::os::ConnectionReader& connection)
{
    return reply.read(connection);
}

FakeBatteryService_setBatteryTemperature_helper::Command::Command(const double temperature) :
        temperature{temperature}
{
}

bool FakeBatteryService_setBatteryTemperature_helper::Command::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(s_cmd_len)) {
        return false;
    }
    return write(writer);
}

bool FakeBatteryService_setBatteryTemperature_helper::Command::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    if (!reader.readListHeader()) {
        reader.fail();
        return false;
    }
    return read(reader);
}

bool FakeBatteryService_setBatteryTemperature_helper::Command::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writeTag(writer)) {
        return false;
    }
    if (!writeArgs(writer)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryTemperature_helper::Command::writeTag(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeTag(s_tag, 1, s_tag_len)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryTemperature_helper::Command::writeArgs(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeFloat64(temperature)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryTemperature_helper::Command::read(yarp::os::idl::WireReader& reader)
{
    if (!readTag(reader)) {
        return false;
    }
    if (!readArgs(reader)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryTemperature_helper::Command::readTag(yarp::os::idl::WireReader& reader)
{
    std::string tag = reader.readTag();
    if (reader.isError()) {
        return false;
    }
    if (tag != s_tag) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryTemperature_helper::Command::readArgs(yarp::os::idl::WireReader& reader)
{
    if (reader.noMore()) {
        reader.fail();
        return false;
    }
    if (!reader.readFloat64(temperature)) {
        reader.fail();
        return false;
    }
    if (!reader.noMore()) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_setBatteryTemperature_helper::Reply::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    return write(writer);
}

bool FakeBatteryService_setBatteryTemperature_helper::Reply::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    return read(reader);
}

bool FakeBatteryService_setBatteryTemperature_helper::Reply::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.isNull()) {
        if (!writer.writeOnewayResponse()) {
            return false;
        }
    }
    return true;
}

bool FakeBatteryService_setBatteryTemperature_helper::Reply::read(yarp::os::idl::WireReader& reader [[maybe_unused]])
{
    return true;
}

void FakeBatteryService_setBatteryTemperature_helper::call(FakeBatteryService* ptr) const
{
    ptr->setBatteryTemperature(cmd.temperature);
}

// getBatteryVoltage helper class implementation
bool FakeBatteryService_getBatteryVoltage_helper::write(yarp::os::ConnectionWriter& connection) const
{
    return cmd.write(connection);
}

bool FakeBatteryService_getBatteryVoltage_helper::read(yarp::os::ConnectionReader& connection)
{
    return reply.read(connection);
}

bool FakeBatteryService_getBatteryVoltage_helper::Command::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(s_cmd_len)) {
        return false;
    }
    return write(writer);
}

bool FakeBatteryService_getBatteryVoltage_helper::Command::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    if (!reader.readListHeader()) {
        reader.fail();
        return false;
    }
    return read(reader);
}

bool FakeBatteryService_getBatteryVoltage_helper::Command::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writeTag(writer)) {
        return false;
    }
    if (!writeArgs(writer)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryVoltage_helper::Command::writeTag(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeTag(s_tag, 1, s_tag_len)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryVoltage_helper::Command::writeArgs(const yarp::os::idl::WireWriter& writer [[maybe_unused]]) const
{
    return true;
}

bool FakeBatteryService_getBatteryVoltage_helper::Command::read(yarp::os::idl::WireReader& reader)
{
    if (!readTag(reader)) {
        return false;
    }
    if (!readArgs(reader)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryVoltage_helper::Command::readTag(yarp::os::idl::WireReader& reader)
{
    std::string tag = reader.readTag();
    if (reader.isError()) {
        return false;
    }
    if (tag != s_tag) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryVoltage_helper::Command::readArgs(yarp::os::idl::WireReader& reader)
{
    if (!reader.noMore()) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryVoltage_helper::Reply::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    return write(writer);
}

bool FakeBatteryService_getBatteryVoltage_helper::Reply::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    return read(reader);
}

bool FakeBatteryService_getBatteryVoltage_helper::Reply::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.isNull()) {
        if (!writer.writeListHeader(s_reply_len)) {
            return false;
        }
        if (!writer.writeFloat64(return_helper)) {
            return false;
        }
    }
    return true;
}

bool FakeBatteryService_getBatteryVoltage_helper::Reply::read(yarp::os::idl::WireReader& reader)
{
    if (!reader.readListReturn()) {
        return false;
    }
    if (reader.noMore()) {
        reader.fail();
        return false;
    }
    if (!reader.readFloat64(return_helper)) {
        reader.fail();
        return false;
    }
    return true;
}

void FakeBatteryService_getBatteryVoltage_helper::call(FakeBatteryService* ptr)
{
    reply.return_helper = ptr->getBatteryVoltage();
}

// getBatteryCurrent helper class implementation
bool FakeBatteryService_getBatteryCurrent_helper::write(yarp::os::ConnectionWriter& connection) const
{
    return cmd.write(connection);
}

bool FakeBatteryService_getBatteryCurrent_helper::read(yarp::os::ConnectionReader& connection)
{
    return reply.read(connection);
}

bool FakeBatteryService_getBatteryCurrent_helper::Command::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(s_cmd_len)) {
        return false;
    }
    return write(writer);
}

bool FakeBatteryService_getBatteryCurrent_helper::Command::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    if (!reader.readListHeader()) {
        reader.fail();
        return false;
    }
    return read(reader);
}

bool FakeBatteryService_getBatteryCurrent_helper::Command::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writeTag(writer)) {
        return false;
    }
    if (!writeArgs(writer)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryCurrent_helper::Command::writeTag(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeTag(s_tag, 1, s_tag_len)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryCurrent_helper::Command::writeArgs(const yarp::os::idl::WireWriter& writer [[maybe_unused]]) const
{
    return true;
}

bool FakeBatteryService_getBatteryCurrent_helper::Command::read(yarp::os::idl::WireReader& reader)
{
    if (!readTag(reader)) {
        return false;
    }
    if (!readArgs(reader)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryCurrent_helper::Command::readTag(yarp::os::idl::WireReader& reader)
{
    std::string tag = reader.readTag();
    if (reader.isError()) {
        return false;
    }
    if (tag != s_tag) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryCurrent_helper::Command::readArgs(yarp::os::idl::WireReader& reader)
{
    if (!reader.noMore()) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryCurrent_helper::Reply::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    return write(writer);
}

bool FakeBatteryService_getBatteryCurrent_helper::Reply::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    return read(reader);
}

bool FakeBatteryService_getBatteryCurrent_helper::Reply::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.isNull()) {
        if (!writer.writeListHeader(s_reply_len)) {
            return false;
        }
        if (!writer.writeFloat64(return_helper)) {
            return false;
        }
    }
    return true;
}

bool FakeBatteryService_getBatteryCurrent_helper::Reply::read(yarp::os::idl::WireReader& reader)
{
    if (!reader.readListReturn()) {
        return false;
    }
    if (reader.noMore()) {
        reader.fail();
        return false;
    }
    if (!reader.readFloat64(return_helper)) {
        reader.fail();
        return false;
    }
    return true;
}

void FakeBatteryService_getBatteryCurrent_helper::call(FakeBatteryService* ptr)
{
    reply.return_helper = ptr->getBatteryCurrent();
}

// getBatteryCharge helper class implementation
bool FakeBatteryService_getBatteryCharge_helper::write(yarp::os::ConnectionWriter& connection) const
{
    return cmd.write(connection);
}

bool FakeBatteryService_getBatteryCharge_helper::read(yarp::os::ConnectionReader& connection)
{
    return reply.read(connection);
}

bool FakeBatteryService_getBatteryCharge_helper::Command::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(s_cmd_len)) {
        return false;
    }
    return write(writer);
}

bool FakeBatteryService_getBatteryCharge_helper::Command::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    if (!reader.readListHeader()) {
        reader.fail();
        return false;
    }
    return read(reader);
}

bool FakeBatteryService_getBatteryCharge_helper::Command::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writeTag(writer)) {
        return false;
    }
    if (!writeArgs(writer)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryCharge_helper::Command::writeTag(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeTag(s_tag, 1, s_tag_len)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryCharge_helper::Command::writeArgs(const yarp::os::idl::WireWriter& writer [[maybe_unused]]) const
{
    return true;
}

bool FakeBatteryService_getBatteryCharge_helper::Command::read(yarp::os::idl::WireReader& reader)
{
    if (!readTag(reader)) {
        return false;
    }
    if (!readArgs(reader)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryCharge_helper::Command::readTag(yarp::os::idl::WireReader& reader)
{
    std::string tag = reader.readTag();
    if (reader.isError()) {
        return false;
    }
    if (tag != s_tag) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryCharge_helper::Command::readArgs(yarp::os::idl::WireReader& reader)
{
    if (!reader.noMore()) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryCharge_helper::Reply::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    return write(writer);
}

bool FakeBatteryService_getBatteryCharge_helper::Reply::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    return read(reader);
}

bool FakeBatteryService_getBatteryCharge_helper::Reply::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.isNull()) {
        if (!writer.writeListHeader(s_reply_len)) {
            return false;
        }
        if (!writer.writeFloat64(return_helper)) {
            return false;
        }
    }
    return true;
}

bool FakeBatteryService_getBatteryCharge_helper::Reply::read(yarp::os::idl::WireReader& reader)
{
    if (!reader.readListReturn()) {
        return false;
    }
    if (reader.noMore()) {
        reader.fail();
        return false;
    }
    if (!reader.readFloat64(return_helper)) {
        reader.fail();
        return false;
    }
    return true;
}

void FakeBatteryService_getBatteryCharge_helper::call(FakeBatteryService* ptr)
{
    reply.return_helper = ptr->getBatteryCharge();
}

// getBatteryStatus helper class implementation
bool FakeBatteryService_getBatteryStatus_helper::write(yarp::os::ConnectionWriter& connection) const
{
    return cmd.write(connection);
}

bool FakeBatteryService_getBatteryStatus_helper::read(yarp::os::ConnectionReader& connection)
{
    return reply.read(connection);
}

bool FakeBatteryService_getBatteryStatus_helper::Command::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(s_cmd_len)) {
        return false;
    }
    return write(writer);
}

bool FakeBatteryService_getBatteryStatus_helper::Command::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    if (!reader.readListHeader()) {
        reader.fail();
        return false;
    }
    return read(reader);
}

bool FakeBatteryService_getBatteryStatus_helper::Command::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writeTag(writer)) {
        return false;
    }
    if (!writeArgs(writer)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryStatus_helper::Command::writeTag(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeTag(s_tag, 1, s_tag_len)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryStatus_helper::Command::writeArgs(const yarp::os::idl::WireWriter& writer [[maybe_unused]]) const
{
    return true;
}

bool FakeBatteryService_getBatteryStatus_helper::Command::read(yarp::os::idl::WireReader& reader)
{
    if (!readTag(reader)) {
        return false;
    }
    if (!readArgs(reader)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryStatus_helper::Command::readTag(yarp::os::idl::WireReader& reader)
{
    std::string tag = reader.readTag();
    if (reader.isError()) {
        return false;
    }
    if (tag != s_tag) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryStatus_helper::Command::readArgs(yarp::os::idl::WireReader& reader)
{
    if (!reader.noMore()) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryStatus_helper::Reply::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    return write(writer);
}

bool FakeBatteryService_getBatteryStatus_helper::Reply::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    return read(reader);
}

bool FakeBatteryService_getBatteryStatus_helper::Reply::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.isNull()) {
        if (!writer.writeListHeader(s_reply_len)) {
            return false;
        }
        if (!writer.writeString(return_helper)) {
            return false;
        }
    }
    return true;
}

bool FakeBatteryService_getBatteryStatus_helper::Reply::read(yarp::os::idl::WireReader& reader)
{
    if (!reader.readListReturn()) {
        return false;
    }
    if (reader.noMore()) {
        reader.fail();
        return false;
    }
    if (!reader.readString(return_helper)) {
        reader.fail();
        return false;
    }
    return true;
}

void FakeBatteryService_getBatteryStatus_helper::call(FakeBatteryService* ptr)
{
    reply.return_helper = ptr->getBatteryStatus();
}

// getBatteryInfo helper class implementation
bool FakeBatteryService_getBatteryInfo_helper::write(yarp::os::ConnectionWriter& connection) const
{
    return cmd.write(connection);
}

bool FakeBatteryService_getBatteryInfo_helper::read(yarp::os::ConnectionReader& connection)
{
    return reply.read(connection);
}

bool FakeBatteryService_getBatteryInfo_helper::Command::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(s_cmd_len)) {
        return false;
    }
    return write(writer);
}

bool FakeBatteryService_getBatteryInfo_helper::Command::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    if (!reader.readListHeader()) {
        reader.fail();
        return false;
    }
    return read(reader);
}

bool FakeBatteryService_getBatteryInfo_helper::Command::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writeTag(writer)) {
        return false;
    }
    if (!writeArgs(writer)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryInfo_helper::Command::writeTag(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeTag(s_tag, 1, s_tag_len)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryInfo_helper::Command::writeArgs(const yarp::os::idl::WireWriter& writer [[maybe_unused]]) const
{
    return true;
}

bool FakeBatteryService_getBatteryInfo_helper::Command::read(yarp::os::idl::WireReader& reader)
{
    if (!readTag(reader)) {
        return false;
    }
    if (!readArgs(reader)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryInfo_helper::Command::readTag(yarp::os::idl::WireReader& reader)
{
    std::string tag = reader.readTag();
    if (reader.isError()) {
        return false;
    }
    if (tag != s_tag) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryInfo_helper::Command::readArgs(yarp::os::idl::WireReader& reader)
{
    if (!reader.noMore()) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryInfo_helper::Reply::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    return write(writer);
}

bool FakeBatteryService_getBatteryInfo_helper::Reply::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    return read(reader);
}

bool FakeBatteryService_getBatteryInfo_helper::Reply::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.isNull()) {
        if (!writer.writeListHeader(s_reply_len)) {
            return false;
        }
        if (!writer.writeString(return_helper)) {
            return false;
        }
    }
    return true;
}

bool FakeBatteryService_getBatteryInfo_helper::Reply::read(yarp::os::idl::WireReader& reader)
{
    if (!reader.readListReturn()) {
        return false;
    }
    if (reader.noMore()) {
        reader.fail();
        return false;
    }
    if (!reader.readString(return_helper)) {
        reader.fail();
        return false;
    }
    return true;
}

void FakeBatteryService_getBatteryInfo_helper::call(FakeBatteryService* ptr)
{
    reply.return_helper = ptr->getBatteryInfo();
}

// getBatteryTemperature helper class implementation
bool FakeBatteryService_getBatteryTemperature_helper::write(yarp::os::ConnectionWriter& connection) const
{
    return cmd.write(connection);
}

bool FakeBatteryService_getBatteryTemperature_helper::read(yarp::os::ConnectionReader& connection)
{
    return reply.read(connection);
}

bool FakeBatteryService_getBatteryTemperature_helper::Command::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(s_cmd_len)) {
        return false;
    }
    return write(writer);
}

bool FakeBatteryService_getBatteryTemperature_helper::Command::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    if (!reader.readListHeader()) {
        reader.fail();
        return false;
    }
    return read(reader);
}

bool FakeBatteryService_getBatteryTemperature_helper::Command::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writeTag(writer)) {
        return false;
    }
    if (!writeArgs(writer)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryTemperature_helper::Command::writeTag(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeTag(s_tag, 1, s_tag_len)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryTemperature_helper::Command::writeArgs(const yarp::os::idl::WireWriter& writer [[maybe_unused]]) const
{
    return true;
}

bool FakeBatteryService_getBatteryTemperature_helper::Command::read(yarp::os::idl::WireReader& reader)
{
    if (!readTag(reader)) {
        return false;
    }
    if (!readArgs(reader)) {
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryTemperature_helper::Command::readTag(yarp::os::idl::WireReader& reader)
{
    std::string tag = reader.readTag();
    if (reader.isError()) {
        return false;
    }
    if (tag != s_tag) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryTemperature_helper::Command::readArgs(yarp::os::idl::WireReader& reader)
{
    if (!reader.noMore()) {
        reader.fail();
        return false;
    }
    return true;
}

bool FakeBatteryService_getBatteryTemperature_helper::Reply::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    return write(writer);
}

bool FakeBatteryService_getBatteryTemperature_helper::Reply::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    return read(reader);
}

bool FakeBatteryService_getBatteryTemperature_helper::Reply::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.isNull()) {
        if (!writer.writeListHeader(s_reply_len)) {
            return false;
        }
        if (!writer.writeFloat64(return_helper)) {
            return false;
        }
    }
    return true;
}

bool FakeBatteryService_getBatteryTemperature_helper::Reply::read(yarp::os::idl::WireReader& reader)
{
    if (!reader.readListReturn()) {
        return false;
    }
    if (reader.noMore()) {
        reader.fail();
        return false;
    }
    if (!reader.readFloat64(return_helper)) {
        reader.fail();
        return false;
    }
    return true;
}

void FakeBatteryService_getBatteryTemperature_helper::call(FakeBatteryService* ptr)
{
    reply.return_helper = ptr->getBatteryTemperature();
}

// Constructor
FakeBatteryService::FakeBatteryService()
{
    yarp().setOwner(*this);
}

void FakeBatteryService::setBatteryVoltage(const double voltage)
{
    if (!yarp().canWrite()) {
        yError("Missing server method '%s'?", FakeBatteryService_setBatteryVoltage_helper::s_prototype);
    }
    FakeBatteryService_setBatteryVoltage_helper helper{voltage};
    yarp().write(helper);
}

void FakeBatteryService::setBatteryCurrent(const double current)
{
    if (!yarp().canWrite()) {
        yError("Missing server method '%s'?", FakeBatteryService_setBatteryCurrent_helper::s_prototype);
    }
    FakeBatteryService_setBatteryCurrent_helper helper{current};
    yarp().write(helper);
}

void FakeBatteryService::setBatteryCharge(const double charge)
{
    if (!yarp().canWrite()) {
        yError("Missing server method '%s'?", FakeBatteryService_setBatteryCharge_helper::s_prototype);
    }
    FakeBatteryService_setBatteryCharge_helper helper{charge};
    yarp().write(helper);
}

void FakeBatteryService::setBatteryInfo(const std::string& info)
{
    if (!yarp().canWrite()) {
        yError("Missing server method '%s'?", FakeBatteryService_setBatteryInfo_helper::s_prototype);
    }
    FakeBatteryService_setBatteryInfo_helper helper{info};
    yarp().write(helper);
}

void FakeBatteryService::setBatteryTemperature(const double temperature)
{
    if (!yarp().canWrite()) {
        yError("Missing server method '%s'?", FakeBatteryService_setBatteryTemperature_helper::s_prototype);
    }
    FakeBatteryService_setBatteryTemperature_helper helper{temperature};
    yarp().write(helper);
}

double FakeBatteryService::getBatteryVoltage()
{
    if (!yarp().canWrite()) {
        yError("Missing server method '%s'?", FakeBatteryService_getBatteryVoltage_helper::s_prototype);
    }
    FakeBatteryService_getBatteryVoltage_helper helper{};
    bool ok = yarp().write(helper, helper);
    return ok ? helper.reply.return_helper : double{};
}

double FakeBatteryService::getBatteryCurrent()
{
    if (!yarp().canWrite()) {
        yError("Missing server method '%s'?", FakeBatteryService_getBatteryCurrent_helper::s_prototype);
    }
    FakeBatteryService_getBatteryCurrent_helper helper{};
    bool ok = yarp().write(helper, helper);
    return ok ? helper.reply.return_helper : double{};
}

double FakeBatteryService::getBatteryCharge()
{
    if (!yarp().canWrite()) {
        yError("Missing server method '%s'?", FakeBatteryService_getBatteryCharge_helper::s_prototype);
    }
    FakeBatteryService_getBatteryCharge_helper helper{};
    bool ok = yarp().write(helper, helper);
    return ok ? helper.reply.return_helper : double{};
}

std::string FakeBatteryService::getBatteryStatus()
{
    if (!yarp().canWrite()) {
        yError("Missing server method '%s'?", FakeBatteryService_getBatteryStatus_helper::s_prototype);
    }
    FakeBatteryService_getBatteryStatus_helper helper{};
    bool ok = yarp().write(helper, helper);
    return ok ? helper.reply.return_helper : std::string{};
}

std::string FakeBatteryService::getBatteryInfo()
{
    if (!yarp().canWrite()) {
        yError("Missing server method '%s'?", FakeBatteryService_getBatteryInfo_helper::s_prototype);
    }
    FakeBatteryService_getBatteryInfo_helper helper{};
    bool ok = yarp().write(helper, helper);
    return ok ? helper.reply.return_helper : std::string{};
}

double FakeBatteryService::getBatteryTemperature()
{
    if (!yarp().canWrite()) {
        yError("Missing server method '%s'?", FakeBatteryService_getBatteryTemperature_helper::s_prototype);
    }
    FakeBatteryService_getBatteryTemperature_helper helper{};
    bool ok = yarp().write(helper, helper);
    return ok ? helper.reply.return_helper : double{};
}

// help method
std::vector<std::string> FakeBatteryService::help(const std::string& functionName)
{
    bool showAll = (functionName == "--all");
    std::vector<std::string> helpString;
    if (showAll) {
        helpString.emplace_back("*** Available commands:");
        helpString.emplace_back(FakeBatteryService_setBatteryVoltage_helper::s_tag);
        helpString.emplace_back(FakeBatteryService_setBatteryCurrent_helper::s_tag);
        helpString.emplace_back(FakeBatteryService_setBatteryCharge_helper::s_tag);
        helpString.emplace_back(FakeBatteryService_setBatteryInfo_helper::s_tag);
        helpString.emplace_back(FakeBatteryService_setBatteryTemperature_helper::s_tag);
        helpString.emplace_back(FakeBatteryService_getBatteryVoltage_helper::s_tag);
        helpString.emplace_back(FakeBatteryService_getBatteryCurrent_helper::s_tag);
        helpString.emplace_back(FakeBatteryService_getBatteryCharge_helper::s_tag);
        helpString.emplace_back(FakeBatteryService_getBatteryStatus_helper::s_tag);
        helpString.emplace_back(FakeBatteryService_getBatteryInfo_helper::s_tag);
        helpString.emplace_back(FakeBatteryService_getBatteryTemperature_helper::s_tag);
        helpString.emplace_back("help");
    } else {
        if (functionName == FakeBatteryService_setBatteryVoltage_helper::s_tag) {
            helpString.emplace_back(FakeBatteryService_setBatteryVoltage_helper::s_prototype);
        }
        if (functionName == FakeBatteryService_setBatteryCurrent_helper::s_tag) {
            helpString.emplace_back(FakeBatteryService_setBatteryCurrent_helper::s_prototype);
        }
        if (functionName == FakeBatteryService_setBatteryCharge_helper::s_tag) {
            helpString.emplace_back(FakeBatteryService_setBatteryCharge_helper::s_prototype);
        }
        if (functionName == FakeBatteryService_setBatteryInfo_helper::s_tag) {
            helpString.emplace_back(FakeBatteryService_setBatteryInfo_helper::s_prototype);
        }
        if (functionName == FakeBatteryService_setBatteryTemperature_helper::s_tag) {
            helpString.emplace_back(FakeBatteryService_setBatteryTemperature_helper::s_prototype);
        }
        if (functionName == FakeBatteryService_getBatteryVoltage_helper::s_tag) {
            helpString.emplace_back(FakeBatteryService_getBatteryVoltage_helper::s_prototype);
        }
        if (functionName == FakeBatteryService_getBatteryCurrent_helper::s_tag) {
            helpString.emplace_back(FakeBatteryService_getBatteryCurrent_helper::s_prototype);
        }
        if (functionName == FakeBatteryService_getBatteryCharge_helper::s_tag) {
            helpString.emplace_back(FakeBatteryService_getBatteryCharge_helper::s_prototype);
        }
        if (functionName == FakeBatteryService_getBatteryStatus_helper::s_tag) {
            helpString.emplace_back(FakeBatteryService_getBatteryStatus_helper::s_prototype);
        }
        if (functionName == FakeBatteryService_getBatteryInfo_helper::s_tag) {
            helpString.emplace_back(FakeBatteryService_getBatteryInfo_helper::s_prototype);
        }
        if (functionName == FakeBatteryService_getBatteryTemperature_helper::s_tag) {
            helpString.emplace_back(FakeBatteryService_getBatteryTemperature_helper::s_prototype);
        }
        if (functionName == "help") {
            helpString.emplace_back("std::vector<std::string> help(const std::string& functionName = \"--all\")");
            helpString.emplace_back("Return list of available commands, or help message for a specific function");
            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");
            helpString.emplace_back("@return list of strings (one string per line)");
        }
    }
    if (helpString.empty()) {
        helpString.emplace_back("Command not found");
    }
    return helpString;
}

// read from ConnectionReader
bool FakeBatteryService::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    reader.expectAccept();
    if (!reader.readListHeader()) {
        reader.fail();
        return false;
    }

    std::string tag = reader.readTag();
    bool direct = (tag == "__direct__");
    if (direct) {
        tag = reader.readTag();
    }
    while (!reader.isError()) {
        if (tag == FakeBatteryService_setBatteryVoltage_helper::s_tag) {
            FakeBatteryService_setBatteryVoltage_helper helper;
            if (!helper.cmd.readArgs(reader)) {
                return false;
            }

            if (!direct) {
                yarp().callback(helper, *this, "__direct__");
            } else {
                helper.call(this);
            }

            yarp::os::idl::WireWriter writer(reader);
            if (!helper.reply.write(writer)) {
                return false;
            }
            reader.accept();
            return true;
        }
        if (tag == FakeBatteryService_setBatteryCurrent_helper::s_tag) {
            FakeBatteryService_setBatteryCurrent_helper helper;
            if (!helper.cmd.readArgs(reader)) {
                return false;
            }

            if (!direct) {
                yarp().callback(helper, *this, "__direct__");
            } else {
                helper.call(this);
            }

            yarp::os::idl::WireWriter writer(reader);
            if (!helper.reply.write(writer)) {
                return false;
            }
            reader.accept();
            return true;
        }
        if (tag == FakeBatteryService_setBatteryCharge_helper::s_tag) {
            FakeBatteryService_setBatteryCharge_helper helper;
            if (!helper.cmd.readArgs(reader)) {
                return false;
            }

            if (!direct) {
                yarp().callback(helper, *this, "__direct__");
            } else {
                helper.call(this);
            }

            yarp::os::idl::WireWriter writer(reader);
            if (!helper.reply.write(writer)) {
                return false;
            }
            reader.accept();
            return true;
        }
        if (tag == FakeBatteryService_setBatteryInfo_helper::s_tag) {
            FakeBatteryService_setBatteryInfo_helper helper;
            if (!helper.cmd.readArgs(reader)) {
                return false;
            }

            if (!direct) {
                yarp().callback(helper, *this, "__direct__");
            } else {
                helper.call(this);
            }

            yarp::os::idl::WireWriter writer(reader);
            if (!helper.reply.write(writer)) {
                return false;
            }
            reader.accept();
            return true;
        }
        if (tag == FakeBatteryService_setBatteryTemperature_helper::s_tag) {
            FakeBatteryService_setBatteryTemperature_helper helper;
            if (!helper.cmd.readArgs(reader)) {
                return false;
            }

            if (!direct) {
                yarp().callback(helper, *this, "__direct__");
            } else {
                helper.call(this);
            }

            yarp::os::idl::WireWriter writer(reader);
            if (!helper.reply.write(writer)) {
                return false;
            }
            reader.accept();
            return true;
        }
        if (tag == FakeBatteryService_getBatteryVoltage_helper::s_tag) {
            FakeBatteryService_getBatteryVoltage_helper helper;
            if (!helper.cmd.readArgs(reader)) {
                return false;
            }

            helper.call(this);

            yarp::os::idl::WireWriter writer(reader);
            if (!helper.reply.write(writer)) {
                return false;
            }
            reader.accept();
            return true;
        }
        if (tag == FakeBatteryService_getBatteryCurrent_helper::s_tag) {
            FakeBatteryService_getBatteryCurrent_helper helper;
            if (!helper.cmd.readArgs(reader)) {
                return false;
            }

            helper.call(this);

            yarp::os::idl::WireWriter writer(reader);
            if (!helper.reply.write(writer)) {
                return false;
            }
            reader.accept();
            return true;
        }
        if (tag == FakeBatteryService_getBatteryCharge_helper::s_tag) {
            FakeBatteryService_getBatteryCharge_helper helper;
            if (!helper.cmd.readArgs(reader)) {
                return false;
            }

            helper.call(this);

            yarp::os::idl::WireWriter writer(reader);
            if (!helper.reply.write(writer)) {
                return false;
            }
            reader.accept();
            return true;
        }
        if (tag == FakeBatteryService_getBatteryStatus_helper::s_tag) {
            FakeBatteryService_getBatteryStatus_helper helper;
            if (!helper.cmd.readArgs(reader)) {
                return false;
            }

            helper.call(this);

            yarp::os::idl::WireWriter writer(reader);
            if (!helper.reply.write(writer)) {
                return false;
            }
            reader.accept();
            return true;
        }
        if (tag == FakeBatteryService_getBatteryInfo_helper::s_tag) {
            FakeBatteryService_getBatteryInfo_helper helper;
            if (!helper.cmd.readArgs(reader)) {
                return false;
            }

            helper.call(this);

            yarp::os::idl::WireWriter writer(reader);
            if (!helper.reply.write(writer)) {
                return false;
            }
            reader.accept();
            return true;
        }
        if (tag == FakeBatteryService_getBatteryTemperature_helper::s_tag) {
            FakeBatteryService_getBatteryTemperature_helper helper;
            if (!helper.cmd.readArgs(reader)) {
                return false;
            }

            helper.call(this);

            yarp::os::idl::WireWriter writer(reader);
            if (!helper.reply.write(writer)) {
                return false;
            }
            reader.accept();
            return true;
        }
        if (tag == "help") {
            std::string functionName;
            if (!reader.readString(functionName)) {
                functionName = "--all";
            }
            auto help_strings = help(functionName);
            yarp::os::idl::WireWriter writer(reader);
            if (!writer.isNull()) {
                if (!writer.writeListHeader(2)) {
                    return false;
                }
                if (!writer.writeTag("many", 1, 0)) {
                    return false;
                }
                if (!writer.writeListBegin(BOTTLE_TAG_INT32, static_cast<uint32_t>(help_strings.size()))) {
                    return false;
                }
                for (const auto& help_string : help_strings) {
                    if (!writer.writeString(help_string)) {
                        return false;
                    }
                }
                if (!writer.writeListEnd()) {
                    return false;
                }
            }
            reader.accept();
            return true;
        }
        if (reader.noMore()) {
            reader.fail();
            return false;
        }
        std::string next_tag = reader.readTag();
        if (next_tag.empty()) {
            break;
        }
        tag.append("_").append(next_tag);
    }
    return false;
}
