MCPcopy Create free account
hub / github.com/davisking/dlib / proxy_deserialize

Class proxy_deserialize

dlib/serialize.h:2341–2479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2339 };
2340
2341 class proxy_deserialize
2342 {
2343 public:
2344 explicit proxy_deserialize (
2345 const std::string& filename_
2346 ) : filename(filename_),
2347 fin_optional_owning_ptr(new std::ifstream(filename.c_str(), std::ios::binary)),
2348 fin(*fin_optional_owning_ptr)
2349 {
2350 if (!fin)
2351 throw serialization_error("Unable to open " + filename + " for reading.");
2352 init();
2353 }
2354
2355 explicit proxy_deserialize (
2356 std::vector<char>& buf
2357 ) : fin_optional_owning_ptr(new vectorstream(buf)),
2358 fin(*fin_optional_owning_ptr)
2359 {
2360 init();
2361 }
2362
2363 explicit proxy_deserialize (
2364 std::vector<int8_t>& buf
2365 ) : fin_optional_owning_ptr(new vectorstream(buf)),
2366 fin(*fin_optional_owning_ptr)
2367 {
2368 init();
2369 }
2370
2371 explicit proxy_deserialize (
2372 std::vector<uint8_t>& buf
2373 ) : fin_optional_owning_ptr(new vectorstream(buf)),
2374 fin(*fin_optional_owning_ptr)
2375 {
2376 init();
2377 }
2378
2379 explicit proxy_deserialize (
2380 std::istream& ss
2381 ) : fin_optional_owning_ptr(nullptr),
2382 fin(ss)
2383 {
2384 init();
2385 }
2386
2387 template <typename T>
2388 inline proxy_deserialize& operator>>(T& item)
2389 {
2390 return doit(item);
2391 }
2392
2393 template <typename T>
2394 inline proxy_deserialize& operator>>(ramdump_t<T>&& item)
2395 {
2396 return doit(std::move(item));
2397 }
2398

Callers 1

deserializeFunction · 0.85

Calls 4

moveFunction · 0.85
serialization_errorClass · 0.85
deserializeFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected