Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
QH::DbAddressKey Class Reference

The DbAddressKey class is implementation for calc hash key of DbAddress objects. More...

#include <dbaddresskey.h>

Inheritance diagram for QH::DbAddressKey:
Inheritance graph
Collaboration diagram for QH::DbAddressKey:
Collaboration graph

Public Member Functions

 DbAddressKey ()
 
 DbAddressKey (const DbAddress &address)
 
 DbAddressKey (const QString &table, const QVariant &value)
 DbAddressKey This contructor it is vraper of DbAddress::DbAddress constructor.
 
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.
 
QString toString () const override
 toString This method should be return the string implementation of this key.
 
- Public Member Functions inherited from QH::DbAddress
 DbAddress ()=default
 
 DbAddress (const QString &table, const QVariant &id)
 DbAddress this constructor initialize a default database address.
 
QDataStream & fromStream (QDataStream &stream)
 fromStream This method should be read all bytes from the stream object and full the current object.
 
QDataStream & toStream (QDataStream &stream) const
 fromStream This method should be write all members of the current object to the stream object.
 
QString toString () const
 toString This method return a string implementation fo this object.
 
bool isValid () const
 isValid This method check object for valid.
 
const QString & table () const
 table This method return table name.
 
void setTable (const QString &table)
 setTable This method set new table name of address.
 
const QVariant & id () const
 id This method return id of object in table.
 
void setId (const QVariant &id)
 setId This method set id for this address.
 
QByteArray SHA256Hash () const
 SHA256Hash This method return address hash. This hash using into database.
 
- Public Member Functions inherited from QH::StreamBase
 StreamBase ()
 
virtual ~StreamBase ()
 
bool fromBytes (const QByteArray &data)
 fromBytes This method provide initialization of object from byte array.
 
QByteArray toBytes () const
 toBytes This method convert a current object to bytes array.
 
bool fromBase64 (const QString &data)
 fromBase64 This method provide initialization of object from the base64 string.
 
bool fromBase64 (const QByteArray &data)
 fromBase64 This method provide initialization of object from the base64 string.
 
QByteArray toBase64 () const
 toBase64 This method convert a current object to the base64 string.
 
template<class T >
T & copy (const StreamBase &right)
 copy This is base copy method for all StreamBase structures. Default implementation it is copy from byteArray.
 
template<class T >
bool compare (const T &right)
 compare This method compare array signatures of this and right objects.
 
- Public Member Functions inherited from QH::AbstractKey
 AbstractKey ()=default
 
virtual ~AbstractKey ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from QH::StreamBase
virtual int parsingVersion () const
 parsingVersion this method return parsing version of Qt. By Default is 0 (last available parsing). see https://doc.qt.io/qt-6/qdatastream.html#Version-enum
 
virtual unsigned int typeId () const
 typeId This method return id of type.
 

Detailed Description

The DbAddressKey class is implementation for calc hash key of DbAddress objects.

Definition at line 19 of file dbaddresskey.h.

Constructor & Destructor Documentation

◆ DbAddressKey() [1/3]

QH::DbAddressKey::DbAddressKey ( )

Definition at line 12 of file dbaddresskey.cpp.

◆ DbAddressKey() [2/3]

QH::DbAddressKey::DbAddressKey ( const DbAddress address)

Definition at line 16 of file dbaddresskey.cpp.

◆ DbAddressKey() [3/3]

QH::DbAddressKey::DbAddressKey ( const QString &  table,
const QVariant &  value 
)

DbAddressKey This contructor it is vraper of DbAddress::DbAddress constructor.

Parameters
tableThis is name of database table
valueThis is value of primary key.

Definition at line 21 of file dbaddresskey.cpp.

Member Function Documentation

◆ equal()

bool QH::DbAddressKey::equal ( const AbstractKey other) const
overridevirtual

equal This method must be make compare between current object and other.

Parameters
otherThis is other comparable object.
Returns
True if objects is equals.

Implements QH::AbstractKey.

Definition at line 30 of file dbaddresskey.cpp.

◆ hash()

unsigned int QH::DbAddressKey::hash ( ) const
overridevirtual

hash This method must be calc hash int32 code of source object.

Returns
Hash 32 bits.

Implements QH::AbstractKey.

Definition at line 26 of file dbaddresskey.cpp.

Here is the call graph for this function:

◆ isValid()

bool QH::DbAddressKey::isValid ( ) const
overridevirtual

isValid This method check this key object to valid.

Returns
True if key is valid.

Implements QH::AbstractKey.

Definition at line 39 of file dbaddresskey.cpp.

Here is the call graph for this function:

◆ toString()

QString QH::DbAddressKey::toString ( ) const
overridevirtual

toString This method should be return the string implementation of this key.

Returns
String value.

Implements QH::AbstractKey.

Definition at line 43 of file dbaddresskey.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: