![]() |
Heart 1.4.984.b4712811
Heart is base back end library for your c++ Qt projects.
|
The APIVersionParser class This is main parser for the main command. This parsers work only with the APIVersion package;. More...
#include <apiversionparser.h>


Signals | |
| void | sigNoLongerSupport (const QString &ApiKey, unsigned short version) |
| sigNoLongerSupport This signal will be emit when node receive incomplite versions. | |
Public Member Functions | |
| APIVersionParser (AbstractNode *node) | |
| ParserResult | parsePackage (const QSharedPointer< PKG::AbstractData > &pkg, const Header &pkgHeader, AbstractNodeInfo *sender) override |
| parsePackage This is main method of all children classes of an AbstractNode class. This method work on own thread. If you override this method you need to create this than an example: | |
| int | version () const override |
| version This method return version of parser object | |
| QString | parserId () const override |
| parserId This is id of the parsers. All parser will be synced betwin nodes by ids. | |
| QString | toString () const override |
| toString This method show all supported commands and them names. | |
| QSharedPointer< PKG::AbstractData > | searchPackage (unsigned short cmd, AbstractNodeInfo *sender) const |
| searchPackage This method search package recursive in all registered pararsers. Searching will be in compatibility versions. Before search method choose compatibly version. | |
| QSharedPointer< iParser > | getSelectedApiParser (const QString &apiKey, QH::AbstractNodeInfo *node) const |
| getSelectedApiParser This method return apiParser for selected node | |
| const QSharedPointer< QH::iParser > & | addApiParser (const QSharedPointer< QH::iParser > &parserObject) |
| addApiParser This method add new Api parser for this node. | |
| QHash< QString, QSharedPointer< QH::iParser > > | selectParser (const VersionData &distVersion) const |
| selectParser This method select api parser betwin nodes. | |
| unsigned int | parsersTypedCount () const |
| parsersTypedCount This method return count of the parsers types. | |
| QSharedPointer< QH::iParser > | selectParser (unsigned short cmd, AbstractNodeInfo *sender) const |
| selectParser This method select parser by command and sender. | |
| QSharedPointer< QH::iParser > | selectParser (const QString &parserKey, unsigned short version) const |
| selectParser This method select parser by command and sender. | |
| QSharedPointer< QH::iParser > | selectParser (const QString &parserKey, AbstractNodeInfo *sender) const |
| selectParser This method select parser by command and sender. | |
| unsigned short | maximumApiVersion (const QString &apiKey) const |
| maximumApiVersion This method return maximum supported api version of this node. | |
| unsigned short | minimumApiVersion (const QString &apiKey) const |
| minimumApiVersion This method return minimum supported api version of this node. | |
| bool | sendSupportedAPI (AbstractNodeInfo *dist) const |
| sendSupportedAPI This method sents all ainformation about supported api. | |
| unsigned short | selectPackageVersion (const VersionData &local, const VersionData &dist) |
| Public Member Functions inherited from QH::iParser | |
| iParser (AbstractNode *parentNode) | |
| virtual | ~iParser ()=default |
| template<class T> | |
| void | registerPackageType () |
| registerPackageType This method register package type T. This is need to prepare package for parsing in the parsePackage method. | |
| template<class PackageClass, class HandlerType, class HandlerMethod> | |
| ParserResult | commandHandler (HandlerType handlerObject, HandlerMethod method, const QSharedPointer< QH::PKG::AbstractData > &pkg, QH::AbstractNodeInfo *sender, const QH::Header &pkgHeader) |
| commandHandler This method it is simple wrapper for the handle packages in the AbstractNode::parsePackage method. Example of use : | |
| const PacksMap & | registeredTypes () const |
| registeredTypes This method return list of registered command. | |
| QSharedPointer< PKG::AbstractData > | genPackage (unsigned short cmd) const |
| genPackage This is factory method that generate data package objects by command. All object should be registered before using this method. | |
| bool | checkCommand (unsigned short cmd) const |
| checkCommand This method check command are if registered type or not. | |
| virtual void | initSupportedCommands () |
| initSupportedCommands This method will be invoked before add a parser into parser's storage. Use this method to register your command for this parser object. By default, this method does nothing, You still can register your command in the class constructor. But if you use inheritance between your APIs versions to you must use this method, because your constructors both all your commands, this broken API selector of your node. | |
| QString | toString () const override |
| const PackagesVersionData & | multiVersionPackages () const |
| multiVersionPackages return list of the supported multiversions packages. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from QH::iParser | |
| static QString | pareseResultToString (const ParserResult &parseResult) |
| pareseResultToString This method convert ParserResult value to string. | |
| Protected Member Functions inherited from QH::iParser | |
| AbstractNode * | node () const |
| virtual unsigned int | sendData (const PKG::AbstractData *resp, const HostAddress &address, const Header *req=nullptr) const |
| sendData This method send data object another to node | |
| virtual unsigned int | sendData (const PKG::AbstractData *resp, const AbstractNodeInfo *node, const Header *req=nullptr) const |
| sendData This method send data object another to node | |
The APIVersionParser class This is main parser for the main command. This parsers work only with the APIVersion package;.
Definition at line 26 of file apiversionparser.h.
| QH::APIVersionParser::APIVersionParser | ( | AbstractNode * | node | ) |
Definition at line 20 of file apiversionparser.cpp.


