File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,15 @@ class DTL {
55
55
// / @param name The name of the Stream to add to the DTL.
56
56
// / @return A handler on the newly created Stream object.
57
57
std::shared_ptr<Stream> add_stream (const std::string& name);
58
+
59
+ // / @brief Retrieve all streams declared in the Data Transport by its name.
60
+ // / @return a map of handlers on Stream objects with their names as keys.
61
+ std::unordered_map<std::string, std::shared_ptr<Stream>> get_all_streams () const { return streams_; }
62
+
63
+ // / @brief Retrieve a data stream from the Data Transport Layer by its name.
64
+ // / @param name The name of the Stream to retrieve.
65
+ // / @return A handler on the Stream object or nullptr if it doesn't exist.
66
+ std::shared_ptr<Stream> get_stream_by_name_or_null (const std::string& name) const ;
58
67
};
59
68
60
69
} // namespace dtlmod
Original file line number Diff line number Diff line change @@ -138,4 +138,12 @@ std::shared_ptr<Stream> DTL::add_stream(const std::string& name)
138
138
return streams_[name];
139
139
}
140
140
141
+ std::shared_ptr<Stream> DTL::get_stream_by_name_or_null (const std::string& name) const
142
+ {
143
+ auto it = streams_.find (name);
144
+ if (it == streams_.end ())
145
+ return nullptr ;
146
+ return it->second ;
147
+
148
+ }
141
149
} // namespace dtlmod
You can’t perform that action at this time.
0 commit comments