Index: sources/model/MAbstract.h =================================================================== diff -u -r56e378f7504701b9e9a9dccaf205aef2fd52c58e -r12e7b6dda53cf8db7707c7fa55dcf6137e7d6997 --- sources/model/MAbstract.h (.../MAbstract.h) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) +++ sources/model/MAbstract.h (.../MAbstract.h) (revision 12e7b6dda53cf8db7707c7fa55dcf6137e7d6997) @@ -23,6 +23,12 @@ namespace Model { +/*! + * \brief The MAbstract class + * \details All the Message Models has to be inherited from MAbstract + * As this class is abstract it dictates children to implement required methods. + * And also implements some some share methods to ease implementing Models. + */ class MAbstract { private: @@ -33,7 +39,8 @@ enum class Type_Enum { eDatum, eEvent, - }; + }; + enum class Unit_Enum { eUI, eHD, @@ -53,18 +60,43 @@ }; public: - // the model needs to implement these since each model have different meaning of the bytes from different source(unit). + + /*! + * \brief fromByteArray + * \details converts the values from Byte Arrays to the Model data. + * \param vByteArray - the byte array input + * \param vIndex - current index of each data section in byte array + * \return true on successful conversion + */ virtual bool fromByteArray(const QByteArray &vByteArray , int *vIndex = nullptr) = 0; + /*! + * \brief typeText + * \details type of the model which can be Data or Event which is mostly used in logging. + * \return Enum of Types + */ virtual Type_Enum typeText ( ) const = 0; + /*! + * \brief unitText + * \details the unit which UI communicates with by using this model and is used in Logging mostly + * \return Enum of Units + */ virtual Unit_Enum unitText ( ) const = 0; + /*! + * \brief infoText + * \details the text description of the model which will be used in the logging. + * \return QString + */ virtual QString infoText ( ) const = 0; + /*! + * \brief parameters + * \return current data values of the models. + */ virtual QVariantList parameters ( ) const = 0; - // Non-virtuals which working with parameters virtual method. + // Non-virtual methods which working with parameters virtual method. void toVariantList(QVariantList &vData) const; QString toString ( ) const; QString description ( ) const; }; - }