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

The DbAddress class use to work with database addresses. Database Address it is structure with 2 values. More...

#include <dbaddress.h>

Inheritance diagram for QH::DbAddress:
Inheritance graph
Collaboration diagram for QH::DbAddress:
Collaboration graph

Public Member Functions

 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.
 

Friends

bool operator== (const DbAddress &left, const DbAddress &other)
 
bool operator!= (const DbAddress &left, const DbAddress &other)
 

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 DbAddress class use to work with database addresses. Database Address it is structure with 2 values.

{
QString _table; // this is name of table of object.
QVariant _id; // this is id of object.
}

Definition at line 24 of file dbaddress.h.

Constructor & Destructor Documentation

◆ DbAddress() [1/2]

QH::DbAddress::DbAddress ( )
default

◆ DbAddress() [2/2]

QH::DbAddress::DbAddress ( const QString &  table,
const QVariant &  id 
)

DbAddress this constructor initialize a default database address.

Parameters
tableThis is table name in database.
idThis is id of object in table.

Definition at line 20 of file dbaddress.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ fromStream()

QDataStream & QH::DbAddress::fromStream ( QDataStream &  stream)
virtual

fromStream This method should be read all bytes from the stream object and full the current object.

Note
The implementation of this method should be invoke a method of base class.
Parameters
streamThis is Qt stream object.
Returns
Qt stream object.

Examle of base simple implementation:

QDataStream &ExampleClass::fromStream(QDataStream &stream) const {
stream >> exampleMember;
return stream;
}
virtual QDataStream & toStream(QDataStream &stream) const =0
fromStream This method should be write all members of the current object to the stream object.

Implements QH::StreamBase.

Definition at line 31 of file dbaddress.cpp.

◆ id()

const QVariant & QH::DbAddress::id ( ) const

id This method return id of object in table.

Returns
id of object.

Definition at line 67 of file dbaddress.cpp.

Here is the caller graph for this function:

◆ isValid()

bool QH::DbAddress::isValid ( ) const

isValid This method check object for valid.

Returns
true if object is valid.

Definition at line 54 of file dbaddress.cpp.

Here is the caller graph for this function:

◆ setId()

void QH::DbAddress::setId ( const QVariant &  id)

setId This method set id for this address.

Parameters
idthis is new value of objects id.

Definition at line 71 of file dbaddress.cpp.

Here is the call graph for this function:

◆ setTable()

void QH::DbAddress::setTable ( const QString &  table)

setTable This method set new table name of address.

Parameters
tablenew value of table name.

Definition at line 62 of file dbaddress.cpp.

Here is the call graph for this function:

◆ SHA256Hash()

QByteArray QH::DbAddress::SHA256Hash ( ) const

SHA256Hash This method return address hash. This hash using into database.

Returns
return array of the hash of this address.

Definition at line 76 of file dbaddress.cpp.

Here is the caller graph for this function:

◆ table()

const QString & QH::DbAddress::table ( ) const

table This method return table name.

Returns
table name of object.

Definition at line 58 of file dbaddress.cpp.

Here is the caller graph for this function:

◆ toStream()

QDataStream & QH::DbAddress::toStream ( QDataStream &  stream) const
virtual

fromStream This method should be write all members of the current object to the stream object.

Note
The implementation of this method should be invoke a method of base class.
Parameters
streamThis is Qt stream object.
Returns
Qt stream object.

Examle of base simple implementation:

QDataStream &ExampleClass::toStream(QDataStream &stream) const {
stream << exampleMember;
return stream;
}

Implements QH::StreamBase.

Definition at line 39 of file dbaddress.cpp.

◆ toString()

QString QH::DbAddress::toString ( ) const

toString This method return a string implementation fo this object.

Returns
string of object.

Definition at line 45 of file dbaddress.cpp.

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const DbAddress left,
const DbAddress other 
)
friend

Definition at line 50 of file dbaddress.cpp.

◆ operator==

bool operator== ( const DbAddress left,
const DbAddress other 
)
friend

Definition at line 27 of file dbaddress.cpp.


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