libdl  0.0.1
Simple yet powerful deep learning
Loading...
Searching...
No Matches
urlstream.hpp
1#ifndef DL_UTILS_URLSTREAM_HPP
2#define DL_UTILS_URLSTREAM_HPP
3
4#include <experimental/propagate_const>
5#include <istream>
6#include <memory>
7
8namespace dl::utils {
13 class URLStream : virtual public std::basic_istream<char> {
14 private:
15 struct Data;
16 std::experimental::propagate_const<std::unique_ptr<Data>> pImpl;
17
18 URLStream() = delete;
19 URLStream(const URLStream& other) = delete;
20 // Deleted move constructor because we would have to move semaphores and we capture "this" in a lambda
21 // expression within the constructor.
22 URLStream(URLStream&& other) = delete;
23
24 public:
30 explicit URLStream(const char* url) noexcept;
31 virtual ~URLStream();
32 };
33} // namespace dl::utils
34
35#endif
Opens an input stream which serves the information pointed at by the provided URL.
Definition urlstream.hpp:13
URLStream(const char *url) noexcept
Instantiates a new URLStream that serves the data at the given URL.