YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
MpiP2PStream.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2010 Daniel Krieg <krieg@fias.uni-frankfurt.de>
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_MPIP2PSTREAM_H
8#define YARP_MPIP2PSTREAM_H
9
10#include "MpiStream.h"
11
16 public MpiStream
17{
18public:
20
21 using MpiStream::write;
22 using MpiStream::read;
23
24 ssize_t read(yarp::os::Bytes& b) override;
25 void write(const yarp::os::Bytes& b) override;
26 void close() override {
27 yCDebug(MPI_CARRIER, "[MpiP2PStream @ %s] Closing stream", name.c_str());
28 terminate = true;
29 }
30};
31
32
33#endif // YARP_MPIP2PSTREAM_H
const yarp::os::LogComponent & MPI_CARRIER()
Wrapper for MPI_Comm communicator.
Definition MpiComm.h:50
Implements communication via MPI point-to-point send/receive.
void write(const yarp::os::Bytes &b) override
Write a block of bytes to the stream.
void close() override
Terminate the stream.
MpiP2PStream(std::string name, MpiComm *comm)
Abstract base class for port communication via MPI.
Definition MpiStream.h:29
MpiComm * comm
Definition MpiStream.h:35
std::string name
Definition MpiStream.h:34
bool terminate
Definition MpiStream.h:33
void write(const yarp::os::Bytes &b) override=0
Write a block of bytes to the stream.
A simple abstraction for a block of bytes.
Definition Bytes.h:24
virtual int read()
Read and return a single byte.
#define yCDebug(component,...)