diff --git a/system/apparatus.cpp b/system/apparatus.cpp index a75dbfb..2c3f0d6 100644 --- a/system/apparatus.cpp +++ b/system/apparatus.cpp @@ -34,6 +34,8 @@ apparatus::apparatus() { } apparatus::~apparatus() { + this->shutdown(); + if (this->_bin_file) { this->_bin_file->flush(); this->_bin_file->close(); @@ -54,6 +56,14 @@ bool apparatus::isFirstRun() { return QFile(apparatus::filename).exists(); } +const auth_system& apparatus::get_auth_subsystem() { + return this->_auth_system; +} + +const object_system& apparatus::get_object_subsystem() { + return this->_object_system; +} + void apparatus::init() { apparatus::_instance = new apparatus(); } @@ -81,9 +91,11 @@ void apparatus::loadGIDS() { } void apparatus::serialize_data() { - + this->_auth_system.init(this->stream); + this->_object_system.init(this->stream); } void apparatus::deserialize_data() { - + this->_auth_system.shutdown(this->stream); + this->_object_system.shutdown(this->stream); } diff --git a/system/apparatus.h b/system/apparatus.h index 6fcbe75..cf7e85a 100644 --- a/system/apparatus.h +++ b/system/apparatus.h @@ -1,6 +1,9 @@ #ifndef APPARATUS_H #define APPARATUS_H +#include "auth_system.h" +#include "object_system.h" + #include #include #include @@ -18,6 +21,9 @@ private: QFile *_bin_file; QDataStream stream; + auth_system _auth_system; + object_system _object_system; + void open_reading_stream(); void open_writing_stream(); void close_stream();