Heart 1.3.848.aa44c26
Heart is base back end library for your c++ Qt projects.
|
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart library. More...
Namespaces | |
namespace | ErrorCodes |
ErrorCodes This namesapce contains all error codes of the Heart Library. | |
namespace | PKG |
The PKG namesapce - this namespace contains all default packages of the Heart library. If you want create a pool request for Heart Library with own implemented packages you need to create a new package into a PKG namesapce. | |
Classes | |
class | AbstractKey |
The Abstractkey class is provide general hash function for all keys of Heart library. This class using for generate a hash code of any keyObject. More... | |
class | AbstractNode |
The AbstractNode class - Abstract implementation of node. this implementation have a methods for send and receive data messages, and work with crypto method for create a security connections betwin nodes. AbstractNode - is thread save class. More... | |
class | AbstractNodeInfo |
The AbstractNodeInfo class contains information about client or server connection and tcp socket of node. All node Info classes must be initialized in the AbstractNode::createNodeInfo methods. This implementation of nodeInf contains only trust of node and network socket. More... | |
class | AbstractNodeParser |
The AbstractNodeParser class is main parser of the abstract level of the hear lib. More... | |
class | AbstractTask |
The AbstractTask class. All tasks executed on separate thread. More... | |
class | AccessToken |
The AccessToken class contains information duration of the access. Token are byte array for validation access users or another network member on nodes. In usually cases toke add permissions for database objects. More... | |
class | APIVersionParser |
The APIVersionParser class This is main parser forthe main command. This parsers work only with the APIVersion packge;. More... | |
class | Async |
The Async class This is bundle of async templates and async wrappers. More... | |
class | AsyncLauncher |
The AsyncLauncher class is wraper of the Async class for support moving invokes to thread of the current object. More... | |
class | AsyncSqlDBWriter |
The AsyncSqlDbWriter class is some as SqlDBWriter but run all command in own thread. This class is thread save. More... | |
class | BigDataParser |
The BigDataParser class is main manager for control big data packages. More... | |
class | DataBase |
The DataBase class is DataBase base implementation. This implementation contains methods for work with database. DataBaseNode is thread save class. More... | |
class | DataSender |
The DataSender class this class create a queue for sendet data to network. More... | |
class | DbAddress |
The DbAddress class use to work with database addresses. Database Address it is structure with 2 values. More... | |
class | DbAddressKey |
The DbAddressKey class is implementation for calc hash key of DbAddress objects. More... | |
struct | DBPatch |
DBPatch This is function that should be upgrade database. More... | |
class | DistVersion |
The DistVersion class This is information of supported versions of the destinations api. More... | |
struct | Header |
The Header struct 32 bytes. More... | |
class | HostAddress |
The Host Address class this is wrapper of QHostAddress. Contains the NetworkAddress and network port. More... | |
class | iObjectProvider |
The iObjectProvider class is base interface for work with database objects. Using on database writers and database caches. More... | |
class | iParser |
The iParser class This class provide functions for parsing income packages. For yousing just override the iParser::parsePackage method. More... | |
class | ISqlDB |
The ISqlDB class it is db cache and bridge for DbWriters. Work Scheme of the database cache: More... | |
class | IToken |
The IToken classes interface for the validation user packages and user dates. More... | |
struct | PackaData |
The PackaData struct - private data of packages. More... | |
class | Package |
The Package struct. This is base structure for transporting data by network between QH nodes. The Package contains a 32 bytes header and Package::data array. The size on the header should be equals size of Package::data array. More... | |
class | PackageManager |
The PakcageManager class contains all processed packages. Working like a cache of packages. More... | |
struct | PoolData |
struct | ReceiveData |
The ReceiveData struct This is private structure for contains informaton for parse packages. More... | |
class | Request |
The Request class is base interface for working with requests commands. More... | |
class | SoftDelete |
The SoftDelete class povide the soft delete functionality. All child classes of this class must be deleted using the softDelete method for preparring for delete. IF you delete object without prepare then destructor invoke the abort function in debug mode. For release mode destructor print error message only. More... | |
class | SqlDB |
The SqlDB class This is base implementation fo datatbase. The SqlDB do not use caches, all request run on the sqlwtiter class. More... | |
class | SqlDBWriter |
The SqlDBWriter class. This class write and read objects from database (hard level). Before working with database you need to initialize it. The SqlDBWriter support a any sql databases, For list of supported drivers see the Qt Docummentation https://doc.qt.io/qt-5/sql-driver.html For initialize a custom database driver you need to set an own params see the SqlDBWriter::initDb metthod. This class work only on own thread. For change working thread use the Qt method moveToThread. More... | |
class | StreamBase |
The StreamBase class add support streaming data for all children classes. For correctly working all serializations functions you need to override fromStream and toStream methods. All implementations of overridden method should be contains a invoke of method of base class. More... | |
class | StreamMultiversion |
The StreamMultiversion class this parser works with simple multiversion packages. More... | |
class | TaskScheduler |
The TaskScheduler class This class contains queue of all shedule tasks. More... | |
class | TcpSocket |
The AbstractSocket class This class is wraper of the QAbstract socket with slot implementation of the disconnect from host method. More... | |
class | WorkState |
The WorkState class is simple class with data of work state of node. More... | |
Typedefs | |
typedef QMap< unsigned short, QMap< unsigned short, DBPatch > > | DBPatchMap |
DBPatchMap This is 2 depch map of the DBPatch structure when the first key it is version (from) and second key is version to. | |
typedef QHash< QString, DistVersion > | VersionData |
VersionData This is array of all available apis and supported its versions. | |
typedef QHash< unsigned short, DistVersion > | PackagesVersionData |
PackagesVersionData This is some as VersionData but for int commands. | |
using | PacksMap = QHash< unsigned short, std::function< PKG::AbstractData *()> > |
PacksMap This is hash map where id is command of package and value is factory function. | |
Enumerations | |
enum class | SslMode { NoSSL } |
The SslMode enum This enum contatins options for set ssl mode of node (server). For more information see AbstractNode::useSelfSignedSslConfiguration AbstractNode::useSystemSslConfiguration and AbstractNode::disableSSL methods. More... | |
enum class | AddNodeError { UnknownError , HostNotFound , RegisterSocketFailed } |
The AddNodeError enum contains error code that can be occured after invoke the AbstractNode::addNode mehod. More... | |
enum class | TrustNode : unsigned char { Undefined = 0xFF , Default = 100 , Restore = 20 , Baned = 0 } |
The TrustNode enum contains cases for trust of the client or nodes. More... | |
enum class | NodeCoonectionStatus : int { NotConnected , Connected , Confirmed } |
The AbstractNodeState enum - This is status of the known nodes or clients. More... | |
enum class | ScheduleMode : int { SingleWork , Repeat , TimePoint } |
The ScheduleMode enum contails list of the shedule modes. More... | |
enum class | ParserResult { Error = 0 , NotProcessed = 1 , Processed = 2 } |
The ParserResult enum. Error - parser detect a errorob package. NotProcessed - the parser does not know what to do with the package or has not finished processing it. Processed - the parser finished processing correctly. More... | |
enum class | SqlDBCasheWriteMode : int { Default = 0x0 , On_New_Thread = 0x1 , Force = 0x2 } |
The SqlDBCasheWriteMode enum contains list of available modes of write data into database. More... | |
enum class | CacheAction : int { None , Insert , Update , Delete } |
The CacheAction enum contains types of database cache actions. The any database caches save all changes in to hardware database. For saving all changes it use hash map with objects and its actions. Every type invokes own method for running an action of object. More... | |
Functions | |
bool | init () |
init This method initialize default resources of the Heart Library. | |
QString | heartLibVersion () |
heartLibVersion This method return version of library in format : major.commit.hash | |
uint | qHash (NodeCoonectionStatus status) |
qHash - Simple hash function of NodeCoonectionStatus | |
qint64 | qHash (const DbAddress &address) |
qHash This functions calls int 32 hash of address. | |
bool | operator== (const DbAddress &left, const DbAddress &other) |
bool | operator!= (const DbAddress &left, const DbAddress &other) |
QDataStream & | operator>> (QDataStream &stream, HostAddress &address) |
QDataStream & | operator<< (QDataStream &stream, const HostAddress &address) |
bool | operator== (const HostAddress &left, const HostAddress &right) |
bool | operator!= (const HostAddress &left, const HostAddress &right) |
uint | qHash (const HostAddress &address) |
constexpr uint | qHash (CacheAction action) |
qHash calc hash of the CacheAction enum. | |
QDataStream & | operator<< (QDataStream &stream, const StreamBase &obj) |
QDataStream & | operator>> (QDataStream &stream, StreamBase &obj) |
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart library.
Usage:
Example: The package for transporting text data.
Example:
Example:
This is a simple echo server for our client - server application. For Run this serve use method QF::AbstrcatData::run
The basic principle of the library.
Node - it is the server or client implementation of any AbstractNode child's classes.
About parsers
The Parser it is an object that works with your packages. You can create multiple version's parser for compatibility between node versions. Node will select most actually version that known both nodes. For example, server known parsers with version 1, 2 and 3 but client can work only with 1 and 2, so nodes choose parser v2 because all nodes known about this parser version.
You can create multiple types of the parsers. For example, you want to create an absolute new API and add it to the node. You need override Example:
typedef QMap<unsigned short, QMap<unsigned short, DBPatch> > QH::DBPatchMap |
DBPatchMap This is 2 depch map of the DBPatch structure when the first key it is version (from) and second key is version to.
typedef QHash<unsigned short, DistVersion> QH::PackagesVersionData |
PackagesVersionData This is some as VersionData but for int commands.
Definition at line 78 of file distversion.h.
using QH::PacksMap = typedef QHash<unsigned short, std::function<PKG::AbstractData *()> > |
typedef QHash<QString, DistVersion> QH::VersionData |
VersionData This is array of all available apis and supported its versions.
Definition at line 73 of file distversion.h.
|
strong |
The AddNodeError enum contains error code that can be occured after invoke the AbstractNode::addNode mehod.
Definition at line 71 of file abstractnode.h.
|
strong |
The CacheAction enum contains types of database cache actions. The any database caches save all changes in to hardware database. For saving all changes it use hash map with objects and its actions. Every type invokes own method for running an action of object.
Enumerator | |
---|---|
None | Do nothing. |
Insert | Invoke the SqlDBWriter::insertObject method of a private database writer implementation. |
Update | Invoke the SqlDBWriter::updateObject method of a private database writer implementation. |
Delete | Invoke the SqlDBWriter::deleteObject method of a private database writer implementation. |
|
strong |
The AbstractNodeState enum - This is status of the known nodes or clients.
Definition at line 45 of file abstractnodeinfo.h.
|
strong |
The ParserResult enum. Error - parser detect a errorob package. NotProcessed - the parser does not know what to do with the package or has not finished processing it. Processed - the parser finished processing correctly.
|
strong |
The ScheduleMode enum contails list of the shedule modes.
Enumerator | |
---|---|
SingleWork | In this mode AbstractTask will be executed after time msecunds from the moment of adding this task. |
Repeat | In this mode AbstractTask will be executed task every time from the moment of adding this task. |
TimePoint | In this mode AbstractTask will be executed int time msecunds by Unix time. |
Definition at line 20 of file abstracttask.h.
|
strong |
The SqlDBCasheWriteMode enum contains list of available modes of write data into database.
|
strong |
The SslMode enum This enum contatins options for set ssl mode of node (server). For more information see AbstractNode::useSelfSignedSslConfiguration AbstractNode::useSystemSslConfiguration and AbstractNode::disableSSL methods.
Enumerator | |
---|---|
NoSSL | This is not secure connection without ssl encription. It is default value of new any node see AbstractNode(SslMode mode = SslMode::NoSSL, QObject * ptr = nullptr). |
Definition at line 53 of file abstractnode.h.
|
strong |
The TrustNode enum contains cases for trust of the client or nodes.
Definition at line 27 of file abstractnodeinfo.h.
HEARTSHARED_EXPORT QString QH::heartLibVersion | ( | ) |
bool HEARTSHARED_EXPORT QH::init | ( | ) |
init This method initialize default resources of the Heart Library.
Example :
Definition at line 15 of file heart.cpp.
Definition at line 50 of file dbaddress.cpp.
bool QH::operator!= | ( | const HostAddress & | left, |
const HostAddress & | right | ||
) |
QDataStream & QH::operator<< | ( | QDataStream & | stream, |
const HostAddress & | address | ||
) |
Definition at line 87 of file hostaddress.cpp.
QDataStream & QH::operator<< | ( | QDataStream & | stream, |
const StreamBase & | obj | ||
) |
stream | This is qt data stream object. |
obj | This is serialized object. |
Definition at line 67 of file streambase.cpp.
Definition at line 27 of file dbaddress.cpp.
bool QH::operator== | ( | const HostAddress & | left, |
const HostAddress & | right | ||
) |
QDataStream & QH::operator>> | ( | QDataStream & | stream, |
HostAddress & | address | ||
) |
Definition at line 80 of file hostaddress.cpp.
QDataStream & QH::operator>> | ( | QDataStream & | stream, |
StreamBase & | obj | ||
) |
stream | This is qt data stream object. |
obj | This is serialized object. |
Definition at line 71 of file streambase.cpp.
|
inlineconstexpr |
qint64 QH::qHash | ( | const DbAddress & | address | ) |
qHash This functions calls int 32 hash of address.
address | This is input address. |
Definition at line 16 of file dbaddress.cpp.
uint QH::qHash | ( | const HostAddress & | address | ) |
uint QH::qHash | ( | NodeCoonectionStatus | status | ) |
qHash - Simple hash function of NodeCoonectionStatus
status | - Input data. |
Definition at line 269 of file abstractnodeinfo.cpp.