12#include <qaglobalutils.h>
19 debug_assert(_node,
"All parsers shold be initialized with parent node");
28 return "NotProcessed";
30 default:
return "Error";
35 return _registeredTypes;
43 return _registeredTypes.contains(cmd);
63 return _multiVersionPackages;
71 for (
auto it = _registeredTypes.keyBegin();
it != _registeredTypes.keyEnd(); ++
it) {
The AbstractNodeInfo class contains information about client or server connection and tcp socket of n...
The AbstractNode class - Abstract implementation of node. this implementation have a methods for send...
virtual unsigned int sendData(const PKG::AbstractData *resp, const HostAddress &address, const Header *req=nullptr)
sendData This method send data object another to node
The Host Address class this is wrapper of QHostAddress. Contains the NetworkAddress and network port.
The AbstractData class is provide base functions for transport data by network For create you own pac...
QString toString() const override
virtual QString parserId() const =0
parserId This is id of the parsers. All parser will be synced betwin nodes by ids.
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
void registerPackageType()
registerPackageType This method register package type T. This is need to prepare pacakge for parsing ...
virtual void initSupportedCommands()
initSupportedCommands This method will be invoked before add a parser into parser's storage....
static QString pareseResultToString(const ParserResult &parseResult)
pareseResultToString This method convert ParserResult value to string.
bool checkCommand(unsigned short cmd) const
checkCommand This method check command are if registered type or not.
const PackagesVersionData & multiVersionPackages() const
multiVersionPackages return list of the supported multiversions packages.
QSharedPointer< PKG::AbstractData > genPackage(unsigned short cmd) const
genPackage This is factory method that generate data pacakge objects by command. All object should be...
AbstractNode * node() const
iParser(AbstractNode *parentNode)
const PacksMap & registeredTypes() const
registeredTypes This method return list of registered command.
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
ParserResult
The ParserResult enum. Error - parser detect a errorob package. NotProcessed - the parser does not kn...
@ NotProcessed
the parser does not know what to do with the package or has not finished processing it.
@ Processed
the parser finished processing correctly.
QHash< unsigned short, std::function< PKG::AbstractData *()> > PacksMap
PacksMap This is hash map where id is command of package and value is factory function.
QHash< unsigned short, DistVersion > PackagesVersionData
PackagesVersionData This is some as VersionData but for int commands.