/******************************************************************************** * Copyright (C) 2017 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 NANOMSG_FOUND #include #endif /* NANOMSG_FOUND */ #include #include #include #include #include #include #include FairMQTransportFactory::FairMQTransportFactory(const std::string& id) : fkId(id) { } auto FairMQTransportFactory::CreateTransportFactory(const std::string& type, const std::string& id, const FairMQProgOptions* config) -> std::shared_ptr { using namespace std; auto final_id = id; // Generate uuid if empty if (final_id == "") { final_id = boost::uuids::to_string(boost::uuids::random_generator()()); } if (type == "zeromq") { return std::make_shared(final_id, config); } else if (type == "shmem") { return std::make_shared(final_id, config); } #ifdef NANOMSG_FOUND else if (type == "nanomsg") { return std::make_shared(final_id, config); } #endif /* NANOMSG_FOUND */ else { LOG(ERROR) << "Unavailable transport requested: " << "\"" << type << "\"" << ". Available are: " << "\"zeromq\"" << "\"shmem\"" #ifdef NANOMSG_FOUND << ", \"nanomsg\"" #endif /* NANOMSG_FOUND */ << ". Exiting."; exit(EXIT_FAILURE); } }