YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
return_setPortmonitorParams.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6// Autogenerated by Thrift (based on compiler 0.14.1-yarped)
7// yarpidl_thrift version 2.0 - 11/11/2026
8// This is an automatically generated file.
9// It could get re-generated if the ALLOW_IDL_GENERATION flag is on.
10
12
13namespace yarp::os {
14
15// Constructor with field values
17 const bool success,
18 const std::string& message) :
19 WirePortable(),
20 ret(ret),
21 success(success),
22 message(message)
23{
24}
25
26// Read structure on a Wire
28{
29 if (!read_ret(reader)) {
30 return false;
31 }
32 if (!read_success(reader)) {
33 return false;
34 }
35 if (!read_message(reader)) {
36 return false;
37 }
38 if (reader.isError()) {
39 return false;
40 }
41 return true;
42}
43
44// Read structure on a Connection
46{
47 yarp::os::idl::WireReader reader(connection);
48 if (!reader.readListHeader(3)) {
49 return false;
50 }
51 if (!read(reader)) {
52 return false;
53 }
54 return true;
55}
56
57// Write structure on a Wire
59{
60 if (!write_ret(writer)) {
61 return false;
62 }
63 if (!write_success(writer)) {
64 return false;
65 }
66 if (!write_message(writer)) {
67 return false;
68 }
69 if (writer.isError()) {
70 return false;
71 }
72 return true;
73}
74
75// Write structure on a Connection
77{
78 yarp::os::idl::WireWriter writer(connection);
79 if (!writer.writeListHeader(3)) {
80 return false;
81 }
82 if (!write(writer)) {
83 return false;
84 }
85 return true;
86}
87
88// Convert to a printable string
90{
92 if (!yarp::os::Portable::copyPortable(*this, b)) {
93 return {};
94 }
95 return b.toString();
96}
97
98// read ret field
99bool return_setPortmonitorParams::read_ret(yarp::os::idl::WireReader& reader)
100{
101 if (reader.noMore()) {
102 reader.fail();
103 return false;
104 }
105 if (!reader.readBool(ret)) {
106 reader.fail();
107 return false;
108 }
109 return true;
110}
111
112// write ret field
113bool return_setPortmonitorParams::write_ret(const yarp::os::idl::WireWriter& writer) const
114{
115 if (!writer.writeBool(ret)) {
116 return false;
117 }
118 return true;
119}
120
121// read (nested) ret field
122bool return_setPortmonitorParams::nested_read_ret(yarp::os::idl::WireReader& reader)
123{
124 if (reader.noMore()) {
125 reader.fail();
126 return false;
127 }
128 if (!reader.readBool(ret)) {
129 reader.fail();
130 return false;
131 }
132 return true;
133}
134
135// write (nested) ret field
136bool return_setPortmonitorParams::nested_write_ret(const yarp::os::idl::WireWriter& writer) const
137{
138 if (!writer.writeBool(ret)) {
139 return false;
140 }
141 return true;
142}
143
144// read success field
145bool return_setPortmonitorParams::read_success(yarp::os::idl::WireReader& reader)
146{
147 if (reader.noMore()) {
148 reader.fail();
149 return false;
150 }
151 if (!reader.readBool(success)) {
152 reader.fail();
153 return false;
154 }
155 return true;
156}
157
158// write success field
159bool return_setPortmonitorParams::write_success(const yarp::os::idl::WireWriter& writer) const
160{
161 if (!writer.writeBool(success)) {
162 return false;
163 }
164 return true;
165}
166
167// read (nested) success field
168bool return_setPortmonitorParams::nested_read_success(yarp::os::idl::WireReader& reader)
169{
170 if (reader.noMore()) {
171 reader.fail();
172 return false;
173 }
174 if (!reader.readBool(success)) {
175 reader.fail();
176 return false;
177 }
178 return true;
179}
180
181// write (nested) success field
182bool return_setPortmonitorParams::nested_write_success(const yarp::os::idl::WireWriter& writer) const
183{
184 if (!writer.writeBool(success)) {
185 return false;
186 }
187 return true;
188}
189
190// read message field
191bool return_setPortmonitorParams::read_message(yarp::os::idl::WireReader& reader)
192{
193 if (reader.noMore()) {
194 reader.fail();
195 return false;
196 }
197 if (!reader.readString(message)) {
198 reader.fail();
199 return false;
200 }
201 return true;
202}
203
204// write message field
205bool return_setPortmonitorParams::write_message(const yarp::os::idl::WireWriter& writer) const
206{
207 if (!writer.writeString(message)) {
208 return false;
209 }
210 return true;
211}
212
213// read (nested) message field
214bool return_setPortmonitorParams::nested_read_message(yarp::os::idl::WireReader& reader)
215{
216 if (reader.noMore()) {
217 reader.fail();
218 return false;
219 }
220 if (!reader.readString(message)) {
221 reader.fail();
222 return false;
223 }
224 return true;
225}
226
227// write (nested) message field
228bool return_setPortmonitorParams::nested_write_message(const yarp::os::idl::WireWriter& writer) const
229{
230 if (!writer.writeString(message)) {
231 return false;
232 }
233 return true;
234}
235
236} // namespace yarp::os
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:64
std::string toString() const override
Gives a human-readable textual representation of the bottle.
Definition Bottle.cpp:212
An interface for reading from a network connection.
An interface for writing to a network connection.
static bool copyPortable(const PortWriter &writer, PortReader &reader)
Copy one portable to another, via writing and reading.
Definition Portable.cpp:16
IDL-friendly connection reader.
Definition WireReader.h:27
bool readString(std::string &str, bool *is_vocab=nullptr)
IDL-friendly connection writer.
Definition WireWriter.h:28
bool writeBool(bool x, bool skip_tag=false) const
bool writeListHeader(int len) const
bool writeString(const std::string &str, bool skip_tag=false) const
bool write(const yarp::os::idl::WireWriter &writer) const override
bool read(yarp::os::idl::WireReader &reader) override
An interface to the operating system, including Port based communication.