8#ifndef ABSTRACTNODEINFO_H
9#define ABSTRACTNODEINFO_H
88 QAbstractSocket *sct()
const;
99 virtual bool isBanned()
const;
105 virtual void unBan();
111 virtual int trust()
const;
117 virtual void setTrust(
int trust);
123 virtual bool isValid()
const;
129 virtual bool isConnected()
const;
135 virtual void reset();
142 QHostInfo *info()
const;
148 void setInfo(
const QHostInfo &info);
160 void setNetworkAddress(
const HostAddress &networkAddress);
177 void updateConfirmStatus();
183 bool isLocal()
const;
189 void setIsLocal(
bool isLocal);
195 void setSct(QAbstractSocket *sct);
213 bool fVersionReceived()
const;
219 void setFVersionReceived(
bool newFVersionReceived);
225 bool fVersionDelivered()
const;
231 void setFVersionDelivered(
bool newFVersionDelivered);
238 QSharedPointer<QH::iParser> getParser(
unsigned short cmd);
245 QSharedPointer<QH::iParser> getParser(
const QString& type);
253 void addParser(
unsigned short cmd, QSharedPointer<QH::iParser> parser);
280 virtual void removeSocket();
310 QAbstractSocket::SocketError socketError,
333 virtual bool confirmData()
const;
338 QHostInfo *_info =
nullptr;
341 QAbstractSocket *_sct =
nullptr;
342 int _trust =
static_cast<int>(TrustNode::Default);
344 bool _isLocal =
false;
346 QHash<unsigned short, QSharedPointer<iParser>> _parsersMap;
347 QHash<QString, QSharedPointer<iParser>> _parsersKeysMap;
348 QMutex _parsersListMutex;
355 bool _fVersionReceived =
false;
356 bool _fVersionDelivered =
false;
The AbstractNodeInfo class contains information about client or server connection and tcp socket of n...
void sigReadyRead(QH::AbstractNodeInfo *thisNode)
sigReadyRead This is wrapper signal for the QAbstractSocket::readyRead signal.
void addParser(QSharedPointer< QH::iParser > parser)
addParser This method add to cache new parser for command .
void statusChaned(QH::AbstractNodeInfo *thisNode, QH::NodeCoonectionStatus status)
statusChaned This signal emitted when nodes status is changed.
void sigConfirmed(QH::AbstractNodeInfo *thisNode)
sigConfirmed This signal emitted when node is confirmnd. The confirm status sets in the confirmData m...
void sigConnected(QH::AbstractNodeInfo *thisNode)
sigConnected This is wrapper signal for the QAbstractSocket::connetced signal.
void sigErrorOccurred(QH::AbstractNodeInfo *thisNode, QAbstractSocket::SocketError socketError, QString message)
sigErrorOccurred This is wrapper signal for the QAbstractSocket::errorOccurred signal.
void sigDisconnected(QH::AbstractNodeInfo *thisNode)
sigDisconnected This is wrapper signal for the QAbstractSocket::disconnected signal.
The Host Address class this is wrapper of QHostAddress. Contains the NetworkAddress and network port.
#define HEARTSHARED_EXPORT
Q_DECLARE_METATYPE(QH::HostAddress)
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
uint qHash(NodeCoonectionStatus status)
qHash - Simple hash function of NodeCoonectionStatus
NodeCoonectionStatus
The AbstractNodeState enum - This is status of the known nodes or clients.
@ Connected
The node with this status has socket status is connected.
@ NotConnected
This node not sent data about its envirement and status of node socket is disconnected.
QHash< QString, DistVersion > VersionData
VersionData This is array of all available apis and supported its versions.
TrustNode
The TrustNode enum contains cases for trust of the client or nodes.
@ Default
General trust of the node or client.
@ Baned
Node with this trust value is forbidden.
@ Undefined
Undefined node.
QHash< unsigned short, DistVersion > PackagesVersionData
PackagesVersionData This is some as VersionData but for int commands.