FairMQ/fairmq/TransportFactory.cxx
Dennis Klein 2e98a4e2cb feat(ofi)!: Remove ofi transport
BREAKING CHANGE

Due to a lack of users, we remove the experimental code. The
latest implementation can be found in release v1.4.56. This does
not mean it will never be picked up again, but for now there are
no plans.
2023-03-02 11:20:35 +01:00

51 lines
1.8 KiB
C++

/********************************************************************************
* Copyright (C) 2017-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
#include <fairmq/TransportFactory.h>
#include <fairmq/shmem/TransportFactory.h>
#include <fairmq/zeromq/TransportFactory.h>
#include <fairlogger/Logger.h>
#include <fairmq/Tools.h>
#include <memory>
#include <string>
#include <utility> // move
using namespace std;
namespace fair::mq {
auto TransportFactory::CreateTransportFactory(const string& type,
const string& id,
const ProgOptions* config)
-> shared_ptr<TransportFactory>
{
auto finalId = id;
// Generate uuid if empty
if (finalId.empty()) {
finalId = tools::Uuid();
}
if (type == "zeromq") {
return make_shared<zmq::TransportFactory>(finalId, config);
} else if (type == "shmem") {
return make_shared<shmem::TransportFactory>(finalId, config);
}
else {
LOG(error) << "Unavailable transport requested: "
<< "\"" << type << "\""
<< ". Available are: "
<< "\"zeromq\","
<< "\"shmem\""
<< ". Exiting.";
throw TransportFactoryError(tools::ToString("Unavailable transport requested: ", type));
}
}
} // namespace fair::mq