/******************************************************************************** * Copyright (C) 2019 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" * ********************************************************************************/ #ifndef FAIR_MQ_SDK_DDSTOPOLOGY_H #define FAIR_MQ_SDK_DDSTOPOLOGY_H #include #include #include #include #include #include #include #include namespace fair::mq::sdk { /** * @class DDSTopology DDSTopology.h * @brief Represents a DDS topology */ class DDSTopology { public: using Path = boost::filesystem::path; DDSTopology() = delete; /// @brief Construct from file /// @param topoFile DDS topology xml file /// @param env DDS environment explicit DDSTopology(Path topoFile, DDSEnvironment env = DDSEnvironment()); /// @brief Construct with already existing native DDS API objects /// @param nativeTopology Existing and initialized CTopology /// @param env Optional DDSEnv explicit DDSTopology(dds::topology_api::CTopology nativeTopology, DDSEnv env = {}); /// @brief Get associated DDS environment auto GetEnv() const -> DDSEnvironment; /// @brief Get path to DDS topology xml, if it is known /// @throw std::runtime_error auto GetTopoFile() const -> Path; /// @brief Get number of required agents for this topology auto GetNumRequiredAgents() const -> int; /// @brief Get list of tasks in this topology, optionally matching provided path auto GetTasks(const std::string& = "") const -> std::vector; /// @brief Get list of tasks in this topology auto GetCollections() const -> std::vector; /// @brief Get the name of the topology auto GetName() const -> std::string; friend auto operator<<(std::ostream&, const DDSTopology&) -> std::ostream&; private: struct Impl; std::shared_ptr fImpl; }; using DDSTopo = DDSTopology; } // namespace fair::mq::sdk #endif /* FAIR_MQ_SDK_DDSTOPOLOGY_H */