/******************************************************************************** * Copyright (C) 2017-2018 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 #include #include #ifdef BUILD_OFI_TRANSPORT #include #endif #include #include #include #include #include #include #include // move using namespace std; FairMQTransportFactory::FairMQTransportFactory(string id) : fkId(std::move(id)) {} auto FairMQTransportFactory::CreateTransportFactory(const string& type, const string& id, const fair::mq::ProgOptions* config) -> shared_ptr { auto finalId = id; // Generate uuid if empty if (finalId.empty()) { finalId = fair::mq::tools::Uuid(); } if (type == "zeromq") { return make_shared(finalId, config); } else if (type == "shmem") { return make_shared(finalId, config); } #ifdef BUILD_OFI_TRANSPORT else if (type == "ofi") { return make_shared(finalId, config); } #endif /* BUILD_OFI_TRANSPORT */ else { LOG(error) << "Unavailable transport requested: " << "\"" << type << "\"" << ". Available are: " << "\"zeromq\"," << "\"shmem\"" #ifdef BUILD_OFI_TRANSPORT << ", and \"ofi\"" #endif /* BUILD_OFI_TRANSPORT */ << ". Exiting."; throw fair::mq::TransportFactoryError(fair::mq::tools::ToString("Unavailable transport requested: ", type)); } }