YARP
Yet Another Robot Platform
UnbufferedContactable.h
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 #ifndef YARP_OS_UNBUFFEREDCONTACTABLE_H
7 #define YARP_OS_UNBUFFEREDCONTACTABLE_H
8 
9 #include <yarp/os/Contactable.h>
10 
11 
12 namespace yarp {
13 namespace os {
14 
19 {
20 public:
30  virtual bool write(const PortWriter& writer,
31  const PortWriter* callback = nullptr) const = 0;
32 
44  virtual bool write(const PortWriter& writer,
45  PortReader& reader,
46  const PortWriter* callback = nullptr) const = 0;
47 
56  virtual bool read(PortReader& reader, bool willReply = false) = 0;
57 
68  virtual bool reply(PortWriter& writer) = 0;
69 
80  virtual bool replyAndDrop(PortWriter& writer) = 0;
81 };
82 
83 } // namespace os
84 } // namespace yarp
85 
86 #endif // YARP_OS_UNBUFFEREDCONTACTABLE_H
An abstract port.
Definition: Contactable.h:35
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:25
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:24
An abstract unbuffered port.
virtual bool write(const PortWriter &writer, PortReader &reader, const PortWriter *callback=nullptr) const =0
Write an object to the port, then expect one back.
virtual bool read(PortReader &reader, bool willReply=false)=0
Read an object from the port.
virtual bool write(const PortWriter &writer, const PortWriter *callback=nullptr) const =0
Write an object to the port.
virtual bool reply(PortWriter &writer)=0
Send an object as a reply to an object read from the port.
virtual bool replyAndDrop(PortWriter &writer)=0
Same as reply(), but closes connection after reply.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_os_API
Definition: api.h:18