mirror of
https://github.com/QuasarApp/Heart.git
synced 2025-04-27 02:04:38 +00:00
change namespace
This commit is contained in:
parent
0ec4b738a1
commit
141c95fa08
@ -24,7 +24,7 @@
|
||||
#include <QtConcurrent>
|
||||
#include <closeconnection.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
AbstractNode::AbstractNode(SslMode mode, QObject *ptr):
|
||||
QTcpServer(ptr) {
|
||||
@ -159,7 +159,7 @@ void AbstractNode::addNode(const HostAddress &nodeAdderess) {
|
||||
QMetaObject::invokeMethod(this,
|
||||
"connectNodePrivate",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(NP::HostAddress, nodeAdderess));
|
||||
Q_ARG(QH::HostAddress, nodeAdderess));
|
||||
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ class QSslCertificate;
|
||||
class QSslKey;
|
||||
class QSslConfiguration;
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class DataSender;
|
||||
|
||||
@ -445,7 +445,7 @@ private slots:
|
||||
/**
|
||||
* @brief connectNodePrivate
|
||||
*/
|
||||
void connectNodePrivate(NP::HostAddress);
|
||||
void connectNodePrivate(QH::HostAddress);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <QDataStream>
|
||||
#include <QHostInfo>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
AbstractNodeInfo::AbstractNodeInfo(QAbstractSocket *sct,
|
||||
const HostAddress *address) {
|
||||
|
@ -16,7 +16,7 @@
|
||||
class QAbstractSocket;
|
||||
class QHostInfo;
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The TrustNode enum
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "cryptopairkeys.h"
|
||||
|
||||
#include <QDataStream>
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
CryptoPairKeys::CryptoPairKeys() {
|
||||
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "streambase.h"
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The CryptoPairKeys class contains pair keys.
|
||||
|
@ -3,12 +3,12 @@
|
||||
#include <quasarapp.h>
|
||||
#include <QThread>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
DataSender::DataSender() {
|
||||
}
|
||||
|
||||
void NP::DataSender::sendPackagePrivate(QByteArray array, void *target) const {
|
||||
void QH::DataSender::sendPackagePrivate(QByteArray array, void *target) const {
|
||||
auto ptr = static_cast<QAbstractSocket*>(target);
|
||||
if (array.size() != ptr->write(array)) {
|
||||
QuasarAppUtils::Params::log("not writed data to socket", QuasarAppUtils::Error);
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
class QAbstractSocket;
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The DataSender class - this class create a queue for sendet data to network.
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
Header::Header() {
|
||||
reset();
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "heart_global.h"
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
/**
|
||||
* @brief The Header struct 12 byte
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "hostaddress.h"
|
||||
#include <QDataStream>
|
||||
#include <quasarapp.h>
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
HostAddress::HostAddress() {
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <QHostAddress>
|
||||
#include "config.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The HostAddress class - this is Wraper of QHostAddress
|
||||
@ -34,6 +34,6 @@ private:
|
||||
uint qHash(const HostAddress& address);
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(NP::HostAddress);
|
||||
Q_DECLARE_METATYPE(QH::HostAddress);
|
||||
|
||||
#endif // HOSTADDRESS_H
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "icrypto.h"
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
ICrypto::ICrypto() = default;
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
class QMutex;
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class CryptoPairKeys;
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <QStandardPaths>
|
||||
#include "config.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
#define THE_CLASS(x) QString::fromLatin1(typeid(*x).name())
|
||||
#define VERSION_FILE "version"
|
||||
|
@ -14,7 +14,7 @@
|
||||
class QMutex;
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class CryptoPairKeys;
|
||||
class ICrypto;
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include <QDataStream>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
Package::Package() {
|
||||
reset();
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <QByteArray>
|
||||
#include <baseid.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class Abstract;
|
||||
/**
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <ctime>
|
||||
#include <config.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
PackageManager::PackageManager()
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <baseid.h>
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The PakcageManager class - contains all processed packages
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <quasarapp.h>
|
||||
#include <QCryptographicHash>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
unsigned short AbstractData::cmd() const {
|
||||
return _cmd;
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <streambase.h>
|
||||
#include <global.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The AbstractData class
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include <QDataStream>
|
||||
|
||||
namespace NP{
|
||||
namespace QH{
|
||||
|
||||
|
||||
BadRequest::BadRequest(const QString &err):AbstractData() {
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "abstractdata.h"
|
||||
|
||||
namespace NP{
|
||||
namespace QH{
|
||||
|
||||
/**
|
||||
* @brief The BadRequest class
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "closeconnection.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
CloseConnection::CloseConnection()
|
||||
{
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "abstractdata.h"
|
||||
|
||||
|
||||
namespace NP{
|
||||
namespace QH{
|
||||
|
||||
/**
|
||||
* @brief The CloseConnection class - This commnad is request for close connection on parent node of connection
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "ping.h"
|
||||
|
||||
#include <QDataStream>
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
Ping::Ping() {
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "abstractdata.h"
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The Ping class - test class for translate data on network
|
||||
@ -32,3 +32,6 @@ private:
|
||||
};
|
||||
}
|
||||
#endif // PING_H
|
||||
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <QDir>
|
||||
#include <qrsaencryption.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
QSecretRSA2048::QSecretRSA2048() {
|
||||
qtSecret = new QRSAEncryption(QRSAEncryption::RSA_2048);
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
class QRSAEncryption;
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The QSecretRSA2048 class Use
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "receivedata.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
ReceiveData::ReceiveData()
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "package.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The ReceiveData struct - this structure contains informaton for parse packages
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "request.h"
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
Request::Request() {
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "heart_global.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The Request class - base request methods for data packages
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include <QDataStream>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
|
||||
StreamBase::StreamBase() = default;
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "heart_global.h"
|
||||
|
||||
class QDataStream;
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class Package;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include <hostaddress.h>
|
||||
|
||||
namespace NP{
|
||||
namespace QH{
|
||||
|
||||
bool WorkState::getIsRun() const {
|
||||
return isRun;
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <hostaddress.h>
|
||||
#include <QList>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The WorkState class
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include <baseid.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The Abstractkey class - this class provid one hash function for all keys of database objcets
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <QCryptographicHash>
|
||||
#include <QDataStream>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
QByteArray AccessToken::generate(const QByteArray &entropy) {
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <QDateTime>
|
||||
#include <heart_global.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The AccessToken class - contains info about token and duration of token
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <dbobject.h>
|
||||
#include <quasarapp.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
|
||||
AsyncSqlDbWriter::AsyncSqlDbWriter(QObject *ptr):
|
||||
@ -37,7 +37,7 @@ bool AsyncSqlDbWriter::saveObject(const DBObject *saveObject) {
|
||||
return QMetaObject::invokeMethod(this,
|
||||
"handleSaveObject",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(const NP::DBObject *, saveObject),
|
||||
Q_ARG(const QH::DBObject *, saveObject),
|
||||
Q_ARG(bool *, nullptr),
|
||||
Q_ARG(bool *, nullptr));
|
||||
|
||||
@ -51,7 +51,7 @@ bool AsyncSqlDbWriter::deleteObject(const DBObject *deleteObject) {
|
||||
return QMetaObject::invokeMethod(this,
|
||||
"handleDeleteObject",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(const NP::DBObject *, deleteObject),
|
||||
Q_ARG(const QH::DBObject *, deleteObject),
|
||||
Q_ARG(bool *, nullptr),
|
||||
Q_ARG(bool *, nullptr));
|
||||
}
|
||||
@ -67,7 +67,7 @@ bool AsyncSqlDbWriter::saveObjectWithWait(const DBObject *saveObject) {
|
||||
bool invoke = QMetaObject::invokeMethod(this,
|
||||
"handleSaveObject",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(const NP::DBObject *, saveObject),
|
||||
Q_ARG(const QH::DBObject *, saveObject),
|
||||
Q_ARG(bool *, &workResult),
|
||||
Q_ARG(bool *, &workOfEnd));
|
||||
|
||||
@ -95,7 +95,7 @@ bool AsyncSqlDbWriter::deleteObjectWithWait(const DBObject *deleteObject) {
|
||||
bool invoke = QMetaObject::invokeMethod(this,
|
||||
"handleDeleteObject",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(const NP::DBObject *, deleteObject),
|
||||
Q_ARG(const QH::DBObject *, deleteObject),
|
||||
Q_ARG(bool *, &workResult),
|
||||
Q_ARG(bool *, &workOfEnd));
|
||||
|
||||
@ -124,8 +124,8 @@ bool AsyncSqlDbWriter::getAllObjects(const DBObject &templateObject, QList<const
|
||||
bool invockeResult = QMetaObject::invokeMethod(this,
|
||||
"handleGetAllObject",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(const NP::DBObject *, &templateObject),
|
||||
Q_ARG(QList<const NP::DBObject *> *, &result),
|
||||
Q_ARG(const QH::DBObject *, &templateObject),
|
||||
Q_ARG(QList<const QH::DBObject *> *, &result),
|
||||
Q_ARG(bool *, &workResult),
|
||||
Q_ARG(bool *, &workOfEnd));
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "sqldbwriter.h"
|
||||
#include "atomicmetatypes.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
|
||||
/**
|
||||
@ -73,14 +73,14 @@ protected slots:
|
||||
* @brief handleSaveObject - this method call SaveObject on own thread.
|
||||
* @param saveObject - object for save
|
||||
*/
|
||||
void handleSaveObject(const NP::DBObject* saveObject,
|
||||
void handleSaveObject(const QH::DBObject* saveObject,
|
||||
bool *resultOfWork, bool *endOfWork);
|
||||
|
||||
/**
|
||||
* @brief handleDeleteObject - this method call DeleteObject on own thread.
|
||||
* @param deleteObject object for delete
|
||||
*/
|
||||
void handleDeleteObject(const NP::DBObject* deleteObject,
|
||||
void handleDeleteObject(const QH::DBObject* deleteObject,
|
||||
bool *resultOfWork, bool *endOfWork);
|
||||
|
||||
/**
|
||||
@ -91,8 +91,8 @@ protected slots:
|
||||
* @param endOfWork - this ptr set true when invocked method is finished
|
||||
* @param cb - this call back method invoke after getAllObjects method
|
||||
*/
|
||||
virtual void handleGetAllObject(const NP::DBObject *templateObject,
|
||||
QList<const NP::DBObject *> *result,
|
||||
virtual void handleGetAllObject(const QH::DBObject *templateObject,
|
||||
QList<const QH::DBObject *> *result,
|
||||
bool *resultOfWork, bool *endOfWork = nullptr);
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef BASEDEFINES_H
|
||||
#define BASEDEFINES_H
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The DBOperationResult enum
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "baseid.h"
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
BaseId::BaseId() = default;
|
||||
|
||||
@ -68,7 +68,7 @@ bool operator==(const BaseId &left, const BaseId &other) {
|
||||
}
|
||||
|
||||
|
||||
uint qHash(const NP::BaseId &object) {
|
||||
uint qHash(const QH::BaseId &object) {
|
||||
return qHash(object.toRaw());
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <QByteArray>
|
||||
#include <streambase.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The BaseId class. General class for work with database id.
|
||||
@ -87,7 +87,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
uint qHash(const NP::BaseId& object);
|
||||
uint qHash(const QH::BaseId& object);
|
||||
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <QTcpSocket>
|
||||
#include <hostaddress.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
|
||||
BaseNodeInfo::BaseNodeInfo(QAbstractSocket *tcp, const HostAddress* address):
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <QByteArray>
|
||||
|
||||
class QAbstractSocket;
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class DbAddress;
|
||||
|
||||
|
@ -27,9 +27,9 @@
|
||||
#include <memberpermisionobject.h>
|
||||
|
||||
#define THIS_NODE "this_node_key"
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
DataBaseNode::DataBaseNode(NP::SslMode mode, QObject *ptr):
|
||||
DataBaseNode::DataBaseNode(QH::SslMode mode, QObject *ptr):
|
||||
AbstractNode(mode, ptr) {
|
||||
|
||||
_webSocketWorker = new WebSocketController(this);
|
||||
@ -326,8 +326,8 @@ QVariantMap DataBaseNode::defaultDbParams() const {
|
||||
};
|
||||
}
|
||||
|
||||
DBOperationResult NP::DataBaseNode::getObject(const NP::BaseId &requester,
|
||||
const NP::DBObject &templateObj,
|
||||
DBOperationResult QH::DataBaseNode::getObject(const QH::BaseId &requester,
|
||||
const QH::DBObject &templateObj,
|
||||
const DBObject** result) const {
|
||||
|
||||
if (!_db && !result) {
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <permission.h>
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class SqlDBCache;
|
||||
class SqlDBWriter;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <QHash>
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
qint64 qHash(const DbAddress &address) {
|
||||
return qHash(address.id().toRaw() + address.table());
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "basedefines.h"
|
||||
#include "baseid.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The DbAddress class - this is address of data base object
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "dbaddresskey.h"
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
DbAddressKey::DbAddressKey() {
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "abstractkey.h"
|
||||
#include "dbaddress.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The DbAddressKey class - key provider for DbAddress
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "dbcachekey.h"
|
||||
|
||||
#include <abstractkey.cpp>
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
DBCacheKey *DBCacheKey::instance() {
|
||||
static auto ptr = new DBCacheKey();
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <QHash>
|
||||
#include <heart_global.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The DBCacheKey class - is database main key value
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "iobjectprovider.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
iObjectProvider::iObjectProvider() = default;
|
||||
|
||||
iObjectProvider::~iObjectProvider() = default;
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <dbobject.h>
|
||||
#include <quasarapp.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class AbstractData;
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <QVariantMap>
|
||||
#include <QSharedPointer>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
DBObject::DBObject(const QString &tableName) {
|
||||
clear();
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
class QSqlQuery;
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The PrepareResult enum - result of work prepare sql query
|
||||
@ -204,9 +204,9 @@ private:
|
||||
};
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(const NP::DBObject*)
|
||||
Q_DECLARE_METATYPE(NP::DBObject*)
|
||||
Q_DECLARE_METATYPE(QList<NP::DBObject *>*);
|
||||
Q_DECLARE_METATYPE(QList<const NP::DBObject *>*);
|
||||
Q_DECLARE_METATYPE(const QH::DBObject*)
|
||||
Q_DECLARE_METATYPE(QH::DBObject*)
|
||||
Q_DECLARE_METATYPE(QList<QH::DBObject *>*);
|
||||
Q_DECLARE_METATYPE(QList<const QH::DBObject *>*);
|
||||
|
||||
#endif // DBOBJECT_H
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <QSqlQuery>
|
||||
#include <dbcachekey.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
MemberPermisionObject::MemberPermisionObject():
|
||||
DBObject("MemberPermisions") {
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "permisiondata.h"
|
||||
#include "permission.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The NodesPermisionObject class - database object of permisions of node
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <QCryptographicHash>
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
NetworkMember::NetworkMember():DBObject("NetworkMembers") {
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "dbobject.h"
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The NodeObject class - database structure of node
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include <QDataStream>
|
||||
#include <QSharedPointer>
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
WebSocket::WebSocket(): AbstractData(){
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "request.h"
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The WebSocketRequest enum
|
||||
|
@ -9,14 +9,14 @@
|
||||
|
||||
#include <QDataStream>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
WebSocketSubscriptions::WebSocketSubscriptions()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
WebSocketSubscriptions::WebSocketSubscriptions(const NP::Package &package):
|
||||
WebSocketSubscriptions::WebSocketSubscriptions(const QH::Package &package):
|
||||
WebSocketSubscriptions()
|
||||
{
|
||||
fromBytes(package.data);
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <dbaddress.h>
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The WebSocketSubscriptions class
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <quasarapp.h>
|
||||
#include <QDataStream>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
bool operator ==(const PermisionData &left, const PermisionData &right) {
|
||||
return left._id == right._id && left._address == right._address;
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <abstractkey.h>
|
||||
#include "dbaddress.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The PermisionData class- this class provide unique key for permison of subject (id) to object (address).
|
||||
|
@ -1,6 +1,6 @@
|
||||
#ifndef PERMISIONS_H
|
||||
#define PERMISIONS_H
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The Permission enum
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <QtConcurrent/QtConcurrent>
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
void SqlDBCache::globalUpdateDataBasePrivate(qint64 currentTime) {
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "config.h"
|
||||
#include "basedefines.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class SqlDBWriter;
|
||||
class DBObject;
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <QStandardPaths>
|
||||
#include <QCoreApplication>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
bool SqlDBWriter::exec(QSqlQuery *sq,const QString& sqlFile) {
|
||||
QFile f(sqlFile);
|
||||
|
@ -22,7 +22,7 @@
|
||||
class QSqlDatabase;
|
||||
class PlayerDBData;
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The SqlDBWriter class
|
||||
@ -64,13 +64,13 @@ public:
|
||||
* @brief saveObject
|
||||
* @return
|
||||
*/
|
||||
bool saveObject(const NP::DBObject *ptr) override;
|
||||
bool saveObject(const QH::DBObject *ptr) override;
|
||||
|
||||
/**
|
||||
* @brief deleteObject
|
||||
* @return
|
||||
*/
|
||||
bool deleteObject(const NP::DBObject *ptr) override;
|
||||
bool deleteObject(const QH::DBObject *ptr) override;
|
||||
|
||||
/**
|
||||
* @brief databaseLocation - return location of database.
|
||||
@ -128,7 +128,7 @@ protected:
|
||||
* @param ptr
|
||||
* @return true if function finished seccussful
|
||||
*/
|
||||
virtual bool saveQuery(const NP::DBObject *ptr) const;
|
||||
virtual bool saveQuery(const QH::DBObject *ptr) const;
|
||||
|
||||
/**
|
||||
* @brief selectQuery generate select query to database from parameters
|
||||
@ -140,7 +140,7 @@ protected:
|
||||
*/
|
||||
virtual bool selectQuery(const DBObject &requestObject, QList<const DBObject *> &result);
|
||||
|
||||
virtual bool deleteQuery(const NP::DBObject *deleteObject) const;
|
||||
virtual bool deleteQuery(const QH::DBObject *deleteObject) const;
|
||||
|
||||
|
||||
private:
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <quasarapp.h>
|
||||
#include <permission.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
|
||||
WebSocketController::WebSocketController(DataBaseNode *node) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <baseid.h>
|
||||
#include <QMutex>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class AbstractNodeInfo;
|
||||
class DataBaseNode;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "consensus.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
const QStringList Consensus::Nodes = {
|
||||
"QuasarApp.ddns.net"
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "heart_global.h"
|
||||
#include <QStringList>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The Consensus namespace - a bundle of general rules constants for behavior of nodes network.
|
||||
|
@ -35,9 +35,9 @@
|
||||
|
||||
|
||||
#define THIS_NODE "this_node_key"
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
NetworkNode::NetworkNode(NP::SslMode mode, QObject *ptr):
|
||||
NetworkNode::NetworkNode(QH::SslMode mode, QObject *ptr):
|
||||
DataBaseNode(mode, ptr) {
|
||||
|
||||
_nodeKeys = new KeyStorage(new QSecretRSA2048());
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <nodeobject.h>
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class NetworkMember;
|
||||
class MemberPermisionObject;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <QTcpSocket>
|
||||
#include <hostaddress.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
|
||||
NetworkNodeInfo::NetworkNodeInfo(QAbstractSocket *tcp, const HostAddress* address):
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <QByteArray>
|
||||
|
||||
class QAbstractSocket;
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class DbAddress;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "badnoderequest.h"
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
BadNodeRequest::BadNodeRequest() {
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include <badrequest.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The BadNodeRequest class - bad request command for bae node level
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <QDataStream>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
KnowAddresses::KnowAddresses() {
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <abstractdata.h>
|
||||
#include <baseid.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The KnowAddresses class - this class is package for send the list of know addresses of node to other node object.
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "longping.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
LongPing::LongPing(const BaseId& sender) {
|
||||
|
||||
@ -27,7 +27,7 @@ bool LongPing::copyFrom(const AbstractData * other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
QDataStream &NP::LongPing::fromStream(QDataStream &stream) {
|
||||
QDataStream &QH::LongPing::fromStream(QDataStream &stream) {
|
||||
Ping::fromStream(stream);
|
||||
stream >> _senderID;
|
||||
return stream;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "ping.h"
|
||||
#include <senderdata.h>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The LongPing class - test class for big network with return addresse
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "networkrequest.h"
|
||||
|
||||
#include <QDataStream>
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
NetworkRequest::NetworkRequest() {
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <baseid.h>
|
||||
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The NetworkRequest class - this is pakcage wraper for sending requests to network.
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "nodeobject.h"
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
NodeObject::NodeObject() {
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <networkmember.h>
|
||||
#include <senderdata.h>
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The NodeObject class
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <QCryptographicHash>
|
||||
#include <QDataStream>
|
||||
#include <QDateTime>
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
TransportData::TransportData() {
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include "hostaddress.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
class NETWORKPROTOCOLSHARED_EXPORT TransportData: public AbstractData, public SenderData
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <QDateTime>
|
||||
#include <quasarapp.h>
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
Router::Router() {
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <hostaddress.h>
|
||||
#include <QMap>
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The Router class - this class contains routes of nodes and optimise exists routes
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "senderdata.h"
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
SenderData::SenderData() {
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define SENDERDATA_H
|
||||
#include "baseid.h"
|
||||
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
/**
|
||||
* @brief The SenderData class - this is base interface class for get sender id of data base objects
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "sign.h"
|
||||
namespace NP {
|
||||
namespace QH {
|
||||
|
||||
Sign::Sign()
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user