YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
SizedWriter.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_OS_SIZEDWRITER_H
8#define YARP_OS_SIZEDWRITER_H
9
10#include <yarp/conf/numeric.h>
11
12#include <yarp/os/api.h>
13
14#include <yarp/os/PortWriter.h>
15
16namespace yarp::os {
17
18class ConnectionWriter;
19class OutputStream;
20class PortReader;
21class Portable;
22
32{
33public:
34 virtual ~SizedWriter();
35
36 virtual size_t length() const = 0;
37
38 virtual size_t headerLength() const = 0;
39
40 virtual size_t length(size_t index) const = 0;
41
42 virtual const char* data(size_t index) const = 0;
43
45
46 virtual Portable* getReference() = 0;
47
48 virtual void write(OutputStream& os);
49
50 bool write(ConnectionWriter& connection) const override;
51
52 virtual bool dropRequested() = 0;
53
57 virtual void startWrite() const = 0;
58
62 virtual void stopWrite() const = 0;
63
64 virtual void clear();
65};
66
67} // namespace yarp::os
68
69#endif // YARP_OS_SIZEDWRITER_H
A mini-server for performing network communication in the background.
An interface for writing to a network connection.
Simple specification of the minimum functions needed from output streams.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition PortReader.h:24
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition PortWriter.h:23
This is a base class for objects that can be both read from and be written to the YARP network.
Definition Portable.h:25
Minimal requirements for an efficient Writer.
Definition SizedWriter.h:32
virtual Portable * getReference()=0
virtual const char * data(size_t index) const =0
virtual void stopWrite() const =0
Call when all writing is finished.
virtual size_t headerLength() const =0
virtual bool dropRequested()=0
virtual size_t length(size_t index) const =0
virtual size_t length() const =0
virtual PortReader * getReplyHandler()=0
virtual void startWrite() const =0
Call when writing is about to begin.
An interface to the operating system, including Port based communication.
#define YARP_os_API
Definition api.h:18