YARP
Yet Another Robot Platform
TwoWayStream.cpp
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 #include <yarp/os/TwoWayStream.h>
11 
12 using namespace yarp::os;
13 
14 TwoWayStream::~TwoWayStream() = default;
15 
16 NullStream::~NullStream() = default;
17 
19 {
20  return *this;
21 }
22 
24 {
25  return *this;
26 }
27 
29 {
30  return address;
31 }
32 
34 {
35  return address;
36 }
37 
38 bool NullStream::isOk() const
39 {
40  return false;
41 }
42 
44 {
45 }
46 
48 {
49 }
50 
52 {
53 }
54 
56 {
57 }
58 
60 {
61  YARP_UNUSED(b);
62  return -1;
63 }
64 
65 void NullStream::write(const Bytes& b)
66 {
67  YARP_UNUSED(b);
68 }
A simple abstraction for a block of bytes.
Definition: Bytes.h:28
Represents how to reach a part of a YARP network.
Definition: Contact.h:39
Simple specification of the minimum functions needed from input streams.
Definition: InputStream.h:29
virtual int read()
Read and return a single byte.
Definition: InputStream.cpp:23
OutputStream & getOutputStream() override
Get an OutputStream to write to.
const Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
void endPacket() override
Mark the end of a logical packet (see beginPacket).
const Contact & getLocalAddress() const override
Get the address of the local side of the stream.
void reset() override
Reset the stream.
bool isOk() const override
Check if the stream is ok or in an error state.
void close() override
Terminate the stream.
void beginPacket() override
Mark the beginning of a logical packet.
void write(const Bytes &b) override
Write a block of bytes to the stream.
InputStream & getInputStream() override
Get an InputStream to read from.
Simple specification of the minimum functions needed from output streams.
Definition: OutputStream.h:25
virtual ~TwoWayStream()
Destructor.
::ssize_t ssize_t
Definition: numeric.h:60
An interface to the operating system, including Port based communication.
#define YARP_UNUSED(var)
Definition: api.h:159