YARP
Yet Another Robot Platform
MpiP2PCarrier.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_MPIP2PCARRIER_H
8 #define YARP_MPIP2PCARRIER_H
9 
10 #include "MpiCarrier.h"
11 #include "MpiP2PStream.h"
12 
23  public MpiCarrier
24 {
25 public:
27  MpiCarrier()
28  {
29  target = "MPI_____";
30  }
31 
32  virtual ~MpiP2PCarrier() {
33  }
34 
35  void close() override {
36  yCDebug(MPI_CARRIER, "[MpiP2PCarrier @ %s] Closing carrier", name.c_str() );
37  delete comm;
38  }
39 
40  Carrier *create() const override {
41  return new MpiP2PCarrier();
42  }
43 
44  void createStream(bool sender) override {
45  comm = new MpiComm(route);
46  stream = new MpiP2PStream(route, comm);
47  }
48 
49  std::string getName() const override {
50  return "mpi";
51  }
52 
53  bool supportReply() const override {
54  return true;
55  }
56 };
57 
58 #endif // YARP_MPIP2PCARRIER_H
const yarp::os::LogComponent & MPI_CARRIER()
Abstract base carrier for managing port communication via MPI.
Definition: MpiCarrier.h:26
std::string target
Definition: MpiCarrier.h:32
MpiStream * stream
Definition: MpiCarrier.h:28
MpiComm * comm
Definition: MpiCarrier.h:29
std::string name
Definition: MpiCarrier.h:31
std::string route
Definition: MpiCarrier.h:31
Wrapper for MPI_Comm communicator.
Definition: MpiComm.h:50
Carrier for port communicating via MPI point-to-point send/receive.
Definition: MpiP2PCarrier.h:24
Carrier * create() const override
Factory method.
Definition: MpiP2PCarrier.h:40
bool supportReply() const override
This flag is used by YARP to determine whether the connection can carry RPC traffic,...
Definition: MpiP2PCarrier.h:53
virtual ~MpiP2PCarrier()
Definition: MpiP2PCarrier.h:32
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
Definition: MpiP2PCarrier.h:49
void close() override
Close the carrier.
Definition: MpiP2PCarrier.h:35
void createStream(bool sender) override
Definition: MpiP2PCarrier.h:44
Implements communication via MPI point-to-point send/receive.
Definition: MpiP2PStream.h:17
#define yCDebug(component,...)
Definition: LogComponent.h:109