YARP
Yet Another Robot Platform
MpiP2PCarrier.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2010 Daniel Krieg <krieg@fias.uni-frankfurt.de>
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_MPIP2PCARRIER_H
11 #define YARP_MPIP2PCARRIER_H
12 
13 #include "MpiCarrier.h"
14 #include "MpiP2PStream.h"
15 
26  public MpiCarrier
27 {
28 public:
30  MpiCarrier()
31  {
32  target = "MPI_____";
33  }
34 
35  virtual ~MpiP2PCarrier() {
36  }
37 
38  void close() override {
39  yCDebug(MPI_CARRIER, "[MpiP2PCarrier @ %s] Closing carrier", name.c_str() );
40  delete comm;
41  }
42 
43  Carrier *create() const override {
44  return new MpiP2PCarrier();
45  }
46 
47  void createStream(bool sender) override {
48  comm = new MpiComm(route);
49  stream = new MpiP2PStream(route, comm);
50  }
51 
52  std::string getName() const override {
53  return "mpi";
54  }
55 
56  bool supportReply() const override {
57  return true;
58  }
59 };
60 
61 #endif // YARP_MPIP2PCARRIER_H
MpiCarrier::name
std::string name
Definition: MpiCarrier.h:34
MpiCarrier::comm
MpiComm * comm
Definition: MpiCarrier.h:32
MpiP2PCarrier::close
void close() override
Close the carrier.
Definition: MpiP2PCarrier.h:38
MpiP2PCarrier
Carrier for port communicating via MPI point-to-point send/receive.
Definition: MpiP2PCarrier.h:27
MpiCarrier::route
std::string route
Definition: MpiCarrier.h:34
MpiCarrier::stream
MpiStream * stream
Definition: MpiCarrier.h:31
MpiP2PCarrier::supportReply
bool supportReply() const override
This flag is used by YARP to determine whether the connection can carry RPC traffic,...
Definition: MpiP2PCarrier.h:56
MpiP2PCarrier::getName
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
Definition: MpiP2PCarrier.h:52
MpiCarrier::target
std::string target
Definition: MpiCarrier.h:35
MpiP2PCarrier::~MpiP2PCarrier
virtual ~MpiP2PCarrier()
Definition: MpiP2PCarrier.h:35
MpiCarrier.h
MpiP2PCarrier::create
Carrier * create() const override
Factory method.
Definition: MpiP2PCarrier.h:43
MpiCarrier
Abstract base carrier for managing port communication via MPI.
Definition: MpiCarrier.h:29
MpiP2PStream.h
MpiP2PCarrier::MpiP2PCarrier
MpiP2PCarrier()
Definition: MpiP2PCarrier.h:29
yCDebug
#define yCDebug(component,...)
Definition: LogComponent.h:112
MpiP2PCarrier::createStream
void createStream(bool sender) override
Definition: MpiP2PCarrier.h:47
MpiComm
Wrapper for MPI_Comm communicator.
Definition: MpiComm.h:53
MPI_CARRIER
const yarp::os::LogComponent & MPI_CARRIER()
Definition: MpiLogComponent.cpp:16
MpiP2PStream
Implements communication via MPI point-to-point send/receive.
Definition: MpiP2PStream.h:20