/*
 * 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 <yarp/dev/impl/jointData.h>

namespace yarp {
namespace dev {
namespace impl {

// Default constructor
jointData::jointData() :
        WirePortable(),
        jointPosition(),
        jointPosition_isValid(0),
        jointVelocity(),
        jointVelocity_isValid(0),
        jointAcceleration(),
        jointAcceleration_isValid(0),
        motorPosition(),
        motorPosition_isValid(0),
        motorVelocity(),
        motorVelocity_isValid(0),
        motorAcceleration(),
        motorAcceleration_isValid(0),
        torque(),
        torque_isValid(0),
        pwmDutycycle(),
        pwmDutycycle_isValid(0),
        current(),
        current_isValid(0),
        controlMode(),
        controlMode_isValid(0),
        interactionMode(),
        interactionMode_isValid(0)
{
}

// Constructor with field values
jointData::jointData(const yarp::sig::VectorOf<double>& jointPosition,
                     const bool jointPosition_isValid,
                     const yarp::sig::VectorOf<double>& jointVelocity,
                     const bool jointVelocity_isValid,
                     const yarp::sig::VectorOf<double>& jointAcceleration,
                     const bool jointAcceleration_isValid,
                     const yarp::sig::VectorOf<double>& motorPosition,
                     const bool motorPosition_isValid,
                     const yarp::sig::VectorOf<double>& motorVelocity,
                     const bool motorVelocity_isValid,
                     const yarp::sig::VectorOf<double>& motorAcceleration,
                     const bool motorAcceleration_isValid,
                     const yarp::sig::VectorOf<double>& torque,
                     const bool torque_isValid,
                     const yarp::sig::VectorOf<double>& pwmDutycycle,
                     const bool pwmDutycycle_isValid,
                     const yarp::sig::VectorOf<double>& current,
                     const bool current_isValid,
                     const yarp::sig::VectorOf<int>& controlMode,
                     const bool controlMode_isValid,
                     const yarp::sig::VectorOf<int>& interactionMode,
                     const bool interactionMode_isValid) :
        WirePortable(),
        jointPosition(jointPosition),
        jointPosition_isValid(jointPosition_isValid),
        jointVelocity(jointVelocity),
        jointVelocity_isValid(jointVelocity_isValid),
        jointAcceleration(jointAcceleration),
        jointAcceleration_isValid(jointAcceleration_isValid),
        motorPosition(motorPosition),
        motorPosition_isValid(motorPosition_isValid),
        motorVelocity(motorVelocity),
        motorVelocity_isValid(motorVelocity_isValid),
        motorAcceleration(motorAcceleration),
        motorAcceleration_isValid(motorAcceleration_isValid),
        torque(torque),
        torque_isValid(torque_isValid),
        pwmDutycycle(pwmDutycycle),
        pwmDutycycle_isValid(pwmDutycycle_isValid),
        current(current),
        current_isValid(current_isValid),
        controlMode(controlMode),
        controlMode_isValid(controlMode_isValid),
        interactionMode(interactionMode),
        interactionMode_isValid(interactionMode_isValid)
{
}

// Read structure on a Wire
bool jointData::read(yarp::os::idl::WireReader& reader)
{
    if (!read_jointPosition(reader)) {
        return false;
    }
    if (!read_jointPosition_isValid(reader)) {
        return false;
    }
    if (!read_jointVelocity(reader)) {
        return false;
    }
    if (!read_jointVelocity_isValid(reader)) {
        return false;
    }
    if (!read_jointAcceleration(reader)) {
        return false;
    }
    if (!read_jointAcceleration_isValid(reader)) {
        return false;
    }
    if (!read_motorPosition(reader)) {
        return false;
    }
    if (!read_motorPosition_isValid(reader)) {
        return false;
    }
    if (!read_motorVelocity(reader)) {
        return false;
    }
    if (!read_motorVelocity_isValid(reader)) {
        return false;
    }
    if (!read_motorAcceleration(reader)) {
        return false;
    }
    if (!read_motorAcceleration_isValid(reader)) {
        return false;
    }
    if (!read_torque(reader)) {
        return false;
    }
    if (!read_torque_isValid(reader)) {
        return false;
    }
    if (!read_pwmDutycycle(reader)) {
        return false;
    }
    if (!read_pwmDutycycle_isValid(reader)) {
        return false;
    }
    if (!read_current(reader)) {
        return false;
    }
    if (!read_current_isValid(reader)) {
        return false;
    }
    if (!read_controlMode(reader)) {
        return false;
    }
    if (!read_controlMode_isValid(reader)) {
        return false;
    }
    if (!read_interactionMode(reader)) {
        return false;
    }
    if (!read_interactionMode_isValid(reader)) {
        return false;
    }
    return !reader.isError();
}

// Read structure on a Connection
bool jointData::read(yarp::os::ConnectionReader& connection)
{
    yarp::os::idl::WireReader reader(connection);
    if (!reader.readListHeader(22)) {
        return false;
    }
    return read(reader);
}

// Write structure on a Wire
bool jointData::write(const yarp::os::idl::WireWriter& writer) const
{
    if (!write_jointPosition(writer)) {
        return false;
    }
    if (!write_jointPosition_isValid(writer)) {
        return false;
    }
    if (!write_jointVelocity(writer)) {
        return false;
    }
    if (!write_jointVelocity_isValid(writer)) {
        return false;
    }
    if (!write_jointAcceleration(writer)) {
        return false;
    }
    if (!write_jointAcceleration_isValid(writer)) {
        return false;
    }
    if (!write_motorPosition(writer)) {
        return false;
    }
    if (!write_motorPosition_isValid(writer)) {
        return false;
    }
    if (!write_motorVelocity(writer)) {
        return false;
    }
    if (!write_motorVelocity_isValid(writer)) {
        return false;
    }
    if (!write_motorAcceleration(writer)) {
        return false;
    }
    if (!write_motorAcceleration_isValid(writer)) {
        return false;
    }
    if (!write_torque(writer)) {
        return false;
    }
    if (!write_torque_isValid(writer)) {
        return false;
    }
    if (!write_pwmDutycycle(writer)) {
        return false;
    }
    if (!write_pwmDutycycle_isValid(writer)) {
        return false;
    }
    if (!write_current(writer)) {
        return false;
    }
    if (!write_current_isValid(writer)) {
        return false;
    }
    if (!write_controlMode(writer)) {
        return false;
    }
    if (!write_controlMode_isValid(writer)) {
        return false;
    }
    if (!write_interactionMode(writer)) {
        return false;
    }
    if (!write_interactionMode_isValid(writer)) {
        return false;
    }
    return !writer.isError();
}

// Write structure on a Connection
bool jointData::write(yarp::os::ConnectionWriter& connection) const
{
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(22)) {
        return false;
    }
    return write(writer);
}

// Convert to a printable string
std::string jointData::toString() const
{
    yarp::os::Bottle b;
    b.read(*this);
    return b.toString();
}

// Editor: default constructor
jointData::Editor::Editor()
{
    group = 0;
    obj_owned = true;
    obj = new jointData;
    dirty_flags(false);
    yarp().setOwner(*this);
}

// Editor: constructor with base class
jointData::Editor::Editor(jointData& obj)
{
    group = 0;
    obj_owned = false;
    edit(obj, false);
    yarp().setOwner(*this);
}

// Editor: destructor
jointData::Editor::~Editor()
{
    if (obj_owned) {
        delete obj;
    }
}

// Editor: edit
bool jointData::Editor::edit(jointData& obj, bool dirty)
{
    if (obj_owned) {
        delete this->obj;
    }
    this->obj = &obj;
    obj_owned = false;
    dirty_flags(dirty);
    return true;
}

// Editor: validity check
bool jointData::Editor::isValid() const
{
    return obj != nullptr;
}

// Editor: state
jointData& jointData::Editor::state()
{
    return *obj;
}

// Editor: grouping begin
void jointData::Editor::start_editing()
{
    group++;
}

// Editor: grouping end
void jointData::Editor::stop_editing()
{
    group--;
    if (group == 0 && is_dirty) {
        communicate();
    }
}
// Editor: jointPosition setter
void jointData::Editor::set_jointPosition(const yarp::sig::VectorOf<double>& jointPosition)
{
    will_set_jointPosition();
    obj->jointPosition = jointPosition;
    mark_dirty_jointPosition();
    communicate();
    did_set_jointPosition();
}

// Editor: jointPosition getter
const yarp::sig::VectorOf<double>& jointData::Editor::get_jointPosition() const
{
    return obj->jointPosition;
}

// Editor: jointPosition will_set
bool jointData::Editor::will_set_jointPosition()
{
    return true;
}

// Editor: jointPosition did_set
bool jointData::Editor::did_set_jointPosition()
{
    return true;
}

// Editor: jointPosition_isValid setter
void jointData::Editor::set_jointPosition_isValid(const bool jointPosition_isValid)
{
    will_set_jointPosition_isValid();
    obj->jointPosition_isValid = jointPosition_isValid;
    mark_dirty_jointPosition_isValid();
    communicate();
    did_set_jointPosition_isValid();
}

// Editor: jointPosition_isValid getter
bool jointData::Editor::get_jointPosition_isValid() const
{
    return obj->jointPosition_isValid;
}

// Editor: jointPosition_isValid will_set
bool jointData::Editor::will_set_jointPosition_isValid()
{
    return true;
}

// Editor: jointPosition_isValid did_set
bool jointData::Editor::did_set_jointPosition_isValid()
{
    return true;
}

// Editor: jointVelocity setter
void jointData::Editor::set_jointVelocity(const yarp::sig::VectorOf<double>& jointVelocity)
{
    will_set_jointVelocity();
    obj->jointVelocity = jointVelocity;
    mark_dirty_jointVelocity();
    communicate();
    did_set_jointVelocity();
}

// Editor: jointVelocity getter
const yarp::sig::VectorOf<double>& jointData::Editor::get_jointVelocity() const
{
    return obj->jointVelocity;
}

// Editor: jointVelocity will_set
bool jointData::Editor::will_set_jointVelocity()
{
    return true;
}

// Editor: jointVelocity did_set
bool jointData::Editor::did_set_jointVelocity()
{
    return true;
}

// Editor: jointVelocity_isValid setter
void jointData::Editor::set_jointVelocity_isValid(const bool jointVelocity_isValid)
{
    will_set_jointVelocity_isValid();
    obj->jointVelocity_isValid = jointVelocity_isValid;
    mark_dirty_jointVelocity_isValid();
    communicate();
    did_set_jointVelocity_isValid();
}

// Editor: jointVelocity_isValid getter
bool jointData::Editor::get_jointVelocity_isValid() const
{
    return obj->jointVelocity_isValid;
}

// Editor: jointVelocity_isValid will_set
bool jointData::Editor::will_set_jointVelocity_isValid()
{
    return true;
}

// Editor: jointVelocity_isValid did_set
bool jointData::Editor::did_set_jointVelocity_isValid()
{
    return true;
}

// Editor: jointAcceleration setter
void jointData::Editor::set_jointAcceleration(const yarp::sig::VectorOf<double>& jointAcceleration)
{
    will_set_jointAcceleration();
    obj->jointAcceleration = jointAcceleration;
    mark_dirty_jointAcceleration();
    communicate();
    did_set_jointAcceleration();
}

// Editor: jointAcceleration getter
const yarp::sig::VectorOf<double>& jointData::Editor::get_jointAcceleration() const
{
    return obj->jointAcceleration;
}

// Editor: jointAcceleration will_set
bool jointData::Editor::will_set_jointAcceleration()
{
    return true;
}

// Editor: jointAcceleration did_set
bool jointData::Editor::did_set_jointAcceleration()
{
    return true;
}

// Editor: jointAcceleration_isValid setter
void jointData::Editor::set_jointAcceleration_isValid(const bool jointAcceleration_isValid)
{
    will_set_jointAcceleration_isValid();
    obj->jointAcceleration_isValid = jointAcceleration_isValid;
    mark_dirty_jointAcceleration_isValid();
    communicate();
    did_set_jointAcceleration_isValid();
}

// Editor: jointAcceleration_isValid getter
bool jointData::Editor::get_jointAcceleration_isValid() const
{
    return obj->jointAcceleration_isValid;
}

// Editor: jointAcceleration_isValid will_set
bool jointData::Editor::will_set_jointAcceleration_isValid()
{
    return true;
}

// Editor: jointAcceleration_isValid did_set
bool jointData::Editor::did_set_jointAcceleration_isValid()
{
    return true;
}

// Editor: motorPosition setter
void jointData::Editor::set_motorPosition(const yarp::sig::VectorOf<double>& motorPosition)
{
    will_set_motorPosition();
    obj->motorPosition = motorPosition;
    mark_dirty_motorPosition();
    communicate();
    did_set_motorPosition();
}

// Editor: motorPosition getter
const yarp::sig::VectorOf<double>& jointData::Editor::get_motorPosition() const
{
    return obj->motorPosition;
}

// Editor: motorPosition will_set
bool jointData::Editor::will_set_motorPosition()
{
    return true;
}

// Editor: motorPosition did_set
bool jointData::Editor::did_set_motorPosition()
{
    return true;
}

// Editor: motorPosition_isValid setter
void jointData::Editor::set_motorPosition_isValid(const bool motorPosition_isValid)
{
    will_set_motorPosition_isValid();
    obj->motorPosition_isValid = motorPosition_isValid;
    mark_dirty_motorPosition_isValid();
    communicate();
    did_set_motorPosition_isValid();
}

// Editor: motorPosition_isValid getter
bool jointData::Editor::get_motorPosition_isValid() const
{
    return obj->motorPosition_isValid;
}

// Editor: motorPosition_isValid will_set
bool jointData::Editor::will_set_motorPosition_isValid()
{
    return true;
}

// Editor: motorPosition_isValid did_set
bool jointData::Editor::did_set_motorPosition_isValid()
{
    return true;
}

// Editor: motorVelocity setter
void jointData::Editor::set_motorVelocity(const yarp::sig::VectorOf<double>& motorVelocity)
{
    will_set_motorVelocity();
    obj->motorVelocity = motorVelocity;
    mark_dirty_motorVelocity();
    communicate();
    did_set_motorVelocity();
}

// Editor: motorVelocity getter
const yarp::sig::VectorOf<double>& jointData::Editor::get_motorVelocity() const
{
    return obj->motorVelocity;
}

// Editor: motorVelocity will_set
bool jointData::Editor::will_set_motorVelocity()
{
    return true;
}

// Editor: motorVelocity did_set
bool jointData::Editor::did_set_motorVelocity()
{
    return true;
}

// Editor: motorVelocity_isValid setter
void jointData::Editor::set_motorVelocity_isValid(const bool motorVelocity_isValid)
{
    will_set_motorVelocity_isValid();
    obj->motorVelocity_isValid = motorVelocity_isValid;
    mark_dirty_motorVelocity_isValid();
    communicate();
    did_set_motorVelocity_isValid();
}

// Editor: motorVelocity_isValid getter
bool jointData::Editor::get_motorVelocity_isValid() const
{
    return obj->motorVelocity_isValid;
}

// Editor: motorVelocity_isValid will_set
bool jointData::Editor::will_set_motorVelocity_isValid()
{
    return true;
}

// Editor: motorVelocity_isValid did_set
bool jointData::Editor::did_set_motorVelocity_isValid()
{
    return true;
}

// Editor: motorAcceleration setter
void jointData::Editor::set_motorAcceleration(const yarp::sig::VectorOf<double>& motorAcceleration)
{
    will_set_motorAcceleration();
    obj->motorAcceleration = motorAcceleration;
    mark_dirty_motorAcceleration();
    communicate();
    did_set_motorAcceleration();
}

// Editor: motorAcceleration getter
const yarp::sig::VectorOf<double>& jointData::Editor::get_motorAcceleration() const
{
    return obj->motorAcceleration;
}

// Editor: motorAcceleration will_set
bool jointData::Editor::will_set_motorAcceleration()
{
    return true;
}

// Editor: motorAcceleration did_set
bool jointData::Editor::did_set_motorAcceleration()
{
    return true;
}

// Editor: motorAcceleration_isValid setter
void jointData::Editor::set_motorAcceleration_isValid(const bool motorAcceleration_isValid)
{
    will_set_motorAcceleration_isValid();
    obj->motorAcceleration_isValid = motorAcceleration_isValid;
    mark_dirty_motorAcceleration_isValid();
    communicate();
    did_set_motorAcceleration_isValid();
}

// Editor: motorAcceleration_isValid getter
bool jointData::Editor::get_motorAcceleration_isValid() const
{
    return obj->motorAcceleration_isValid;
}

// Editor: motorAcceleration_isValid will_set
bool jointData::Editor::will_set_motorAcceleration_isValid()
{
    return true;
}

// Editor: motorAcceleration_isValid did_set
bool jointData::Editor::did_set_motorAcceleration_isValid()
{
    return true;
}

// Editor: torque setter
void jointData::Editor::set_torque(const yarp::sig::VectorOf<double>& torque)
{
    will_set_torque();
    obj->torque = torque;
    mark_dirty_torque();
    communicate();
    did_set_torque();
}

// Editor: torque getter
const yarp::sig::VectorOf<double>& jointData::Editor::get_torque() const
{
    return obj->torque;
}

// Editor: torque will_set
bool jointData::Editor::will_set_torque()
{
    return true;
}

// Editor: torque did_set
bool jointData::Editor::did_set_torque()
{
    return true;
}

// Editor: torque_isValid setter
void jointData::Editor::set_torque_isValid(const bool torque_isValid)
{
    will_set_torque_isValid();
    obj->torque_isValid = torque_isValid;
    mark_dirty_torque_isValid();
    communicate();
    did_set_torque_isValid();
}

// Editor: torque_isValid getter
bool jointData::Editor::get_torque_isValid() const
{
    return obj->torque_isValid;
}

// Editor: torque_isValid will_set
bool jointData::Editor::will_set_torque_isValid()
{
    return true;
}

// Editor: torque_isValid did_set
bool jointData::Editor::did_set_torque_isValid()
{
    return true;
}

// Editor: pwmDutycycle setter
void jointData::Editor::set_pwmDutycycle(const yarp::sig::VectorOf<double>& pwmDutycycle)
{
    will_set_pwmDutycycle();
    obj->pwmDutycycle = pwmDutycycle;
    mark_dirty_pwmDutycycle();
    communicate();
    did_set_pwmDutycycle();
}

// Editor: pwmDutycycle getter
const yarp::sig::VectorOf<double>& jointData::Editor::get_pwmDutycycle() const
{
    return obj->pwmDutycycle;
}

// Editor: pwmDutycycle will_set
bool jointData::Editor::will_set_pwmDutycycle()
{
    return true;
}

// Editor: pwmDutycycle did_set
bool jointData::Editor::did_set_pwmDutycycle()
{
    return true;
}

// Editor: pwmDutycycle_isValid setter
void jointData::Editor::set_pwmDutycycle_isValid(const bool pwmDutycycle_isValid)
{
    will_set_pwmDutycycle_isValid();
    obj->pwmDutycycle_isValid = pwmDutycycle_isValid;
    mark_dirty_pwmDutycycle_isValid();
    communicate();
    did_set_pwmDutycycle_isValid();
}

// Editor: pwmDutycycle_isValid getter
bool jointData::Editor::get_pwmDutycycle_isValid() const
{
    return obj->pwmDutycycle_isValid;
}

// Editor: pwmDutycycle_isValid will_set
bool jointData::Editor::will_set_pwmDutycycle_isValid()
{
    return true;
}

// Editor: pwmDutycycle_isValid did_set
bool jointData::Editor::did_set_pwmDutycycle_isValid()
{
    return true;
}

// Editor: current setter
void jointData::Editor::set_current(const yarp::sig::VectorOf<double>& current)
{
    will_set_current();
    obj->current = current;
    mark_dirty_current();
    communicate();
    did_set_current();
}

// Editor: current getter
const yarp::sig::VectorOf<double>& jointData::Editor::get_current() const
{
    return obj->current;
}

// Editor: current will_set
bool jointData::Editor::will_set_current()
{
    return true;
}

// Editor: current did_set
bool jointData::Editor::did_set_current()
{
    return true;
}

// Editor: current_isValid setter
void jointData::Editor::set_current_isValid(const bool current_isValid)
{
    will_set_current_isValid();
    obj->current_isValid = current_isValid;
    mark_dirty_current_isValid();
    communicate();
    did_set_current_isValid();
}

// Editor: current_isValid getter
bool jointData::Editor::get_current_isValid() const
{
    return obj->current_isValid;
}

// Editor: current_isValid will_set
bool jointData::Editor::will_set_current_isValid()
{
    return true;
}

// Editor: current_isValid did_set
bool jointData::Editor::did_set_current_isValid()
{
    return true;
}

// Editor: controlMode setter
void jointData::Editor::set_controlMode(const yarp::sig::VectorOf<int>& controlMode)
{
    will_set_controlMode();
    obj->controlMode = controlMode;
    mark_dirty_controlMode();
    communicate();
    did_set_controlMode();
}

// Editor: controlMode getter
const yarp::sig::VectorOf<int>& jointData::Editor::get_controlMode() const
{
    return obj->controlMode;
}

// Editor: controlMode will_set
bool jointData::Editor::will_set_controlMode()
{
    return true;
}

// Editor: controlMode did_set
bool jointData::Editor::did_set_controlMode()
{
    return true;
}

// Editor: controlMode_isValid setter
void jointData::Editor::set_controlMode_isValid(const bool controlMode_isValid)
{
    will_set_controlMode_isValid();
    obj->controlMode_isValid = controlMode_isValid;
    mark_dirty_controlMode_isValid();
    communicate();
    did_set_controlMode_isValid();
}

// Editor: controlMode_isValid getter
bool jointData::Editor::get_controlMode_isValid() const
{
    return obj->controlMode_isValid;
}

// Editor: controlMode_isValid will_set
bool jointData::Editor::will_set_controlMode_isValid()
{
    return true;
}

// Editor: controlMode_isValid did_set
bool jointData::Editor::did_set_controlMode_isValid()
{
    return true;
}

// Editor: interactionMode setter
void jointData::Editor::set_interactionMode(const yarp::sig::VectorOf<int>& interactionMode)
{
    will_set_interactionMode();
    obj->interactionMode = interactionMode;
    mark_dirty_interactionMode();
    communicate();
    did_set_interactionMode();
}

// Editor: interactionMode getter
const yarp::sig::VectorOf<int>& jointData::Editor::get_interactionMode() const
{
    return obj->interactionMode;
}

// Editor: interactionMode will_set
bool jointData::Editor::will_set_interactionMode()
{
    return true;
}

// Editor: interactionMode did_set
bool jointData::Editor::did_set_interactionMode()
{
    return true;
}

// Editor: interactionMode_isValid setter
void jointData::Editor::set_interactionMode_isValid(const bool interactionMode_isValid)
{
    will_set_interactionMode_isValid();
    obj->interactionMode_isValid = interactionMode_isValid;
    mark_dirty_interactionMode_isValid();
    communicate();
    did_set_interactionMode_isValid();
}

// Editor: interactionMode_isValid getter
bool jointData::Editor::get_interactionMode_isValid() const
{
    return obj->interactionMode_isValid;
}

// Editor: interactionMode_isValid will_set
bool jointData::Editor::will_set_interactionMode_isValid()
{
    return true;
}

// Editor: interactionMode_isValid did_set
bool jointData::Editor::did_set_interactionMode_isValid()
{
    return true;
}

// Editor: clean
void jointData::Editor::clean()
{
    dirty_flags(false);
}

// Editor: read
bool jointData::Editor::read(yarp::os::ConnectionReader& connection)
{
    if (!isValid()) {
        return false;
    }
    yarp::os::idl::WireReader reader(connection);
    reader.expectAccept();
    if (!reader.readListHeader()) {
        return false;
    }
    int len = reader.getLength();
    if (len == 0) {
        yarp::os::idl::WireWriter writer(reader);
        if (writer.isNull()) {
            return true;
        }
        if (!writer.writeListHeader(1)) {
            return false;
        }
        writer.writeString("send: 'help' or 'patch (param1 val1) (param2 val2)'");
        return true;
    }
    std::string tag;
    if (!reader.readString(tag)) {
        return false;
    }
    if (tag == "help") {
        yarp::os::idl::WireWriter writer(reader);
        if (writer.isNull()) {
            return true;
        }
        if (!writer.writeListHeader(2)) {
            return false;
        }
        if (!writer.writeTag("many", 1, 0)) {
            return false;
        }
        if (reader.getLength() > 0) {
            std::string field;
            if (!reader.readString(field)) {
                return false;
            }
            if (field == "jointPosition") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("yarp::sig::VectorOf<double> jointPosition")) {
                    return false;
                }
            }
            if (field == "jointPosition_isValid") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("bool jointPosition_isValid")) {
                    return false;
                }
            }
            if (field == "jointVelocity") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("yarp::sig::VectorOf<double> jointVelocity")) {
                    return false;
                }
            }
            if (field == "jointVelocity_isValid") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("bool jointVelocity_isValid")) {
                    return false;
                }
            }
            if (field == "jointAcceleration") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("yarp::sig::VectorOf<double> jointAcceleration")) {
                    return false;
                }
            }
            if (field == "jointAcceleration_isValid") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("bool jointAcceleration_isValid")) {
                    return false;
                }
            }
            if (field == "motorPosition") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("yarp::sig::VectorOf<double> motorPosition")) {
                    return false;
                }
            }
            if (field == "motorPosition_isValid") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("bool motorPosition_isValid")) {
                    return false;
                }
            }
            if (field == "motorVelocity") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("yarp::sig::VectorOf<double> motorVelocity")) {
                    return false;
                }
            }
            if (field == "motorVelocity_isValid") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("bool motorVelocity_isValid")) {
                    return false;
                }
            }
            if (field == "motorAcceleration") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("yarp::sig::VectorOf<double> motorAcceleration")) {
                    return false;
                }
            }
            if (field == "motorAcceleration_isValid") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("bool motorAcceleration_isValid")) {
                    return false;
                }
            }
            if (field == "torque") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("yarp::sig::VectorOf<double> torque")) {
                    return false;
                }
            }
            if (field == "torque_isValid") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("bool torque_isValid")) {
                    return false;
                }
            }
            if (field == "pwmDutycycle") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("yarp::sig::VectorOf<double> pwmDutycycle")) {
                    return false;
                }
            }
            if (field == "pwmDutycycle_isValid") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("bool pwmDutycycle_isValid")) {
                    return false;
                }
            }
            if (field == "current") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("yarp::sig::VectorOf<double> current")) {
                    return false;
                }
            }
            if (field == "current_isValid") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("bool current_isValid")) {
                    return false;
                }
            }
            if (field == "controlMode") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("yarp::sig::VectorOf<int> controlMode")) {
                    return false;
                }
            }
            if (field == "controlMode_isValid") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("bool controlMode_isValid")) {
                    return false;
                }
            }
            if (field == "interactionMode") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("yarp::sig::VectorOf<int> interactionMode")) {
                    return false;
                }
            }
            if (field == "interactionMode_isValid") {
                if (!writer.writeListHeader(1)) {
                    return false;
                }
                if (!writer.writeString("bool interactionMode_isValid")) {
                    return false;
                }
            }
        }
        if (!writer.writeListHeader(23)) {
            return false;
        }
        writer.writeString("*** Available fields:");
        writer.writeString("jointPosition");
        writer.writeString("jointPosition_isValid");
        writer.writeString("jointVelocity");
        writer.writeString("jointVelocity_isValid");
        writer.writeString("jointAcceleration");
        writer.writeString("jointAcceleration_isValid");
        writer.writeString("motorPosition");
        writer.writeString("motorPosition_isValid");
        writer.writeString("motorVelocity");
        writer.writeString("motorVelocity_isValid");
        writer.writeString("motorAcceleration");
        writer.writeString("motorAcceleration_isValid");
        writer.writeString("torque");
        writer.writeString("torque_isValid");
        writer.writeString("pwmDutycycle");
        writer.writeString("pwmDutycycle_isValid");
        writer.writeString("current");
        writer.writeString("current_isValid");
        writer.writeString("controlMode");
        writer.writeString("controlMode_isValid");
        writer.writeString("interactionMode");
        writer.writeString("interactionMode_isValid");
        return true;
    }
    bool nested = true;
    bool have_act = false;
    if (tag != "patch") {
        if (((len - 1) % 2) != 0) {
            return false;
        }
        len = 1 + ((len - 1) / 2);
        nested = false;
        have_act = true;
    }
    for (int i = 1; i < len; ++i) {
        if (nested && !reader.readListHeader(3)) {
            return false;
        }
        std::string act;
        std::string key;
        if (have_act) {
            act = tag;
        } else if (!reader.readString(act)) {
            return false;
        }
        if (!reader.readString(key)) {
            return false;
        }
        if (key == "jointPosition") {
            will_set_jointPosition();
            if (!obj->nested_read_jointPosition(reader)) {
                return false;
            }
            did_set_jointPosition();
        } else if (key == "jointPosition_isValid") {
            will_set_jointPosition_isValid();
            if (!obj->nested_read_jointPosition_isValid(reader)) {
                return false;
            }
            did_set_jointPosition_isValid();
        } else if (key == "jointVelocity") {
            will_set_jointVelocity();
            if (!obj->nested_read_jointVelocity(reader)) {
                return false;
            }
            did_set_jointVelocity();
        } else if (key == "jointVelocity_isValid") {
            will_set_jointVelocity_isValid();
            if (!obj->nested_read_jointVelocity_isValid(reader)) {
                return false;
            }
            did_set_jointVelocity_isValid();
        } else if (key == "jointAcceleration") {
            will_set_jointAcceleration();
            if (!obj->nested_read_jointAcceleration(reader)) {
                return false;
            }
            did_set_jointAcceleration();
        } else if (key == "jointAcceleration_isValid") {
            will_set_jointAcceleration_isValid();
            if (!obj->nested_read_jointAcceleration_isValid(reader)) {
                return false;
            }
            did_set_jointAcceleration_isValid();
        } else if (key == "motorPosition") {
            will_set_motorPosition();
            if (!obj->nested_read_motorPosition(reader)) {
                return false;
            }
            did_set_motorPosition();
        } else if (key == "motorPosition_isValid") {
            will_set_motorPosition_isValid();
            if (!obj->nested_read_motorPosition_isValid(reader)) {
                return false;
            }
            did_set_motorPosition_isValid();
        } else if (key == "motorVelocity") {
            will_set_motorVelocity();
            if (!obj->nested_read_motorVelocity(reader)) {
                return false;
            }
            did_set_motorVelocity();
        } else if (key == "motorVelocity_isValid") {
            will_set_motorVelocity_isValid();
            if (!obj->nested_read_motorVelocity_isValid(reader)) {
                return false;
            }
            did_set_motorVelocity_isValid();
        } else if (key == "motorAcceleration") {
            will_set_motorAcceleration();
            if (!obj->nested_read_motorAcceleration(reader)) {
                return false;
            }
            did_set_motorAcceleration();
        } else if (key == "motorAcceleration_isValid") {
            will_set_motorAcceleration_isValid();
            if (!obj->nested_read_motorAcceleration_isValid(reader)) {
                return false;
            }
            did_set_motorAcceleration_isValid();
        } else if (key == "torque") {
            will_set_torque();
            if (!obj->nested_read_torque(reader)) {
                return false;
            }
            did_set_torque();
        } else if (key == "torque_isValid") {
            will_set_torque_isValid();
            if (!obj->nested_read_torque_isValid(reader)) {
                return false;
            }
            did_set_torque_isValid();
        } else if (key == "pwmDutycycle") {
            will_set_pwmDutycycle();
            if (!obj->nested_read_pwmDutycycle(reader)) {
                return false;
            }
            did_set_pwmDutycycle();
        } else if (key == "pwmDutycycle_isValid") {
            will_set_pwmDutycycle_isValid();
            if (!obj->nested_read_pwmDutycycle_isValid(reader)) {
                return false;
            }
            did_set_pwmDutycycle_isValid();
        } else if (key == "current") {
            will_set_current();
            if (!obj->nested_read_current(reader)) {
                return false;
            }
            did_set_current();
        } else if (key == "current_isValid") {
            will_set_current_isValid();
            if (!obj->nested_read_current_isValid(reader)) {
                return false;
            }
            did_set_current_isValid();
        } else if (key == "controlMode") {
            will_set_controlMode();
            if (!obj->nested_read_controlMode(reader)) {
                return false;
            }
            did_set_controlMode();
        } else if (key == "controlMode_isValid") {
            will_set_controlMode_isValid();
            if (!obj->nested_read_controlMode_isValid(reader)) {
                return false;
            }
            did_set_controlMode_isValid();
        } else if (key == "interactionMode") {
            will_set_interactionMode();
            if (!obj->nested_read_interactionMode(reader)) {
                return false;
            }
            did_set_interactionMode();
        } else if (key == "interactionMode_isValid") {
            will_set_interactionMode_isValid();
            if (!obj->nested_read_interactionMode_isValid(reader)) {
                return false;
            }
            did_set_interactionMode_isValid();
        } else {
            // would be useful to have a fallback here
        }
    }
    reader.accept();
    yarp::os::idl::WireWriter writer(reader);
    if (writer.isNull()) {
        return true;
    }
    writer.writeListHeader(1);
    writer.writeVocab32('o', 'k');
    return true;
}

// Editor: write
bool jointData::Editor::write(yarp::os::ConnectionWriter& connection) const
{
    if (!isValid()) {
        return false;
    }
    yarp::os::idl::WireWriter writer(connection);
    if (!writer.writeListHeader(dirty_count + 1)) {
        return false;
    }
    if (!writer.writeString("patch")) {
        return false;
    }
    if (is_dirty_jointPosition) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("jointPosition")) {
            return false;
        }
        if (!obj->nested_write_jointPosition(writer)) {
            return false;
        }
    }
    if (is_dirty_jointPosition_isValid) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("jointPosition_isValid")) {
            return false;
        }
        if (!obj->nested_write_jointPosition_isValid(writer)) {
            return false;
        }
    }
    if (is_dirty_jointVelocity) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("jointVelocity")) {
            return false;
        }
        if (!obj->nested_write_jointVelocity(writer)) {
            return false;
        }
    }
    if (is_dirty_jointVelocity_isValid) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("jointVelocity_isValid")) {
            return false;
        }
        if (!obj->nested_write_jointVelocity_isValid(writer)) {
            return false;
        }
    }
    if (is_dirty_jointAcceleration) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("jointAcceleration")) {
            return false;
        }
        if (!obj->nested_write_jointAcceleration(writer)) {
            return false;
        }
    }
    if (is_dirty_jointAcceleration_isValid) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("jointAcceleration_isValid")) {
            return false;
        }
        if (!obj->nested_write_jointAcceleration_isValid(writer)) {
            return false;
        }
    }
    if (is_dirty_motorPosition) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("motorPosition")) {
            return false;
        }
        if (!obj->nested_write_motorPosition(writer)) {
            return false;
        }
    }
    if (is_dirty_motorPosition_isValid) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("motorPosition_isValid")) {
            return false;
        }
        if (!obj->nested_write_motorPosition_isValid(writer)) {
            return false;
        }
    }
    if (is_dirty_motorVelocity) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("motorVelocity")) {
            return false;
        }
        if (!obj->nested_write_motorVelocity(writer)) {
            return false;
        }
    }
    if (is_dirty_motorVelocity_isValid) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("motorVelocity_isValid")) {
            return false;
        }
        if (!obj->nested_write_motorVelocity_isValid(writer)) {
            return false;
        }
    }
    if (is_dirty_motorAcceleration) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("motorAcceleration")) {
            return false;
        }
        if (!obj->nested_write_motorAcceleration(writer)) {
            return false;
        }
    }
    if (is_dirty_motorAcceleration_isValid) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("motorAcceleration_isValid")) {
            return false;
        }
        if (!obj->nested_write_motorAcceleration_isValid(writer)) {
            return false;
        }
    }
    if (is_dirty_torque) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("torque")) {
            return false;
        }
        if (!obj->nested_write_torque(writer)) {
            return false;
        }
    }
    if (is_dirty_torque_isValid) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("torque_isValid")) {
            return false;
        }
        if (!obj->nested_write_torque_isValid(writer)) {
            return false;
        }
    }
    if (is_dirty_pwmDutycycle) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("pwmDutycycle")) {
            return false;
        }
        if (!obj->nested_write_pwmDutycycle(writer)) {
            return false;
        }
    }
    if (is_dirty_pwmDutycycle_isValid) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("pwmDutycycle_isValid")) {
            return false;
        }
        if (!obj->nested_write_pwmDutycycle_isValid(writer)) {
            return false;
        }
    }
    if (is_dirty_current) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("current")) {
            return false;
        }
        if (!obj->nested_write_current(writer)) {
            return false;
        }
    }
    if (is_dirty_current_isValid) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("current_isValid")) {
            return false;
        }
        if (!obj->nested_write_current_isValid(writer)) {
            return false;
        }
    }
    if (is_dirty_controlMode) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("controlMode")) {
            return false;
        }
        if (!obj->nested_write_controlMode(writer)) {
            return false;
        }
    }
    if (is_dirty_controlMode_isValid) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("controlMode_isValid")) {
            return false;
        }
        if (!obj->nested_write_controlMode_isValid(writer)) {
            return false;
        }
    }
    if (is_dirty_interactionMode) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("interactionMode")) {
            return false;
        }
        if (!obj->nested_write_interactionMode(writer)) {
            return false;
        }
    }
    if (is_dirty_interactionMode_isValid) {
        if (!writer.writeListHeader(3)) {
            return false;
        }
        if (!writer.writeString("set")) {
            return false;
        }
        if (!writer.writeString("interactionMode_isValid")) {
            return false;
        }
        if (!obj->nested_write_interactionMode_isValid(writer)) {
            return false;
        }
    }
    return !writer.isError();
}

// Editor: send if possible
void jointData::Editor::communicate()
{
    if (group != 0) {
        return;
    }
    if (yarp().canWrite()) {
        yarp().write(*this);
        clean();
    }
}

// Editor: mark dirty overall
void jointData::Editor::mark_dirty()
{
    is_dirty = true;
}

// Editor: jointPosition mark_dirty
void jointData::Editor::mark_dirty_jointPosition()
{
    if (is_dirty_jointPosition) {
        return;
    }
    dirty_count++;
    is_dirty_jointPosition = true;
    mark_dirty();
}

// Editor: jointPosition_isValid mark_dirty
void jointData::Editor::mark_dirty_jointPosition_isValid()
{
    if (is_dirty_jointPosition_isValid) {
        return;
    }
    dirty_count++;
    is_dirty_jointPosition_isValid = true;
    mark_dirty();
}

// Editor: jointVelocity mark_dirty
void jointData::Editor::mark_dirty_jointVelocity()
{
    if (is_dirty_jointVelocity) {
        return;
    }
    dirty_count++;
    is_dirty_jointVelocity = true;
    mark_dirty();
}

// Editor: jointVelocity_isValid mark_dirty
void jointData::Editor::mark_dirty_jointVelocity_isValid()
{
    if (is_dirty_jointVelocity_isValid) {
        return;
    }
    dirty_count++;
    is_dirty_jointVelocity_isValid = true;
    mark_dirty();
}

// Editor: jointAcceleration mark_dirty
void jointData::Editor::mark_dirty_jointAcceleration()
{
    if (is_dirty_jointAcceleration) {
        return;
    }
    dirty_count++;
    is_dirty_jointAcceleration = true;
    mark_dirty();
}

// Editor: jointAcceleration_isValid mark_dirty
void jointData::Editor::mark_dirty_jointAcceleration_isValid()
{
    if (is_dirty_jointAcceleration_isValid) {
        return;
    }
    dirty_count++;
    is_dirty_jointAcceleration_isValid = true;
    mark_dirty();
}

// Editor: motorPosition mark_dirty
void jointData::Editor::mark_dirty_motorPosition()
{
    if (is_dirty_motorPosition) {
        return;
    }
    dirty_count++;
    is_dirty_motorPosition = true;
    mark_dirty();
}

// Editor: motorPosition_isValid mark_dirty
void jointData::Editor::mark_dirty_motorPosition_isValid()
{
    if (is_dirty_motorPosition_isValid) {
        return;
    }
    dirty_count++;
    is_dirty_motorPosition_isValid = true;
    mark_dirty();
}

// Editor: motorVelocity mark_dirty
void jointData::Editor::mark_dirty_motorVelocity()
{
    if (is_dirty_motorVelocity) {
        return;
    }
    dirty_count++;
    is_dirty_motorVelocity = true;
    mark_dirty();
}

// Editor: motorVelocity_isValid mark_dirty
void jointData::Editor::mark_dirty_motorVelocity_isValid()
{
    if (is_dirty_motorVelocity_isValid) {
        return;
    }
    dirty_count++;
    is_dirty_motorVelocity_isValid = true;
    mark_dirty();
}

// Editor: motorAcceleration mark_dirty
void jointData::Editor::mark_dirty_motorAcceleration()
{
    if (is_dirty_motorAcceleration) {
        return;
    }
    dirty_count++;
    is_dirty_motorAcceleration = true;
    mark_dirty();
}

// Editor: motorAcceleration_isValid mark_dirty
void jointData::Editor::mark_dirty_motorAcceleration_isValid()
{
    if (is_dirty_motorAcceleration_isValid) {
        return;
    }
    dirty_count++;
    is_dirty_motorAcceleration_isValid = true;
    mark_dirty();
}

// Editor: torque mark_dirty
void jointData::Editor::mark_dirty_torque()
{
    if (is_dirty_torque) {
        return;
    }
    dirty_count++;
    is_dirty_torque = true;
    mark_dirty();
}

// Editor: torque_isValid mark_dirty
void jointData::Editor::mark_dirty_torque_isValid()
{
    if (is_dirty_torque_isValid) {
        return;
    }
    dirty_count++;
    is_dirty_torque_isValid = true;
    mark_dirty();
}

// Editor: pwmDutycycle mark_dirty
void jointData::Editor::mark_dirty_pwmDutycycle()
{
    if (is_dirty_pwmDutycycle) {
        return;
    }
    dirty_count++;
    is_dirty_pwmDutycycle = true;
    mark_dirty();
}

// Editor: pwmDutycycle_isValid mark_dirty
void jointData::Editor::mark_dirty_pwmDutycycle_isValid()
{
    if (is_dirty_pwmDutycycle_isValid) {
        return;
    }
    dirty_count++;
    is_dirty_pwmDutycycle_isValid = true;
    mark_dirty();
}

// Editor: current mark_dirty
void jointData::Editor::mark_dirty_current()
{
    if (is_dirty_current) {
        return;
    }
    dirty_count++;
    is_dirty_current = true;
    mark_dirty();
}

// Editor: current_isValid mark_dirty
void jointData::Editor::mark_dirty_current_isValid()
{
    if (is_dirty_current_isValid) {
        return;
    }
    dirty_count++;
    is_dirty_current_isValid = true;
    mark_dirty();
}

// Editor: controlMode mark_dirty
void jointData::Editor::mark_dirty_controlMode()
{
    if (is_dirty_controlMode) {
        return;
    }
    dirty_count++;
    is_dirty_controlMode = true;
    mark_dirty();
}

// Editor: controlMode_isValid mark_dirty
void jointData::Editor::mark_dirty_controlMode_isValid()
{
    if (is_dirty_controlMode_isValid) {
        return;
    }
    dirty_count++;
    is_dirty_controlMode_isValid = true;
    mark_dirty();
}

// Editor: interactionMode mark_dirty
void jointData::Editor::mark_dirty_interactionMode()
{
    if (is_dirty_interactionMode) {
        return;
    }
    dirty_count++;
    is_dirty_interactionMode = true;
    mark_dirty();
}

// Editor: interactionMode_isValid mark_dirty
void jointData::Editor::mark_dirty_interactionMode_isValid()
{
    if (is_dirty_interactionMode_isValid) {
        return;
    }
    dirty_count++;
    is_dirty_interactionMode_isValid = true;
    mark_dirty();
}

// Editor: dirty_flags
void jointData::Editor::dirty_flags(bool flag)
{
    is_dirty = flag;
    is_dirty_jointPosition = flag;
    is_dirty_jointPosition_isValid = flag;
    is_dirty_jointVelocity = flag;
    is_dirty_jointVelocity_isValid = flag;
    is_dirty_jointAcceleration = flag;
    is_dirty_jointAcceleration_isValid = flag;
    is_dirty_motorPosition = flag;
    is_dirty_motorPosition_isValid = flag;
    is_dirty_motorVelocity = flag;
    is_dirty_motorVelocity_isValid = flag;
    is_dirty_motorAcceleration = flag;
    is_dirty_motorAcceleration_isValid = flag;
    is_dirty_torque = flag;
    is_dirty_torque_isValid = flag;
    is_dirty_pwmDutycycle = flag;
    is_dirty_pwmDutycycle_isValid = flag;
    is_dirty_current = flag;
    is_dirty_current_isValid = flag;
    is_dirty_controlMode = flag;
    is_dirty_controlMode_isValid = flag;
    is_dirty_interactionMode = flag;
    is_dirty_interactionMode_isValid = flag;
    dirty_count = flag ? 22 : 0;
}

// read jointPosition field
bool jointData::read_jointPosition(yarp::os::idl::WireReader& reader)
{
    if (!reader.read(jointPosition)) {
        reader.fail();
        return false;
    }
    return true;
}

// write jointPosition field
bool jointData::write_jointPosition(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.write(jointPosition)) {
        return false;
    }
    return true;
}

// read (nested) jointPosition field
bool jointData::nested_read_jointPosition(yarp::os::idl::WireReader& reader)
{
    if (!reader.readNested(jointPosition)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) jointPosition field
bool jointData::nested_write_jointPosition(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeNested(jointPosition)) {
        return false;
    }
    return true;
}

// read jointPosition_isValid field
bool jointData::read_jointPosition_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(jointPosition_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write jointPosition_isValid field
bool jointData::write_jointPosition_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(jointPosition_isValid)) {
        return false;
    }
    return true;
}

// read (nested) jointPosition_isValid field
bool jointData::nested_read_jointPosition_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(jointPosition_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) jointPosition_isValid field
bool jointData::nested_write_jointPosition_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(jointPosition_isValid)) {
        return false;
    }
    return true;
}

// read jointVelocity field
bool jointData::read_jointVelocity(yarp::os::idl::WireReader& reader)
{
    if (!reader.read(jointVelocity)) {
        reader.fail();
        return false;
    }
    return true;
}

// write jointVelocity field
bool jointData::write_jointVelocity(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.write(jointVelocity)) {
        return false;
    }
    return true;
}

// read (nested) jointVelocity field
bool jointData::nested_read_jointVelocity(yarp::os::idl::WireReader& reader)
{
    if (!reader.readNested(jointVelocity)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) jointVelocity field
bool jointData::nested_write_jointVelocity(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeNested(jointVelocity)) {
        return false;
    }
    return true;
}

// read jointVelocity_isValid field
bool jointData::read_jointVelocity_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(jointVelocity_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write jointVelocity_isValid field
bool jointData::write_jointVelocity_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(jointVelocity_isValid)) {
        return false;
    }
    return true;
}

// read (nested) jointVelocity_isValid field
bool jointData::nested_read_jointVelocity_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(jointVelocity_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) jointVelocity_isValid field
bool jointData::nested_write_jointVelocity_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(jointVelocity_isValid)) {
        return false;
    }
    return true;
}

// read jointAcceleration field
bool jointData::read_jointAcceleration(yarp::os::idl::WireReader& reader)
{
    if (!reader.read(jointAcceleration)) {
        reader.fail();
        return false;
    }
    return true;
}

// write jointAcceleration field
bool jointData::write_jointAcceleration(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.write(jointAcceleration)) {
        return false;
    }
    return true;
}

// read (nested) jointAcceleration field
bool jointData::nested_read_jointAcceleration(yarp::os::idl::WireReader& reader)
{
    if (!reader.readNested(jointAcceleration)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) jointAcceleration field
bool jointData::nested_write_jointAcceleration(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeNested(jointAcceleration)) {
        return false;
    }
    return true;
}

// read jointAcceleration_isValid field
bool jointData::read_jointAcceleration_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(jointAcceleration_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write jointAcceleration_isValid field
bool jointData::write_jointAcceleration_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(jointAcceleration_isValid)) {
        return false;
    }
    return true;
}

// read (nested) jointAcceleration_isValid field
bool jointData::nested_read_jointAcceleration_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(jointAcceleration_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) jointAcceleration_isValid field
bool jointData::nested_write_jointAcceleration_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(jointAcceleration_isValid)) {
        return false;
    }
    return true;
}

// read motorPosition field
bool jointData::read_motorPosition(yarp::os::idl::WireReader& reader)
{
    if (!reader.read(motorPosition)) {
        reader.fail();
        return false;
    }
    return true;
}

// write motorPosition field
bool jointData::write_motorPosition(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.write(motorPosition)) {
        return false;
    }
    return true;
}

// read (nested) motorPosition field
bool jointData::nested_read_motorPosition(yarp::os::idl::WireReader& reader)
{
    if (!reader.readNested(motorPosition)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) motorPosition field
bool jointData::nested_write_motorPosition(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeNested(motorPosition)) {
        return false;
    }
    return true;
}

// read motorPosition_isValid field
bool jointData::read_motorPosition_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(motorPosition_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write motorPosition_isValid field
bool jointData::write_motorPosition_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(motorPosition_isValid)) {
        return false;
    }
    return true;
}

// read (nested) motorPosition_isValid field
bool jointData::nested_read_motorPosition_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(motorPosition_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) motorPosition_isValid field
bool jointData::nested_write_motorPosition_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(motorPosition_isValid)) {
        return false;
    }
    return true;
}

// read motorVelocity field
bool jointData::read_motorVelocity(yarp::os::idl::WireReader& reader)
{
    if (!reader.read(motorVelocity)) {
        reader.fail();
        return false;
    }
    return true;
}

// write motorVelocity field
bool jointData::write_motorVelocity(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.write(motorVelocity)) {
        return false;
    }
    return true;
}

// read (nested) motorVelocity field
bool jointData::nested_read_motorVelocity(yarp::os::idl::WireReader& reader)
{
    if (!reader.readNested(motorVelocity)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) motorVelocity field
bool jointData::nested_write_motorVelocity(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeNested(motorVelocity)) {
        return false;
    }
    return true;
}

// read motorVelocity_isValid field
bool jointData::read_motorVelocity_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(motorVelocity_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write motorVelocity_isValid field
bool jointData::write_motorVelocity_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(motorVelocity_isValid)) {
        return false;
    }
    return true;
}

// read (nested) motorVelocity_isValid field
bool jointData::nested_read_motorVelocity_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(motorVelocity_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) motorVelocity_isValid field
bool jointData::nested_write_motorVelocity_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(motorVelocity_isValid)) {
        return false;
    }
    return true;
}

// read motorAcceleration field
bool jointData::read_motorAcceleration(yarp::os::idl::WireReader& reader)
{
    if (!reader.read(motorAcceleration)) {
        reader.fail();
        return false;
    }
    return true;
}

// write motorAcceleration field
bool jointData::write_motorAcceleration(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.write(motorAcceleration)) {
        return false;
    }
    return true;
}

// read (nested) motorAcceleration field
bool jointData::nested_read_motorAcceleration(yarp::os::idl::WireReader& reader)
{
    if (!reader.readNested(motorAcceleration)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) motorAcceleration field
bool jointData::nested_write_motorAcceleration(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeNested(motorAcceleration)) {
        return false;
    }
    return true;
}

// read motorAcceleration_isValid field
bool jointData::read_motorAcceleration_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(motorAcceleration_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write motorAcceleration_isValid field
bool jointData::write_motorAcceleration_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(motorAcceleration_isValid)) {
        return false;
    }
    return true;
}

// read (nested) motorAcceleration_isValid field
bool jointData::nested_read_motorAcceleration_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(motorAcceleration_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) motorAcceleration_isValid field
bool jointData::nested_write_motorAcceleration_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(motorAcceleration_isValid)) {
        return false;
    }
    return true;
}

// read torque field
bool jointData::read_torque(yarp::os::idl::WireReader& reader)
{
    if (!reader.read(torque)) {
        reader.fail();
        return false;
    }
    return true;
}

// write torque field
bool jointData::write_torque(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.write(torque)) {
        return false;
    }
    return true;
}

// read (nested) torque field
bool jointData::nested_read_torque(yarp::os::idl::WireReader& reader)
{
    if (!reader.readNested(torque)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) torque field
bool jointData::nested_write_torque(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeNested(torque)) {
        return false;
    }
    return true;
}

// read torque_isValid field
bool jointData::read_torque_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(torque_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write torque_isValid field
bool jointData::write_torque_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(torque_isValid)) {
        return false;
    }
    return true;
}

// read (nested) torque_isValid field
bool jointData::nested_read_torque_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(torque_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) torque_isValid field
bool jointData::nested_write_torque_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(torque_isValid)) {
        return false;
    }
    return true;
}

// read pwmDutycycle field
bool jointData::read_pwmDutycycle(yarp::os::idl::WireReader& reader)
{
    if (!reader.read(pwmDutycycle)) {
        reader.fail();
        return false;
    }
    return true;
}

// write pwmDutycycle field
bool jointData::write_pwmDutycycle(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.write(pwmDutycycle)) {
        return false;
    }
    return true;
}

// read (nested) pwmDutycycle field
bool jointData::nested_read_pwmDutycycle(yarp::os::idl::WireReader& reader)
{
    if (!reader.readNested(pwmDutycycle)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) pwmDutycycle field
bool jointData::nested_write_pwmDutycycle(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeNested(pwmDutycycle)) {
        return false;
    }
    return true;
}

// read pwmDutycycle_isValid field
bool jointData::read_pwmDutycycle_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(pwmDutycycle_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write pwmDutycycle_isValid field
bool jointData::write_pwmDutycycle_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(pwmDutycycle_isValid)) {
        return false;
    }
    return true;
}

// read (nested) pwmDutycycle_isValid field
bool jointData::nested_read_pwmDutycycle_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(pwmDutycycle_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) pwmDutycycle_isValid field
bool jointData::nested_write_pwmDutycycle_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(pwmDutycycle_isValid)) {
        return false;
    }
    return true;
}

// read current field
bool jointData::read_current(yarp::os::idl::WireReader& reader)
{
    if (!reader.read(current)) {
        reader.fail();
        return false;
    }
    return true;
}

// write current field
bool jointData::write_current(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.write(current)) {
        return false;
    }
    return true;
}

// read (nested) current field
bool jointData::nested_read_current(yarp::os::idl::WireReader& reader)
{
    if (!reader.readNested(current)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) current field
bool jointData::nested_write_current(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeNested(current)) {
        return false;
    }
    return true;
}

// read current_isValid field
bool jointData::read_current_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(current_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write current_isValid field
bool jointData::write_current_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(current_isValid)) {
        return false;
    }
    return true;
}

// read (nested) current_isValid field
bool jointData::nested_read_current_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(current_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) current_isValid field
bool jointData::nested_write_current_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(current_isValid)) {
        return false;
    }
    return true;
}

// read controlMode field
bool jointData::read_controlMode(yarp::os::idl::WireReader& reader)
{
    if (!reader.read(controlMode)) {
        reader.fail();
        return false;
    }
    return true;
}

// write controlMode field
bool jointData::write_controlMode(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.write(controlMode)) {
        return false;
    }
    return true;
}

// read (nested) controlMode field
bool jointData::nested_read_controlMode(yarp::os::idl::WireReader& reader)
{
    if (!reader.readNested(controlMode)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) controlMode field
bool jointData::nested_write_controlMode(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeNested(controlMode)) {
        return false;
    }
    return true;
}

// read controlMode_isValid field
bool jointData::read_controlMode_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(controlMode_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write controlMode_isValid field
bool jointData::write_controlMode_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(controlMode_isValid)) {
        return false;
    }
    return true;
}

// read (nested) controlMode_isValid field
bool jointData::nested_read_controlMode_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(controlMode_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) controlMode_isValid field
bool jointData::nested_write_controlMode_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(controlMode_isValid)) {
        return false;
    }
    return true;
}

// read interactionMode field
bool jointData::read_interactionMode(yarp::os::idl::WireReader& reader)
{
    if (!reader.read(interactionMode)) {
        reader.fail();
        return false;
    }
    return true;
}

// write interactionMode field
bool jointData::write_interactionMode(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.write(interactionMode)) {
        return false;
    }
    return true;
}

// read (nested) interactionMode field
bool jointData::nested_read_interactionMode(yarp::os::idl::WireReader& reader)
{
    if (!reader.readNested(interactionMode)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) interactionMode field
bool jointData::nested_write_interactionMode(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeNested(interactionMode)) {
        return false;
    }
    return true;
}

// read interactionMode_isValid field
bool jointData::read_interactionMode_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(interactionMode_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write interactionMode_isValid field
bool jointData::write_interactionMode_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(interactionMode_isValid)) {
        return false;
    }
    return true;
}

// read (nested) interactionMode_isValid field
bool jointData::nested_read_interactionMode_isValid(yarp::os::idl::WireReader& reader)
{
    if (!reader.readBool(interactionMode_isValid)) {
        reader.fail();
        return false;
    }
    return true;
}

// write (nested) interactionMode_isValid field
bool jointData::nested_write_interactionMode_isValid(const yarp::os::idl::WireWriter& writer) const
{
    if (!writer.writeBool(interactionMode_isValid)) {
        return false;
    }
    return true;
}

} // namespace yarp
} // namespace dev
} // namespace impl
