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::SizedWriter::length
virtual size_t length() const =0
yarp::os::Portable
This is a base class for objects that can be both read from and be written to the YARP network.
Definition: Portable.h:29
yarp::os::SizedWriter::~SizedWriter
virtual ~SizedWriter()
yarp::os::SizedWriter::startWrite
virtual void startWrite() const =0
Call when writing is about to begin.
numeric.h
yarp::os::OutputStream
Simple specification of the minimum functions needed from output streams.
Definition: OutputStream.h:25
api.h
YARP_os_API
#define YARP_os_API
Definition: api.h:19
yarp::os::PortWriter
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:27
PortWriter.h
yarp::os::SizedWriter::getReference
virtual Portable * getReference()=0
yarp::os::SizedWriter::headerLength
virtual size_t headerLength() const =0
yarp::os::PortReader
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:28
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::os::SizedWriter::dropRequested
virtual bool dropRequested()=0
yarp::os::SizedWriter::getReplyHandler
virtual PortReader * getReplyHandler()=0
yarp::os::SizedWriter::length
virtual size_t length(size_t index) const =0
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::os::SizedWriter::data
virtual const char * data(size_t index) const =0
yarp::sig::file::write
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:971
yarp::os::SizedWriter::stopWrite
virtual void stopWrite() const =0
Call when all writing is finished.
yarp::os::SizedWriter
Minimal requirements for an efficient Writer.
Definition: SizedWriter.h:36