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

Method deserialize

dlib/static_map/static_map_kernel_1.h:70–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 // I would define this outside the class but Borland 5.5 has some problems
69 // with non-inline templated friend functions.
70 friend void deserialize (
71 static_map_kernel_1& item,
72 std::istream& in
73 )
74 {
75 try
76 {
77 item.clear();
78 unsigned long size;
79 deserialize(size,in);
80 item.map_size = size;
81 item.d = new domain[size];
82 item.r = new range[size];
83 for (unsigned long i = 0; i < size; ++i)
84 {
85 deserialize(item.d[i],in);
86 deserialize(item.r[i],in);
87 }
88 }
89 catch (serialization_error& e)
90 {
91 item.map_size = 0;
92 if (item.d)
93 {
94 delete [] item.d;
95 item.d = 0;
96 }
97 if (item.r)
98 {
99 delete [] item.r;
100 item.r = 0;
101 }
102
103 throw serialization_error(e.info + "\n while deserializing object of type static_map_kernel_1");
104 }
105 catch (...)
106 {
107 item.map_size = 0;
108 if (item.d)
109 {
110 delete [] item.d;
111 item.d = 0;
112 }
113 if (item.r)
114 {
115 delete [] item.r;
116 item.r = 0;
117 }
118
119 throw;
120 }
121 }
122
123
124 public:

Callers

nothing calls this directly

Calls 3

serialization_errorClass · 0.85
deserializeFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected