Heart 1.3.848.aa44c26
Heart is base back end library for your c++ Qt projects.
|
The AbstractNodeInfo class contains information about client or server connection and tcp socket of node. All node Info classes must be initialized in the AbstractNode::createNodeInfo methods. This implementation of nodeInf contains only trust of node and network socket. More...
#include <abstractnodeinfo.h>
Public Slots | |
virtual void | removeSocket () |
removeSocket This method use for remove socket. You can override this method for handle this event. | |
Signals | |
void | sigConnected (QH::AbstractNodeInfo *thisNode) |
sigConnected This is wrapper signal for the QAbstractSocket::connetced signal. | |
void | sigDisconnected (QH::AbstractNodeInfo *thisNode) |
sigDisconnected This is wrapper signal for the QAbstractSocket::disconnected signal. | |
void | sigReadyRead (QH::AbstractNodeInfo *thisNode) |
sigReadyRead This is wrapper signal for the QAbstractSocket::readyRead signal. | |
void | sigErrorOccurred (QH::AbstractNodeInfo *thisNode, QAbstractSocket::SocketError socketError, QString message) |
sigErrorOccurred This is wrapper signal for the QAbstractSocket::errorOccurred signal. | |
void | sigConfirmed (QH::AbstractNodeInfo *thisNode) |
sigConfirmed This signal emitted when node is confirmnd. The confirm status sets in the confirmData method. | |
void | statusChaned (QH::AbstractNodeInfo *thisNode, QH::NodeCoonectionStatus status) |
statusChaned This signal emitted when nodes status is changed. | |
Public Member Functions | |
AbstractNodeInfo (QAbstractSocket *sct=nullptr, const HostAddress *address=nullptr) | |
AbstractNodeInfo. | |
virtual | ~AbstractNodeInfo () |
~AbstractNodeInfo | |
QAbstractSocket * | sct () const |
sct This method return socket of connection. | |
virtual void | ban () |
ban This node, set trust value to 0. | |
virtual bool | isBanned () const |
isBanned - check node which banned. | |
virtual void | unBan () |
unBan - Set trust value of node to TrustNode::Restore. See TrustNode enum for more information. | |
virtual int | trust () const |
trust - Show current value of trust level node or client. | |
virtual void | setTrust (int trust) |
setTrust This method set manually value of this node trust. | |
virtual bool | isValid () const |
isValid - Check valid of node. This method check connect status of socket. | |
virtual bool | isConnected () const |
isConnected - Check of node connect status. | |
virtual void | reset () |
reset This method reset all fields of the nodeInfo. | |
QHostInfo * | info () const |
info - This method return Host domain information. For more information see the Qt Documentation about QHostInfo. | |
void | setInfo (const QHostInfo &info) |
setInfo - Set new host info for this node. | |
HostAddress | networkAddress () const |
networkAddress This method return network address of current node or client. | |
void | setNetworkAddress (const HostAddress &networkAddress) |
setNetworkAddress This method update network address of the current node. | |
NodeCoonectionStatus | status () const |
status This method return status of the node connection. | |
void | setStatus (const NodeCoonectionStatus &status) |
setStatus This method Sets new value of status node. | |
void | updateConfirmStatus () |
updateConfirmStatus This method invoked after process a received package and update confirm status of the node. | |
bool | isLocal () const |
isLocal return true if connection opened on this node. | |
void | setIsLocal (bool isLocal) |
setIsLocal This method sets local status for this Node. | |
void | setSct (QAbstractSocket *sct) |
setSct This method sets a new socket for this node or client. | |
const VersionData & | version () const |
version This method return version data structure; | |
void | setVersion (const VersionData &newVersion) |
setVersion This method sets new version data structure. | |
bool | fVersionReceived () const |
fVersionReceived This method return true if this node receive version information. | |
void | setFVersionReceived (bool newFVersionReceived) |
setFVersionReceived This method change the fVersionReceived flag. | |
bool | fVersionDelivered () const |
fVersionDelivered This method return true if this node delivere own version to the distanation node. | |
void | setFVersionDelivered (bool newFVersionDelivered) |
setFVersionDelivered This method change the fVersionDelivered flag. | |
QSharedPointer< QH::iParser > | getParser (unsigned short cmd) |
getParser This method return parser of choosed command. | |
QSharedPointer< QH::iParser > | getParser (const QString &type) |
getParser This method return parser of choosed command. | |
void | addParser (unsigned short cmd, QSharedPointer< QH::iParser > parser) |
addParser This method add to cache new parser for command . | |
void | addParser (QSharedPointer< QH::iParser > parser) |
addParser This method add to cache new parser for command . | |
const PackagesVersionData & | multiVersionPackages () const |
multiVersionPackages This is list of packages of one api package tah support multiple versions. | |
void | setMultiVersionPackages (const PackagesVersionData &newMultiVersionPackages) |
setMultiVersionPackages This method sets new list of multi-version packages. | |
Protected Member Functions | |
virtual bool | confirmData () const |
confirmData This method check all data of node and return true. If node is confirmed. | |
The AbstractNodeInfo class contains information about client or server connection and tcp socket of node. All node Info classes must be initialized in the AbstractNode::createNodeInfo methods. This implementation of nodeInf contains only trust of node and network socket.
Definition at line 67 of file abstractnodeinfo.h.
QH::AbstractNodeInfo::AbstractNodeInfo | ( | QAbstractSocket * | sct = nullptr , |
const HostAddress * | address = nullptr |
||
) |
sct | Socket of connection |
address | - Address of socket |
Definition at line 19 of file abstractnodeinfo.cpp.
|
virtual |
~AbstractNodeInfo
Definition at line 27 of file abstractnodeinfo.cpp.
void QH::AbstractNodeInfo::addParser | ( | QSharedPointer< QH::iParser > | parser | ) |
addParser This method add to cache new parser for command .
parser | This is added parser. |
void QH::AbstractNodeInfo::addParser | ( | unsigned short | cmd, |
QSharedPointer< QH::iParser > | parser | ||
) |
addParser This method add to cache new parser for command .
cmd | This is any command that support this parser. |
parser | This is added parser. |
Definition at line 249 of file abstractnodeinfo.cpp.
|
virtual |
ban This node, set trust value to 0.
Definition at line 59 of file abstractnodeinfo.cpp.
|
protectedvirtual |
confirmData This method check all data of node and return true. If node is confirmed.
Definition at line 130 of file abstractnodeinfo.cpp.
bool QH::AbstractNodeInfo::fVersionDelivered | ( | ) | const |
fVersionDelivered This method return true if this node delivere own version to the distanation node.
Definition at line 142 of file abstractnodeinfo.cpp.
bool QH::AbstractNodeInfo::fVersionReceived | ( | ) | const |
fVersionReceived This method return true if this node receive version information.
Definition at line 150 of file abstractnodeinfo.cpp.
QSharedPointer< iParser > QH::AbstractNodeInfo::getParser | ( | const QString & | type | ) |
getParser This method return parser of choosed command.
type | This is type of api parser. |
Definition at line 243 of file abstractnodeinfo.cpp.
QSharedPointer< QH::iParser > QH::AbstractNodeInfo::getParser | ( | unsigned short | cmd | ) |
getParser This method return parser of choosed command.
cmd | This is command that need to parse. |
Definition at line 237 of file abstractnodeinfo.cpp.
QHostInfo * QH::AbstractNodeInfo::info | ( | ) | const |
info - This method return Host domain information. For more information see the Qt Documentation about QHostInfo.
Definition at line 199 of file abstractnodeinfo.cpp.
|
virtual |
isBanned - check node which banned.
Definition at line 64 of file abstractnodeinfo.cpp.
|
virtual |
isConnected - Check of node connect status.
Definition at line 221 of file abstractnodeinfo.cpp.
bool QH::AbstractNodeInfo::isLocal | ( | ) | const |
isLocal return true if connection opened on this node.
Definition at line 171 of file abstractnodeinfo.cpp.
|
virtual |
isValid - Check valid of node. This method check connect status of socket.
Definition at line 217 of file abstractnodeinfo.cpp.
const PackagesVersionData & QH::AbstractNodeInfo::multiVersionPackages | ( | ) | const |
multiVersionPackages This is list of packages of one api package tah support multiple versions.
Definition at line 134 of file abstractnodeinfo.cpp.
HostAddress QH::AbstractNodeInfo::networkAddress | ( | ) | const |
networkAddress This method return network address of current node or client.
Definition at line 175 of file abstractnodeinfo.cpp.
|
virtualslot |
removeSocket This method use for remove socket. You can override this method for handle this event.
Definition at line 35 of file abstractnodeinfo.cpp.
|
virtual |
reset This method reset all fields of the nodeInfo.
Definition at line 225 of file abstractnodeinfo.cpp.
QAbstractSocket * QH::AbstractNodeInfo::sct | ( | ) | const |
sct This method return socket of connection.
Definition at line 31 of file abstractnodeinfo.cpp.
void QH::AbstractNodeInfo::setFVersionDelivered | ( | bool | newFVersionDelivered | ) |
setFVersionDelivered This method change the fVersionDelivered flag.
newFVersionDelivered | this is new value of the fVersionDelivered flag. |
Definition at line 146 of file abstractnodeinfo.cpp.
void QH::AbstractNodeInfo::setFVersionReceived | ( | bool | newFVersionReceived | ) |
setFVersionReceived This method change the fVersionReceived flag.
newFVersionReceived | this is new value of the fVersionReceived flag. |
Definition at line 154 of file abstractnodeinfo.cpp.
void QH::AbstractNodeInfo::setInfo | ( | const QHostInfo & | info | ) |
setInfo - Set new host info for this node.
info | - host info. |
Definition at line 192 of file abstractnodeinfo.cpp.
void QH::AbstractNodeInfo::setIsLocal | ( | bool | isLocal | ) |
setIsLocal This method sets local status for this Node.
isLocal | This is a new value. |
Definition at line 112 of file abstractnodeinfo.cpp.
void QH::AbstractNodeInfo::setMultiVersionPackages | ( | const PackagesVersionData & | newMultiVersionPackages | ) |
setMultiVersionPackages This method sets new list of multi-version packages.
newMultiVersionPackages | This is new value of multi-version packages. |
Definition at line 138 of file abstractnodeinfo.cpp.
void QH::AbstractNodeInfo::setNetworkAddress | ( | const HostAddress & | networkAddress | ) |
setNetworkAddress This method update network address of the current node.
networkAddress | new address. |
Definition at line 179 of file abstractnodeinfo.cpp.
void QH::AbstractNodeInfo::setSct | ( | QAbstractSocket * | sct | ) |
setSct This method sets a new socket for this node or client.
sct | This is a new valuse of the socket. |
Definition at line 72 of file abstractnodeinfo.cpp.
void QH::AbstractNodeInfo::setStatus | ( | const NodeCoonectionStatus & | status | ) |
setStatus This method Sets new value of status node.
status | This is a new status of the node. |
Definition at line 120 of file abstractnodeinfo.cpp.
|
virtual |
setTrust This method set manually value of this node trust.
trust | - new value. |
Definition at line 207 of file abstractnodeinfo.cpp.
void QH::AbstractNodeInfo::setVersion | ( | const VersionData & | newVersion | ) |
setVersion This method sets new version data structure.
newVersion | This is new values of the version. |
Definition at line 162 of file abstractnodeinfo.cpp.
|
signal |
sigConfirmed This signal emitted when node is confirmnd. The confirm status sets in the confirmData method.
thisNode | This is pointer to current object. |
|
signal |
sigConnected This is wrapper signal for the QAbstractSocket::connetced signal.
thisNode | This is pointer to current object. |
|
signal |
sigDisconnected This is wrapper signal for the QAbstractSocket::disconnected signal.
thisNode | This is pointer to current object. |
|
signal |
sigErrorOccurred This is wrapper signal for the QAbstractSocket::errorOccurred signal.
thisNode | This is pointer to current object. |
socketError | This is socket error code. |
message | This is a error string message. For more information see the QAbstractSocket::SocketError enum class. |
|
signal |
sigReadyRead This is wrapper signal for the QAbstractSocket::readyRead signal.
thisNode | This is pointer to current object. |
NodeCoonectionStatus QH::AbstractNodeInfo::status | ( | ) | const |
status This method return status of the node connection.
Definition at line 116 of file abstractnodeinfo.cpp.
|
signal |
statusChaned This signal emitted when nodes status is changed.
thisNode | This is pointer to current object. |
status | This is status of node. For more information see the NodeCoonectionStatus enum. |
|
virtual |
trust - Show current value of trust level node or client.
Definition at line 203 of file abstractnodeinfo.cpp.
|
virtual |
unBan - Set trust value of node to TrustNode::Restore. See TrustNode enum for more information.
Definition at line 68 of file abstractnodeinfo.cpp.
void QH::AbstractNodeInfo::updateConfirmStatus | ( | ) |
updateConfirmStatus This method invoked after process a received package and update confirm status of the node.
Definition at line 166 of file abstractnodeinfo.cpp.
const VersionData & QH::AbstractNodeInfo::version | ( | ) | const |
version This method return version data structure;
Definition at line 158 of file abstractnodeinfo.cpp.