4 #ifndef YARP_THRIFT_GENERATOR_STRUCT_PointXYZ 5 #define YARP_THRIFT_GENERATOR_STRUCT_PointXYZ 7 #include <yarp/os/Wire.h> 8 #include <yarp/os/idl/WireTypes.h> 17 class iCub::data3D::PointXYZ :
public yarp::os::idl::WirePortable {
25 PointXYZ() : x(0), y(0), z(0) {
29 PointXYZ(
const double x,
const double y,
const double z) : x(x), y(y), z(z) {
33 PointXYZ(
const PointXYZ& __alt) : WirePortable(__alt) {
40 const PointXYZ& operator = (
const PointXYZ& __alt) {
48 bool read(yarp::os::idl::WireReader& reader);
49 bool read(yarp::os::ConnectionReader& connection);
50 bool write(yarp::os::idl::WireWriter& writer);
51 bool write(yarp::os::ConnectionWriter& connection);
54 bool write_x(yarp::os::idl::WireWriter& writer);
55 bool nested_write_x(yarp::os::idl::WireWriter& writer);
56 bool write_y(yarp::os::idl::WireWriter& writer);
57 bool nested_write_y(yarp::os::idl::WireWriter& writer);
58 bool write_z(yarp::os::idl::WireWriter& writer);
59 bool nested_write_z(yarp::os::idl::WireWriter& writer);
60 bool read_x(yarp::os::idl::WireReader& reader);
61 bool nested_read_x(yarp::os::idl::WireReader& reader);
62 bool read_y(yarp::os::idl::WireReader& reader);
63 bool nested_read_y(yarp::os::idl::WireReader& reader);
64 bool read_z(yarp::os::idl::WireReader& reader);
65 bool nested_read_z(yarp::os::idl::WireReader& reader);
69 yarp::os::ConstString toString();
72 typedef yarp::os::idl::Unwrapped<iCub::data3D::PointXYZ > unwrapped;
74 class Editor :
public yarp::os::Wire,
public yarp::os::PortWriter {
82 yarp().setOwner(*
this);
85 Editor(PointXYZ& obj) {
89 yarp().setOwner(*
this);
92 bool edit(PointXYZ& obj,
bool dirty =
true) {
93 if (obj_owned)
delete this->obj;
101 if (obj_owned)
delete obj;
104 bool isValid()
const {
108 PointXYZ& state() {
return *obj; }
110 void begin() { group++; }
114 if (group==0&&is_dirty) communicate();
116 void set_x(
const double x) {
123 void set_y(
const double y) {
130 void set_z(
const double z) {
146 virtual bool will_set_x() {
return true; }
147 virtual bool will_set_y() {
return true; }
148 virtual bool will_set_z() {
return true; }
149 virtual bool did_set_x() {
return true; }
150 virtual bool did_set_y() {
return true; }
151 virtual bool did_set_z() {
return true; }
155 bool read(yarp::os::ConnectionReader& connection);
156 bool write(yarp::os::ConnectionWriter& connection);
165 if (group!=0)
return;
166 if (yarp().canWrite()) {
174 void mark_dirty_x() {
175 if (is_dirty_x)
return;
180 void mark_dirty_y() {
181 if (is_dirty_y)
return;
186 void mark_dirty_z() {
187 if (is_dirty_z)
return;
192 void dirty_flags(
bool flag) {
197 dirty_count = flag ? 3 : 0;