YARP
Yet Another Robot Platform
SizedWriter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_OS_SIZEDWRITER_H
11 #define YARP_OS_SIZEDWRITER_H
12 
13 #include <yarp/conf/numeric.h>
14 
15 #include <yarp/os/api.h>
16 
17 #include <yarp/os/PortWriter.h>
18 
19 namespace yarp {
20 namespace os {
21 
22 class ConnectionWriter;
23 class OutputStream;
24 class PortReader;
25 class Portable;
26 
36 {
37 public:
38  virtual ~SizedWriter();
39 
40  virtual size_t length() const = 0;
41 
42  virtual size_t headerLength() const = 0;
43 
44  virtual size_t length(size_t index) const = 0;
45 
46  virtual const char* data(size_t index) const = 0;
47 
48  virtual PortReader* getReplyHandler() = 0;
49 
50  virtual Portable* getReference() = 0;
51 
52  virtual void write(OutputStream& os);
53 
54  bool write(ConnectionWriter& connection) const override;
55 
56  virtual bool dropRequested() = 0;
57 
61  virtual void startWrite() const = 0;
62 
66  virtual void stopWrite() const = 0;
67 
68  virtual void clear();
69 };
70 
71 } // namespace os
72 } // namespace yarp
73 
74 #endif // YARP_OS_SIZEDWRITER_H
yarp::os::Portable
Definition: Portable.h:28
numeric.h
yarp::os::OutputStream
Simple specification of the minimum functions needed from output streams.
Definition: OutputStream.h:24
yarp::os::PortWriter
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:26
PortWriter.h
yarp::os::PortReader
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:27
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:39
yarp
Definition: environment.h:18
YARP_os_API
#define YARP_os_API
Definition: api.h:19
yarp::sig::file::write
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:804
api.h
yarp::os::SizedWriter
Minimal requirements for an efficient Writer.
Definition: SizedWriter.h:35