From de3ad4c16044a5313d00a9c0e408e87ad75781dc Mon Sep 17 00:00:00 2001 From: Vasyl Skorych Date: Wed, 1 Jan 2025 19:51:57 +0100 Subject: [PATCH] docs: Add doc comments --- ModelsAPI/BaseUnit.h | 24 ++++++++++++++ ModelsAPI/MixtureEnthalpyLookup.h | 3 ++ ModelsAPI/PlotManager.h | 24 ++++++++++++++ ModelsAPI/StateVariable.h | 26 +++++++++++++++- ModelsAPI/UnitParameters.h | 36 ++++++++++++++------- ModelsAPI/UnitParametersManager.h | 24 ++++++++++++++ ModelsAPI/UnitPorts.h | 52 +++++++++++++++++++++++++++++-- 7 files changed, 174 insertions(+), 15 deletions(-) diff --git a/ModelsAPI/BaseUnit.h b/ModelsAPI/BaseUnit.h index 063faa50..581fce51 100644 --- a/ModelsAPI/BaseUnit.h +++ b/ModelsAPI/BaseUnit.h @@ -131,11 +131,35 @@ class CBaseUnit public: // TODO: initialize all pointers in constructor and make them references. + /** + * \private + * \brief Default constructor. + */ CBaseUnit() = default; + /** + * \private + * \brief Copy constructor. + */ CBaseUnit(const CBaseUnit& _other); + /** + * \private + * \brief Move constructor. + */ CBaseUnit(CBaseUnit&& _other) noexcept; + /** + * \private + * \brief Copy assignment operator. + */ CBaseUnit& operator=(CBaseUnit _other); + /** + * \private + * \brief Move assignment operator. + */ CBaseUnit& operator=(CBaseUnit&& _other) noexcept; + /** + * \private + * \brief Destructor. + */ virtual ~CBaseUnit() = default; /** diff --git a/ModelsAPI/MixtureEnthalpyLookup.h b/ModelsAPI/MixtureEnthalpyLookup.h index 02b817b2..54e7f2b1 100644 --- a/ModelsAPI/MixtureEnthalpyLookup.h +++ b/ModelsAPI/MixtureEnthalpyLookup.h @@ -40,6 +40,9 @@ class CMixtureEnthalpyLookup * \param _intervalsNumber Number of temperature intervals. */ CMixtureEnthalpyLookup(const CMaterialsDatabase* _materialsDB, std::vector _compounds, const SInterval& _limits, size_t _intervalsNumber); + /** + * \brief Copy constructor. + */ CMixtureEnthalpyLookup(const CMixtureEnthalpyLookup& _other) = default; /** diff --git a/ModelsAPI/PlotManager.h b/ModelsAPI/PlotManager.h index b62311b0..b3fd5531 100644 --- a/ModelsAPI/PlotManager.h +++ b/ModelsAPI/PlotManager.h @@ -452,11 +452,35 @@ class CPlotManager std::vector> m_plotsStored; ///< A copy of plots used to store data during cyclic recalculations. public: + /** + * \private + * \brief Default constructor. + */ CPlotManager() = default; + /** + * \private + * \brief Copy constructor. + */ CPlotManager(const CPlotManager& _other); + /** + * \private + * \brief Move constructor. + */ CPlotManager(CPlotManager&& _other) noexcept; + /** + * \private + * \brief Copy assignment operator. + */ CPlotManager& operator=(CPlotManager _other); + /** + * \private + * \brief Move assignment operator. + */ CPlotManager& operator=(CPlotManager&& _other) noexcept; + /** + * \private + * \brief Destructor. + */ ~CPlotManager() = default; /** diff --git a/ModelsAPI/StateVariable.h b/ModelsAPI/StateVariable.h index 5c2d2b93..67a0126c 100644 --- a/ModelsAPI/StateVariable.h +++ b/ModelsAPI/StateVariable.h @@ -22,7 +22,7 @@ class CH5Handler; */ class CStateVariable { - static const unsigned m_saveVersion{ 1 }; // Current version of the saving procedure. + static constexpr unsigned m_saveVersion{ 1 }; // Current version of the saving procedure. inline static const double m_eps{ 16 * std::numeric_limits::epsilon() }; @@ -144,11 +144,35 @@ class CStateVariablesManager std::vector> m_stateVariables; // Defined state variables. public: + /** + * \private + * \brief Default constructor. + */ CStateVariablesManager() = default; + /** + * \private + * \brief Copy constructor. + */ CStateVariablesManager(const CStateVariablesManager& _other); + /** + * \private + * \brief Move constructor. + */ CStateVariablesManager(CStateVariablesManager&& _other) noexcept; + /** + * \private + * \brief Copy assignment operator. + */ CStateVariablesManager& operator=(CStateVariablesManager _other); + /** + * \private + * \brief Move assignment operator. + */ CStateVariablesManager& operator=(CStateVariablesManager&& _other) noexcept; + /** + * \private + * \brief Destructor. + */ ~CStateVariablesManager() = default; /** diff --git a/ModelsAPI/UnitParameters.h b/ModelsAPI/UnitParameters.h index be2c093c..9b19fd87 100644 --- a/ModelsAPI/UnitParameters.h +++ b/ModelsAPI/UnitParameters.h @@ -86,7 +86,8 @@ class CBaseUnitParameter */ CBaseUnitParameter& operator=(CBaseUnitParameter&& _other) = default; - /* + /** + * \private * \brief Returns a non-managed pointer to a copy of this. */ [[nodiscard]] virtual CBaseUnitParameter* clone() const = 0; @@ -219,7 +220,8 @@ class CConstUnitParameter : public CBaseUnitParameter { } - /* + /** + * \private * \brief Returns a non-managed pointer to a copy of this. */ [[nodiscard]] CConstUnitParameter* clone() const override { return new CConstUnitParameter{ *this }; } @@ -372,7 +374,8 @@ class CListUnitParameter : public CBaseUnitParameter { } - /* + /** + * \private * \brief Returns a non-managed pointer to a copy of this. */ [[nodiscard]] CListUnitParameter* clone() const override { return new CListUnitParameter{ *this }; } @@ -569,7 +572,8 @@ class CDependentUnitParameter : public CBaseUnitParameter */ CDependentUnitParameter(std::string _valueName, double _valueInit, std::wstring _valueUnits, std::string _paramName, double _paramInit, std::wstring _paramUnits, std::string _description, double _valueMin, double _valueMax, double _paramMin, double _paramMax); - /* + /** + * \private * \brief Returns a non-managed pointer to a copy of this. */ [[nodiscard]] CDependentUnitParameter* clone() const override; @@ -784,7 +788,8 @@ class CTDUnitParameter : public CDependentUnitParameter */ CTDUnitParameter(std::string _name, std::wstring _units, std::string _description, double _min, double _max, double _value); - /* + /** + * \private * \brief Returns a non-managed pointer to a copy of this. */ [[nodiscard]] CTDUnitParameter* clone() const override; @@ -832,7 +837,8 @@ class CStringUnitParameter : public CBaseUnitParameter */ CStringUnitParameter(std::string _name, std::string _description, std::string _value); - /* + /** + * \private * \brief Returns a non-managed pointer to a copy of this. */ [[nodiscard]] CStringUnitParameter* clone() const override; @@ -906,7 +912,8 @@ class CCheckBoxUnitParameter : public CBaseUnitParameter */ CCheckBoxUnitParameter(std::string _name, std::string _description, bool _checked); - /* + /** + * \private * \brief Returns a non-managed pointer to a copy of this. */ [[nodiscard]] CCheckBoxUnitParameter* clone() const override; @@ -993,7 +1000,8 @@ class CSolverUnitParameter : public CBaseUnitParameter */ CSolverUnitParameter(std::string _name, std::string _description, ESolverTypes _type); - /* + /** + * \private * \brief Returns a non-managed pointer to a copy of this. */ [[nodiscard]] CSolverUnitParameter* clone() const override; @@ -1091,7 +1099,8 @@ class CComboUnitParameter : public CBaseUnitParameter */ CComboUnitParameter(std::string _name, std::string _description, size_t _itemDefault, const std::vector& _items, const std::vector& _itemsNames); - /* + /** + * \private * \brief Returns a non-managed pointer to a copy of this. */ [[nodiscard]] CComboUnitParameter* clone() const override; @@ -1206,7 +1215,8 @@ class CCompoundUnitParameter : public CBaseUnitParameter */ CCompoundUnitParameter(std::string _name, std::string _description); - /* + /** + * \private * \brief Returns a non-managed pointer to a copy of this. */ [[nodiscard]] CCompoundUnitParameter* clone() const override; @@ -1277,7 +1287,8 @@ class CMDBCompoundUnitParameter : public CCompoundUnitParameter */ CMDBCompoundUnitParameter(std::string _name, std::string _description); - /* + /** + * \private * \brief Returns a non-managed pointer to a copy of this. */ [[nodiscard]] CMDBCompoundUnitParameter* clone() const override; @@ -1303,7 +1314,8 @@ class CReactionUnitParameter : public CBaseUnitParameter */ CReactionUnitParameter(std::string _name, std::string _description); - /* + /** + * \private * \brief Returns a non-managed pointer to a copy of this. */ [[nodiscard]] CReactionUnitParameter* clone() const override; diff --git a/ModelsAPI/UnitParametersManager.h b/ModelsAPI/UnitParametersManager.h index bcea6edc..e7ba2ef6 100644 --- a/ModelsAPI/UnitParametersManager.h +++ b/ModelsAPI/UnitParametersManager.h @@ -29,11 +29,35 @@ class CUnitParametersManager group_map_t m_groups; ///< List of group blocks and corresponding groups, to which parameters belong. Is used to determine activity of parameters. public: + /** + * \private + * \brief Default constructor. + */ CUnitParametersManager() = default; + /** + * \private + * \brief Copy constructor. + */ CUnitParametersManager(const CUnitParametersManager& _other); + /** + * \private + * \brief Move constructor. + */ CUnitParametersManager(CUnitParametersManager&& _other) noexcept; + /** + * \private + * \brief Copy assignment operator. + */ CUnitParametersManager& operator=(CUnitParametersManager _other); + /** + * \private + * \brief Move assignment operator. + */ CUnitParametersManager& operator=(CUnitParametersManager&& _other) noexcept; + /** + * \private + * \brief Destructor. + */ ~CUnitParametersManager() = default; /** diff --git a/ModelsAPI/UnitPorts.h b/ModelsAPI/UnitPorts.h index f7d29f76..7c7613f1 100644 --- a/ModelsAPI/UnitPorts.h +++ b/ModelsAPI/UnitPorts.h @@ -32,17 +32,41 @@ class CUnitPort public: /** + * \private + * \brief Default constructor. + */ + CUnitPort() = default; + /** + * \private * \brief Constructs unit port with the given name and type. * \param _name Name of the port. * \param _type Type of the port. */ CUnitPort(std::string _name, EUnitPort _type); - - CUnitPort() = default; + /** + * \private + * \brief Copy constructor. + */ CUnitPort(const CUnitPort& _other) = default; + /** + * \private + * \brief Move constructor. + */ CUnitPort(CUnitPort&& _other) = default; + /** + * \private + * \brief Copy assignment operator. + */ CUnitPort& operator=(const CUnitPort& _other) = default; + /** + * \private + * \brief Move assignment operator. + */ CUnitPort& operator=(CUnitPort&& _other) = default; + /** + * \private + * \brief Destructor. + */ ~CUnitPort() = default; /** @@ -119,11 +143,35 @@ class CPortsManager std::vector> m_ports; // All defined ports. public: + /** + * \private + * \brief Default constructor. + */ CPortsManager() = default; + /** + * \private + * \brief Copy constructor. + */ CPortsManager(const CPortsManager& _other); + /** + * \private + * \brief Move constructor. + */ CPortsManager(CPortsManager&& _other) noexcept; + /** + * \private + * \brief Copy assignment operator. + */ CPortsManager& operator=(CPortsManager _other); + /** + * \private + * \brief Move assignment operator. + */ CPortsManager& operator=(CPortsManager&& _other) noexcept; + /** + * \private + * \brief Destructor. + */ ~CPortsManager() = default; /**