| const QSharedPointer< QH::iParser > & QH::APIVersionParser::addApiParser | ( | const QSharedPointer< QH::iParser > & | parserObject | ) |
addApiParser This method add new Api parser for this node.
| parserObject | This is bew api parser. |
Definition at line 158 of file apiversionparser.cpp.
| QSharedPointer< iParser > QH::APIVersionParser::getSelectedApiParser | ( | const QString & | apiKey, |
| QH::AbstractNodeInfo * | node ) const |
getSelectedApiParser This method return apiParser for selected node
| apiKey | This is key of needed api. |
| node | This is destination node. |
Definition at line 113 of file apiversionparser.cpp.

| unsigned short QH::APIVersionParser::maximumApiVersion | ( | const QString & | apiKey | ) | const |
maximumApiVersion This method return maximum supported api version of this node.
| apiKey | This is api key. |
Definition at line 253 of file apiversionparser.cpp.
| unsigned short QH::APIVersionParser::minimumApiVersion | ( | const QString & | apiKey | ) | const |
minimumApiVersion This method return minimum supported api version of this node.
| apiKey | This is api key. |
Definition at line 263 of file apiversionparser.cpp.
|
overridevirtual |
parsePackage This is main method of all children classes of an AbstractNode class. This method work on own thread. If you override this method you need to create this than an example:
| pkg | This is package with incoming data. |
| sender | This is sender this package. |
| pkgHeader | This is header of the incoming packet is used to create a response. |
Implements QH::iParser.
Definition at line 24 of file apiversionparser.cpp.

|
overridevirtual |
parserId This is id of the parsers. All parser will be synced betwin nodes by ids.
Implements QH::iParser.
Definition at line 63 of file apiversionparser.cpp.
| unsigned int QH::APIVersionParser::parsersTypedCount | ( | ) | const |
parsersTypedCount This method return count of the parsers types.
Definition at line 190 of file apiversionparser.cpp.
| QSharedPointer< PKG::AbstractData > QH::APIVersionParser::searchPackage | ( | unsigned short | cmd, |
| AbstractNodeInfo * | sender ) const |
searchPackage This method search package recursive in all registered pararsers. Searching will be in compatibility versions. Before search method choose compatibly version.
| cmd | This is command for that should be create package object. |
| ver | This is version for that should be create package object. |
| sender | This is node that sent the cmd. |
Definition at line 81 of file apiversionparser.cpp.

| unsigned short QH::APIVersionParser::selectPackageVersion | ( | const VersionData & | local, |
| const VersionData & | dist ) |
| QSharedPointer< iParser > QH::APIVersionParser::selectParser | ( | const QString & | parserKey, |
| AbstractNodeInfo * | sender ) const |
selectParser This method select parser by command and sender.
| parserKey | this is key of the parser type.. |
| sender | this is node that sent this command. |
Definition at line 204 of file apiversionparser.cpp.

| QSharedPointer< iParser > QH::APIVersionParser::selectParser | ( | const QString & | parserKey, |
| unsigned short | version ) const |
selectParser This method select parser by command and sender.
| parserKey | this is key of the parser type.. |
| version | this is needed version. |
Definition at line 217 of file apiversionparser.cpp.

| QHash< QString, QSharedPointer< iParser > > QH::APIVersionParser::selectParser | ( | const VersionData & | distVersion | ) | const |
selectParser This method select api parser betwin nodes.
| distVersion | This is information about destination node version. |
Definition at line 174 of file apiversionparser.cpp.


| QSharedPointer< iParser > QH::APIVersionParser::selectParser | ( | unsigned short | cmd, |
| AbstractNodeInfo * | sender ) const |
selectParser This method select parser by command and sender.
| cmd | this is command that need to parse. |
| sender | this is node that sent this command. |
Definition at line 194 of file apiversionparser.cpp.

| bool QH::APIVersionParser::sendSupportedAPI | ( | AbstractNodeInfo * | dist | ) | const |
sendSupportedAPI This method sents all ainformation about supported api.
| dist | This is destination node. |
Definition at line 272 of file apiversionparser.cpp.

|
signal |
sigNoLongerSupport This signal will be emit when node receive incomplite versions.
| ApiKey | This is key of not supported version. |
| version | This is version |


|
override |
toString This method show all supported commands and them names.
Definition at line 67 of file apiversionparser.cpp.

|
overridevirtual |
version This method return version of parser object
Implements QH::iParser.
Definition at line 59 of file apiversionparser.cpp.
