Heart 1.3.848.aa44c26
Heart is base back end library for your c++ Qt projects.
|
The BigDataParser class is main manager for control big data packages. More...
#include <bigdataparser.h>
Public Member Functions | |
BigDataParser (AbstractNode *parentNode) | |
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. | |
The BigDataParser class is main manager for control big data packages.
Definition at line 36 of file bigdataparser.h.
QH::BigDataParser::BigDataParser | ( | AbstractNode * | parentNode | ) |
|
protected |
newPackage This method process first header packge of the big data.
header | This is header package. |
pkgHeader | This is header of an incomming package. |
sender | This is socket object of a sender that send this package. |
Definition at line 85 of file bigdataparser.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 31 of file bigdataparser.cpp.
|
overridevirtual |
parserId This is id of the parsers. All parser will be synced betwin nodes by ids.
Implements QH::iParser.
Definition at line 71 of file bigdataparser.cpp.
|
protected |
sendBigDataPackage This method separate big pacakge and sent only heder ot serve.
data | This is package that will be sent to remote node. |
sender | This is request object. |
pkgHeader | requested header. |
Definition at line 192 of file bigdataparser.cpp.
|
protected |
processPart This method process part of package
part | This is pacakge part. |
pkgHeader | This is header of an incomming package. |
sender | This is socket object of a sender that send this package. |
Definition at line 103 of file bigdataparser.cpp.
|
protected |
finishPart This metho process last package of big data transaction.
request | this is shared pointer to last part of big data transaction. |
pkgHeader | This is header of an incomming package. |
sender | This is socket object of a sender that send this package. |
Definition at line 159 of file bigdataparser.cpp.
|
overridevirtual |
version This method return version of parser object
Implements QH::iParser.
Definition at line 67 of file bigdataparser.cpp.