Separate objects context and interface
This commit is contained in:
parent
cf3f8dbc9c
commit
24f9d8acae
32 changed files with 362 additions and 384 deletions
|
|
@ -2,9 +2,10 @@
|
|||
|
||||
#include "ObjectArchiver.hpp"
|
||||
#include "LocalConnection.hpp"
|
||||
#include "SizeCounter.hpp"
|
||||
|
||||
namespace tp::obj {
|
||||
template<bool tRead>
|
||||
template <bool tRead>
|
||||
class Archiver : public ArchiverTemplate<tRead> {
|
||||
LocalConnection mConnection;
|
||||
ualni mAddress = 0;
|
||||
|
|
@ -53,4 +54,20 @@ namespace tp::obj {
|
|||
void save_string(ArchiverOut& file, const std::string& string);
|
||||
ualni save_string_size(const std::string& string);
|
||||
void load_string(ArchiverIn& file, std::string& out);
|
||||
|
||||
#define SAVE_LOAD_MAX_CALLBACK_SLOTS 100
|
||||
typedef void(pre_save_callback)(void* self, ArchiverOut&);
|
||||
typedef void(pre_load_callback)(void* self, ArchiverIn&);
|
||||
typedef void(post_save_callback)(void* self, ArchiverOut&);
|
||||
typedef void(post_load_callback)(void* self, ArchiverIn&);
|
||||
typedef alni(slcb_size_callback)(void* self, ArchiverOut&);
|
||||
|
||||
struct save_load_callbacks {
|
||||
void* self;
|
||||
pre_save_callback* pre_save;
|
||||
slcb_size_callback* size;
|
||||
pre_load_callback* pre_load;
|
||||
post_save_callback* post_save;
|
||||
post_load_callback* post_load;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue