YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
return_ask.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 Compiler (0.14.1-yarped)
7//
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::dev::llm {
14
15// Constructor with field values
17 const yarp::dev::LLM_Message& answer) :
18 WirePortable(),
19 ret(ret),
20 answer(answer)
21{
22}
23
24// Read structure on a Wire
26{
27 if (!read_ret(reader)) {
28 return false;
29 }
30 if (!nested_read_answer(reader)) {
31 return false;
32 }
33 if (reader.isError()) {
34 return false;
35 }
36 return true;
37}
38
39// Read structure on a Connection
41{
42 yarp::os::idl::WireReader reader(connection);
43 if (!reader.readListHeader(2)) {
44 return false;
45 }
46 if (!read(reader)) {
47 return false;
48 }
49 return true;
50}
51
52// Write structure on a Wire
54{
55 if (!write_ret(writer)) {
56 return false;
57 }
58 if (!nested_write_answer(writer)) {
59 return false;
60 }
61 if (writer.isError()) {
62 return false;
63 }
64 return true;
65}
66
67// Write structure on a Connection
69{
70 yarp::os::idl::WireWriter writer(connection);
71 if (!writer.writeListHeader(2)) {
72 return false;
73 }
74 if (!write(writer)) {
75 return false;
76 }
77 return true;
78}
79
80// Convert to a printable string
81std::string return_ask::toString() const
82{
84 if (!yarp::os::Portable::copyPortable(*this, b)) {
85 return {};
86 }
87 return b.toString();
88}
89
90// read ret field
91bool return_ask::read_ret(yarp::os::idl::WireReader& reader)
92{
93 if (!reader.readBool(ret)) {
94 ret = false;
95 }
96 return true;
97}
98
99// write ret field
100bool return_ask::write_ret(const yarp::os::idl::WireWriter& writer) const
101{
102 if (!writer.writeBool(ret)) {
103 return false;
104 }
105 return true;
106}
107
108// read (nested) ret field
109bool return_ask::nested_read_ret(yarp::os::idl::WireReader& reader)
110{
111 if (!reader.readBool(ret)) {
112 ret = false;
113 }
114 return true;
115}
116
117// write (nested) ret field
118bool return_ask::nested_write_ret(const yarp::os::idl::WireWriter& writer) const
119{
120 if (!writer.writeBool(ret)) {
121 return false;
122 }
123 return true;
124}
125
126// read answer field
127bool return_ask::read_answer(yarp::os::idl::WireReader& reader)
128{
129 if (reader.noMore()) {
130 reader.fail();
131 return false;
132 }
133 if (!reader.read(answer)) {
134 reader.fail();
135 return false;
136 }
137 return true;
138}
139
140// write answer field
141bool return_ask::write_answer(const yarp::os::idl::WireWriter& writer) const
142{
143 if (!writer.write(answer)) {
144 return false;
145 }
146 return true;
147}
148
149// read (nested) answer field
150bool return_ask::nested_read_answer(yarp::os::idl::WireReader& reader)
151{
152 if (reader.noMore()) {
153 reader.fail();
154 return false;
155 }
156 if (!reader.readNested(answer)) {
157 reader.fail();
158 return false;
159 }
160 return true;
161}
162
163// write (nested) answer field
164bool return_ask::nested_write_answer(const yarp::os::idl::WireWriter& writer) const
165{
166 if (!writer.writeNested(answer)) {
167 return false;
168 }
169 return true;
170}
171
172} // namespace yarp::dev::llm
bool ret
bool read(yarp::os::idl::WireReader &reader) override
std::string toString() const
yarp::dev::LLM_Message answer
Definition return_ask.h:26
bool write(const yarp::os::idl::WireWriter &writer) const override
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:211
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 readNested(WirePortable &obj)
bool read(WirePortable &obj)
IDL-friendly connection writer.
Definition WireWriter.h:28
bool writeBool(bool x, bool skip_tag=false) const
bool write(const WirePortable &obj) const
bool writeListHeader(int len) const
bool writeNested(const WirePortable &obj) const