FairMQ  1.4.33
C++ Message Queuing Library and Framework
DDSTopology.h
1 /********************************************************************************
2  * Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 #ifndef FAIR_MQ_SDK_DDSTOPOLOGY_H
10 #define FAIR_MQ_SDK_DDSTOPOLOGY_H
11 
12 #include <boost/filesystem.hpp>
13 #include <fairmq/sdk/DDSCollection.h>
14 #include <fairmq/sdk/DDSEnvironment.h>
15 #include <fairmq/sdk/DDSInfo.h>
16 #include <fairmq/sdk/DDSTask.h>
17 #include <memory>
18 #include <string>
19 #include <vector>
20 
21 namespace fair::mq::sdk
22 {
23 
28 class DDSTopology
29 {
30  public:
31  using Path = boost::filesystem::path;
32 
33  DDSTopology() = delete;
34 
38  explicit DDSTopology(Path topoFile, DDSEnvironment env = DDSEnvironment());
39 
43  explicit DDSTopology(dds::topology_api::CTopology nativeTopology, DDSEnv env = {});
44 
46  auto GetEnv() const -> DDSEnvironment;
47 
50  auto GetTopoFile() const -> Path;
51 
53  auto GetNumRequiredAgents() const -> int;
54 
56  auto GetTasks(const std::string& = "") const -> std::vector<DDSTask>;
57 
59  auto GetCollections() const -> std::vector<DDSCollection>;
60 
62  auto GetName() const -> std::string;
63 
64  friend auto operator<<(std::ostream&, const DDSTopology&) -> std::ostream&;
65 
66  private:
67  struct Impl;
68  std::shared_ptr<Impl> fImpl;
69 };
70 
71 using DDSTopo = DDSTopology;
72 
73 } // namespace fair::mq::sdk
74 
75 #endif /* FAIR_MQ_SDK_DDSTOPOLOGY_H */
fair::mq::sdk::DDSTopology::GetName
auto GetName() const -> std::string
Get the name of the topology.
Definition: DDSTopology.cxx:111
fair::mq::sdk::DDSTopology::GetTopoFile
auto GetTopoFile() const -> Path
Get path to DDS topology xml, if it is known.
Definition: DDSTopology.cxx:57
fair::mq::sdk::DDSEnvironment
Sets up the DDS environment (object helper)
Definition: DDSEnvironment.h:30
fair::mq::sdk::DDSTopology::GetEnv
auto GetEnv() const -> DDSEnvironment
Get associated DDS environment.
Definition: DDSTopology.cxx:55
fair::mq::sdk::DDSTopology::GetCollections
auto GetCollections() const -> std::vector< DDSCollection >
Get list of tasks in this topology.
Definition: DDSTopology.cxx:94
fair::mq::sdk::DDSCollection
Represents a DDS collection.
Definition: DDSCollection.h:31
fair::mq::sdk::DDSTask
Represents a DDS task.
Definition: DDSTask.h:31
fair::mq::sdk::DDSTopology::GetNumRequiredAgents
auto GetNumRequiredAgents() const -> int
Get number of required agents for this topology.
Definition: DDSTopology.cxx:66
fair::mq::sdk::DDSTopology::GetTasks
auto GetTasks(const std::string &="") const -> std::vector< DDSTask >
Get list of tasks in this topology, optionally matching provided path.
Definition: DDSTopology.cxx:71
fair::mq::sdk::DDSTopology
Represents a DDS topology.
Definition: DDSTopology.h:35

privacy