|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
26 measurements(measurements)
33 if (!read_measurements(reader)) {
52 if (!write_measurements(writer)) {
92 yarp().setOwner(*
this);
118 return obj !=
nullptr;
137 if (group == 0 && is_dirty) {
144 will_set_measurements();
146 mark_dirty_measurements();
148 did_set_measurements();
154 will_set_measurements();
155 obj->measurements[index] = elem;
156 mark_dirty_measurements();
158 did_set_measurements();
164 return obj->measurements;
205 writer.
writeString(
"send: 'help' or 'patch (param1 val1) (param2 val2)'");
220 if (!writer.
writeTag(
"many", 1, 0)) {
228 if (field ==
"measurements") {
232 if (!writer.
writeString(
"std::vector<SensorMeasurement> measurements")) {
245 bool have_act =
false;
246 if (tag !=
"patch") {
247 if (((len - 1) % 2) != 0) {
250 len = 1 + ((len - 1) / 2);
254 for (
int i = 1; i < len; ++i) {
268 if (key ==
"measurements") {
269 will_set_measurements();
270 if (!obj->nested_read_measurements(reader)) {
273 did_set_measurements();
301 if (is_dirty_measurements) {
311 if (!obj->nested_write_measurements(writer)) {
319 void SensorMeasurements::Editor::communicate()
324 if (
yarp().canWrite()) {
331 void SensorMeasurements::Editor::mark_dirty()
337 void SensorMeasurements::Editor::mark_dirty_measurements()
339 if (is_dirty_measurements) {
343 is_dirty_measurements =
true;
348 void SensorMeasurements::Editor::dirty_flags(
bool flag)
351 is_dirty_measurements = flag;
352 dirty_count = flag ? 1 : 0;
363 for (
size_t _i4 = 0; _i4 < _size0; ++_i4) {
398 for (
size_t _i10 = 0; _i10 < _size6; ++_i10) {
A simple collection of objects that can be described and transmitted in a portable way.
std::vector< SensorMeasurement > measurements
std::string toString() const override
Gives a human-readable textual representation of the bottle.
bool readString(std::string &str, bool *is_vocab=nullptr)
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
bool setOwner(yarp::os::PortReader &owner)
Set the owner of this WireLink.
bool isValid()
Check if time is valid (non-zero).
bool writeString(const std::string &tag) const
void set_measurements(const std::vector< SensorMeasurement > &measurements)
bool writeListHeader(int len) const
bool writeNested(const WirePortable &obj) const
IDL-friendly connection writer.
std::string toString() const
An interface for writing to a network connection.
bool edit(SensorMeasurements &obj, bool dirty=true)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool read(yarp::os::idl::WireReader &reader) override
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
const std::vector< SensorMeasurement > & get_measurements() const
bool readNested(WirePortable &obj)
void readListBegin(yarp::os::idl::WireState &nstate, std::uint32_t &len)
bool writeTag(const char *tag, int split, int len) const
IDL-friendly connection reader.
An interface for reading from a network connection.
bool write(const yarp::os::idl::WireWriter &writer) const override
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
virtual bool will_set_measurements()
bool writeVocab(std::int32_t x) const
bool writeListBegin(int tag, std::uint32_t len) const
SensorMeasurements & state()
The main, catch-all namespace for YARP.
bool writeListEnd() const
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
virtual bool did_set_measurements()