23 #include "clonable.hpp"
24 #include "os_fixes.hpp"
31 extern unsigned char PersistentVersion;
69 typedef void (*dump_callback)(
dump_context&,
const void*);
71 typedef std::pair<unsigned short, dump_callback> callback_data;
78 dump_context(
const otext& device,
unsigned char version = PersistentVersion)
throw();
82 void put(
unsigned char data)
throw();
85 const otext& device(
void)
const;
88 unsigned char version(
void)
const;
92 bool little_endian(
void)
const;
96 std::pair<bool, unsigned> pointer_map(
const void*
const pointer);
99 unsigned short register_type(
const std::type_info& info, dump_callback);
100 bool is_callback(
const std::type_info& info)
const;
101 callback_data lookup_type(
const std::type_info&)
const throw();
104 unsigned short register_interface(
const std::type_info& info);
105 bool is_interface(
const std::type_info& info)
const;
106 unsigned short lookup_interface(
const std::type_info&)
const throw();
109 void register_all(installer);
131 typedef void* (*create_callback)(void);
136 typedef std::pair<create_callback, restore_callback> callback_data;
141 typedef std::pair<unsigned short, persistent*> interface_data;
152 int get(
void)
throw();
155 const itext& device(
void)
const;
158 unsigned char version(
void)
const;
162 bool little_endian(
void)
const;
165 std::pair<bool, void*> pointer_map(
unsigned magic);
166 void pointer_add(
unsigned magic,
void* new_pointer);
169 unsigned short register_type(create_callback, restore_callback);
170 bool is_callback(
unsigned short)
const;
171 callback_data lookup_type(
unsigned short)
const throw();
175 unsigned short register_interface(
const persistent&);
176 bool is_interface(
unsigned short)
const;
177 const persistent& lookup_interface(
unsigned short)
const throw();
180 void register_all(installer);
211 void dump(
dump_context&,
const signed char& data)
throw();
213 void dump(
dump_context&,
const unsigned char& data)
throw();
217 void dump(
dump_context&,
const unsigned short& data)
throw();
225 void dump(
dump_context&,
const unsigned long& data)
throw();
244 template <
typename T>
246 template <
typename T>
269 template <
typename charT,
typename traits,
typename allocator>
270 void dump_basic_string(
dump_context&,
const std::basic_string<charT, traits, allocator>& data)
throw();
271 template <
typename charT,
typename traits,
typename allocator>
272 void restore_basic_string(
restore_context&, std::basic_string<charT, traits, allocator>& data)
throw();
274 void dump(
dump_context&,
const std::string& data)
throw();
293 template <
typename T>
294 void dump_pointer(
dump_context&,
const T*
const data)
throw();
296 template <
typename T>
313 template <
typename T>
314 void dump_xref(
dump_context&,
const T*
const data)
throw();
316 template <
typename T>
329 template <
typename T>
330 void dump_polymorph(
dump_context&,
const T*
const data)
throw();
332 template <
typename T>
345 template <
typename T>
346 void dump_interface(
dump_context&,
const T*
const data)
throw();
348 template <
typename T>
355 void dump_bitset(
dump_context&,
const std::bitset<N>& data)
throw();
359 template <
typename T>
360 void dump_complex(
dump_context&,
const std::complex<T>& data)
throw();
361 template <
typename T>
364 template <
typename T>
365 void dump_deque(
dump_context&,
const std::deque<T>& data)
throw();
366 template <
typename T>
369 template <
typename T>
370 void dump_list(
dump_context&,
const std::list<T>& data)
throw();
371 template <
typename T>
374 template <
typename K,
typename T>
375 void dump_pair(
dump_context&,
const std::pair<K, T>& data)
throw();
376 template <
typename K,
typename T>
379 template <
typename K,
typename T,
typename P>
380 void dump_map(
dump_context&,
const std::map<K, T, P>& data)
throw();
381 template <
typename K,
typename T,
typename P>
384 template <
typename K,
typename T,
typename P>
385 void dump_multimap(
dump_context&,
const std::multimap<K, T, P>& data)
throw();
386 template <
typename K,
typename T,
typename P>
387 void restore_multimap(
restore_context&, std::multimap<K, T, P>& data)
throw();
389 template <
typename K,
typename P>
390 void dump_set(
dump_context&,
const std::set<K, P>& data)
throw();
391 template <
typename K,
typename P>
394 template <
typename K,
typename P>
395 void dump_multiset(
dump_context&,
const std::multiset<K, P>& data)
throw();
396 template <
typename K,
typename P>
397 void restore_multiset(
restore_context&, std::multiset<K, P>& data)
throw();
399 template <
typename T>
400 void dump_vector(
dump_context&,
const std::vector<T>& data)
throw();
401 template <
typename T>
411 template <
typename T>
412 void dump_to_device(
const T& source,
otext& result, dump_context::installer installer)
throw();
413 template <
typename T>
414 void restore_from_device(
itext& source, T& result, restore_context::installer installer)
throw();
416 template <
typename T>
417 void dump_to_string(
const T& source, std::string& result, dump_context::installer installer)
throw();
418 template <
typename T>
419 void restore_from_string(
const std::string& source, T& result, restore_context::installer installer)
throw();
421 template <
typename T>
422 void dump_to_file(
const T& source,
const std::string& filename, dump_context::installer installer)
throw();
423 template <
typename T>
424 void restore_from_file(
const std::string& filename, T& result, restore_context::installer installer)
throw();
427 #include "persistent.tpp"
Definition: clonable.hpp:24
Definition: persistent.cc:53
Definition: persistent.hpp:64
Definition: textio.hpp:242
Definition: textio.hpp:37
Definition: persistent.hpp:45
Definition: persistent.hpp:37
Definition: persistent.hpp:52
Definition: persistent.hpp:197
Definition: persistent.cc:209
Definition: persistent.hpp:126