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 }
yarp::os::NullStream::getInputStream
InputStream & getInputStream() override
Get an InputStream to read from.
Definition: TwoWayStream.cpp:18
yarp::os::NullStream::endPacket
void endPacket() override
Mark the end of a logical packet (see beginPacket).
Definition: TwoWayStream.cpp:55
yarp::os::OutputStream
Simple specification of the minimum functions needed from output streams.
Definition: OutputStream.h:25
YARP_UNUSED
#define YARP_UNUSED(var)
Definition: api.h:159
TwoWayStream.h
yarp::os::NullStream::getLocalAddress
const Contact & getLocalAddress() const override
Get the address of the local side of the stream.
Definition: TwoWayStream.cpp:28
yarp::os::TwoWayStream::~TwoWayStream
virtual ~TwoWayStream()
Destructor.
yarp::os::NullStream::beginPacket
void beginPacket() override
Mark the beginning of a logical packet.
Definition: TwoWayStream.cpp:51
yarp::conf::ssize_t
::ssize_t ssize_t
Definition: numeric.h:60
yarp::os::Bytes
A simple abstraction for a block of bytes.
Definition: Bytes.h:28
yarp::os::NullStream::getOutputStream
OutputStream & getOutputStream() override
Get an OutputStream to write to.
Definition: TwoWayStream.cpp:23
yarp::os::NullStream::reset
void reset() override
Reset the stream.
Definition: TwoWayStream.cpp:43
yarp::os::NullStream::isOk
bool isOk() const override
Check if the stream is ok or in an error state.
Definition: TwoWayStream.cpp:38
yarp::os::InputStream::read
virtual int read()
Read and return a single byte.
Definition: InputStream.cpp:23
yarp::os
An interface to the operating system, including Port based communication.
Definition: AbstractCarrier.h:17
yarp::os::Contact
Represents how to reach a part of a YARP network.
Definition: Contact.h:39
yarp::os::NullStream::close
void close() override
Terminate the stream.
Definition: TwoWayStream.cpp:47
yarp::os::InputStream
Simple specification of the minimum functions needed from input streams.
Definition: InputStream.h:29
yarp::os::NullStream::getRemoteAddress
const Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
Definition: TwoWayStream.cpp:33
yarp::os::NullStream::write
void write(const Bytes &b) override
Write a block of bytes to the stream.
Definition: TwoWayStream.cpp:65
yarp::os::NullStream::~NullStream
virtual ~NullStream()