4
1
mirror of https://github.com/QuasarApp/Heart.git synced 2025-05-13 09:59:42 +00:00
This commit is contained in:
Andrei Yankovich 2021-09-03 10:15:56 +03:00
parent 8db2b3bacb
commit 61eb5aa701
3 changed files with 22 additions and 19 deletions
Heart
AbstractSpace
DataBaseSpace/packages

@ -99,6 +99,7 @@ class Abstract;
* this implementation have a methods for send and receive data messages,
* and work with crypto method for crease a security connections betwin nodes.
* AbstractNode - is thread save class.
* @see AbstractData
*/
class HEARTSHARED_EXPORT AbstractNode : public QTcpServer, public SoftDelete
{

@ -70,36 +70,38 @@ protected:
* This method copyFrom supports copying between parent and child classes.
* Consider the situation:
* Classes A > B > C
\code{cpp}
A * a = new A;
A * b = new B;
A * c = new C;
\endcode
*
\code{cpp}
A * a = new A;
A * b = new B;
A * c = new C;
\endcode
* The situation when the classes have the same type.
* In this case, all object fields will be copied.
\code{cpp}
b.copyFrom (b1) // true
c.copyFrom (c1) // true
\endcode
\code{cpp}
b.copyFrom (b1) // true
c.copyFrom (c1) // true
\endcode
* The situation when the class Requesting data to be copied is a child of the class that is requesting data to be copied.
\code{cpp}
b.copyFrom (a) // false
c.copyFrom (a) // false
\endcode
\code{cpp}
b.copyFrom (a) // false
c.copyFrom (a) // false
\endcode
* In this case, copying will be partially performed and the result of calling the copyFrom method will be false, since the data has not been copied for all members of the child class.
* The situation when the class Requesting data to be copied is the parent of the class from which data to be copied is requested.
* In this case, all possible data will be copied and returned true.
\code{cpp}
a.copyFrom (b) // true
a.copyFrom (c) // true
\endcode
\code{cpp}
a.copyFrom (b) // true
a.copyFrom (c) // true
\endcode
* That is why it is important that the implementation of the copyFrom method is exactly the same as shown in the example.
* If the implementation of this method differs from the example, the data will not be copied correctly.
* @see AbstractNode
*/
class HEARTSHARED_EXPORT AbstractData : public StreamBase
{

@ -66,7 +66,6 @@ constexpr inline uint qHash(MemberType type) {
/**
* @brief The DBVariant struct contains QVariant value of the DBObjects member and it type.
* @see DataBaseNode
*/
struct HEARTSHARED_EXPORT DBVariant {
DBVariant();
@ -86,9 +85,10 @@ typedef QMap<QString, DBVariant> DBVariantMap;
/**
* @brief The DBObject class- main class for work with data base.
* @note If you set in the default constructor primaryKey to empty value. The your object disable cache support. for more information see the DBObject::isCached method.
* @note If you set in the default constructor primaryKey to empty value. The your object disable cache support. For more information see the DBObject::isCached method.
*
* @warning Object with empty table name is invalid.
* @see DataBaseNode
*/
class HEARTSHARED_EXPORT DBObject : public AbstractData, public ISubscribableData
{