diff --git a/src/mesh/IBoundaryDescriptor.hpp b/src/mesh/IBoundaryDescriptor.hpp index 4e016c35b6e13204fee2cbc23cf9bedf1d6ca4c7..6d9c003c7f2915d34754e4bed79904815eab3363 100644 --- a/src/mesh/IBoundaryDescriptor.hpp +++ b/src/mesh/IBoundaryDescriptor.hpp @@ -19,18 +19,20 @@ class IBoundaryDescriptor public: friend std::ostream& - operator<<(std::ostream& os, const IBoundaryDescriptor& bd) + operator<<(std::ostream& os, const IBoundaryDescriptor& boundary_descriptor) { - return bd._write(os); + return boundary_descriptor._write(os); } - virtual bool operator==(const RefId& ref_id) const = 0; - friend bool - operator==(const RefId& ref_id, const IBoundaryDescriptor& bcd) + [[nodiscard]] virtual bool operator==(const RefId& ref_id) const = 0; + + [[nodiscard]] friend bool + operator==(const RefId& ref_id, const IBoundaryDescriptor& boundary_descriptor) { - return bcd == ref_id; + return boundary_descriptor == ref_id; } - virtual Type type() const = 0; + + [[nodiscard]] virtual Type type() const = 0; IBoundaryDescriptor(const IBoundaryDescriptor&) = delete; IBoundaryDescriptor(IBoundaryDescriptor&&) = delete; @@ -38,4 +40,5 @@ class IBoundaryDescriptor virtual ~IBoundaryDescriptor() = default; }; + #endif // I_BOUNDARY_DESCRIPTOR_HPP diff --git a/src/mesh/NamedBoundaryDescriptor.hpp b/src/mesh/NamedBoundaryDescriptor.hpp index 5d8959261ef37459a7ab449d3834c4f2e2050c79..7ee732c59df7814da24b684df9bed60f4676742c 100644 --- a/src/mesh/NamedBoundaryDescriptor.hpp +++ b/src/mesh/NamedBoundaryDescriptor.hpp @@ -6,7 +6,7 @@ #include <iostream> #include <string> -class NamedBoundaryDescriptor : public IBoundaryDescriptor +class NamedBoundaryDescriptor final : public IBoundaryDescriptor { private: std::string m_name; @@ -19,13 +19,13 @@ class NamedBoundaryDescriptor : public IBoundaryDescriptor } public: - bool + [[nodiscard]] bool operator==(const RefId& ref_id) const final { return m_name == ref_id.tagName(); } - Type + [[nodiscard]] Type type() const final { return Type::named; @@ -33,10 +33,7 @@ class NamedBoundaryDescriptor : public IBoundaryDescriptor NamedBoundaryDescriptor(const NamedBoundaryDescriptor&) = delete; NamedBoundaryDescriptor(NamedBoundaryDescriptor&&) = delete; - NamedBoundaryDescriptor(const std::string& name) : m_name(name) - { - ; - } + NamedBoundaryDescriptor(const std::string& name) : m_name(name) {} virtual ~NamedBoundaryDescriptor() = default; }; diff --git a/src/mesh/NumberedBoundaryDescriptor.hpp b/src/mesh/NumberedBoundaryDescriptor.hpp index 47aa7fa537f6f1070e48077cdee62aa28868782b..2abab93956f9fd2dc98a7d3967484444cba4a0fb 100644 --- a/src/mesh/NumberedBoundaryDescriptor.hpp +++ b/src/mesh/NumberedBoundaryDescriptor.hpp @@ -5,7 +5,7 @@ #include <iostream> -class NumberedBoundaryDescriptor : public IBoundaryDescriptor +class NumberedBoundaryDescriptor final : public IBoundaryDescriptor { private: unsigned int m_number; @@ -17,14 +17,14 @@ class NumberedBoundaryDescriptor : public IBoundaryDescriptor return os; } - bool + [[nodiscard]] bool operator==(const RefId& ref_id) const final { return m_number == ref_id.tagNumber(); } public: - Type + [[nodiscard]] Type type() const final { return Type::numbered;