We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55ecd13 commit ac3c07fCopy full SHA for ac3c07f
1 file changed
api/net/stream.hpp
@@ -181,10 +181,23 @@ namespace net {
181
**/
182
virtual Stream* transport() noexcept = 0;
183
184
+ /** Recursively navigate to the transport stream at the bottom **/
185
+ inline Stream* bottom_transport() noexcept;
186
+
187
virtual size_t serialize_to(void*) const = 0;
188
189
virtual ~Stream() = default;
190
}; // < class Stream
191
192
+ inline Stream* Stream::bottom_transport() noexcept
193
+ {
194
+ Stream* stream = this;
195
+ while (stream->transport() != nullptr) {
196
+ stream = stream->transport();
197
+ }
198
+ return stream;
199
200
201
} // < namespace net
202
203
#endif // < NET_STREAM_HPP
0 commit comments