Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
dbaddresskey.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2024 QuasarApp.
3 * Distributed under the lgplv3 software license, see the accompanying
4 * Everyone is permitted to copy and distribute verbatim copies
5 * of this license document, but changing it is not allowed.
6*/
7
8
9#include "dbaddresskey.h"
10namespace QH {
11
15
17 DbAddress(address) {
18
19}
20
21DbAddressKey::DbAddressKey(const QString &table, const QVariant &value):
22 DbAddress(table, value) {
23
24}
25
26unsigned int DbAddressKey::hash() const {
27 return qHash(*static_cast<const DbAddress*>(this));
28}
29
30bool DbAddressKey::equal(const AbstractKey *other) const {
31 auto otherObject = dynamic_cast<const DbAddressKey*>(other);
32
33 if (!otherObject)
34 return false;
35
36 return operator==(*static_cast<const DbAddress*>(this), *otherObject);
37}
38
40 return DbAddress::isValid();
41}
42
43QString DbAddressKey::toString() const {
44 return DbAddress::toString();
45}
46}
The Abstractkey class is provide general hash function for all keys of Heart library....
Definition abstractkey.h:19
The DbAddressKey class is implementation for calc hash key of DbAddress objects.
QString toString() const override
toString This method should be return the string implementation of this key.
unsigned int hash() const override
hash This method must be calc hash int32 code of source object.
bool equal(const AbstractKey *other) const override
equal This method must be make compare between current object and other.
bool isValid() const override
isValid This method check this key object to valid.
The DbAddress class use to work with database addresses. Database Address it is structure with 2 valu...
Definition dbaddress.h:24
QString toString() const
toString This method return a string implementation fo this object.
Definition dbaddress.cpp:45
friend bool operator==(const DbAddress &left, const DbAddress &other)
Definition dbaddress.cpp:27
bool isValid() const
isValid This method check object for valid.
Definition dbaddress.cpp:54
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition heart.cpp:13
uint qHash(NodeCoonectionStatus status)
qHash - Simple hash function of NodeCoonectionStatus