Add subsystem interactions to main framework
This commit is contained in:
parent
6458ebe2a4
commit
4cef87e506
2 changed files with 20 additions and 2 deletions
|
|
@ -34,6 +34,8 @@ apparatus::apparatus() {
|
||||||
}
|
}
|
||||||
|
|
||||||
apparatus::~apparatus() {
|
apparatus::~apparatus() {
|
||||||
|
this->shutdown();
|
||||||
|
|
||||||
if (this->_bin_file) {
|
if (this->_bin_file) {
|
||||||
this->_bin_file->flush();
|
this->_bin_file->flush();
|
||||||
this->_bin_file->close();
|
this->_bin_file->close();
|
||||||
|
|
@ -54,6 +56,14 @@ bool apparatus::isFirstRun() {
|
||||||
return QFile(apparatus::filename).exists();
|
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() {
|
void apparatus::init() {
|
||||||
apparatus::_instance = new apparatus();
|
apparatus::_instance = new apparatus();
|
||||||
}
|
}
|
||||||
|
|
@ -81,9 +91,11 @@ void apparatus::loadGIDS() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void apparatus::serialize_data() {
|
void apparatus::serialize_data() {
|
||||||
|
this->_auth_system.init(this->stream);
|
||||||
|
this->_object_system.init(this->stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void apparatus::deserialize_data() {
|
void apparatus::deserialize_data() {
|
||||||
|
this->_auth_system.shutdown(this->stream);
|
||||||
|
this->_object_system.shutdown(this->stream);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
#ifndef APPARATUS_H
|
#ifndef APPARATUS_H
|
||||||
#define APPARATUS_H
|
#define APPARATUS_H
|
||||||
|
|
||||||
|
#include "auth_system.h"
|
||||||
|
#include "object_system.h"
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
|
|
@ -18,6 +21,9 @@ private:
|
||||||
QFile *_bin_file;
|
QFile *_bin_file;
|
||||||
QDataStream stream;
|
QDataStream stream;
|
||||||
|
|
||||||
|
auth_system _auth_system;
|
||||||
|
object_system _object_system;
|
||||||
|
|
||||||
void open_reading_stream();
|
void open_reading_stream();
|
||||||
void open_writing_stream();
|
void open_writing_stream();
|
||||||
void close_stream();
|
void close_stream();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue