Heart 1.3.848.aa44c26
Heart is base back end library for your c++ Qt projects.
|
The AbstractNodeParser class is main parser of the abstract level of the hear lib. More...
#include <abstractnodeparser.h>
Signals | |
void | sigPingReceived (const QSharedPointer< QH::PKG::Ping > &ping) |
sigPingReceived This method emited | |
Public Member Functions | |
AbstractNodeParser (AbstractNode *parentNode) | |
~AbstractNodeParser () override | |
ParserResult | parsePackage (const QSharedPointer< PKG::AbstractData > &pkg, const Header &pkgHeader, AbstractNodeInfo *sender) override |
parsePackage This is main method of all childs classes of an AbstractNode class. This method work on own thread. If you ovveride 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. | |
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 pacakge 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 pacakges in the AbstractNode::parsePackage method. Exmaple 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 pacakge 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 AbstractNodeParser class is main parser of the abstract level of the hear lib.
Definition at line 20 of file abstractnodeparser.h.
QH::AbstractNodeParser::AbstractNodeParser | ( | AbstractNode * | parentNode | ) |
|
override |
Definition at line 27 of file abstractnodeparser.cpp.
|
overridevirtual |
parsePackage This is main method of all childs classes of an AbstractNode class. This method work on own thread. If you ovveride this method you need to create this than an example:
pkg | This is package with incomming data. |
sender | This is sender this pacakge. |
pkgHeader | This is header of the incoming packet is used to create a response. |
Implements QH::iParser.
Definition at line 30 of file abstractnodeparser.cpp.
|
overridevirtual |
parserId This is id of the parsers. All parser will be synced betwin nodes by ids.
Implements QH::iParser.
Definition at line 81 of file abstractnodeparser.cpp.
|
signal |
sigPingReceived This method emited
ping | this is received ping object. |
|
overridevirtual |
version This method return version of parser object
Implements QH::iParser.
Definition at line 77 of file abstractnodeparser.cpp.