Skip to content
Snippets Groups Projects
Commit 75ecd2e5 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Cosmetic clean-up

parent 4ae247d5
No related branches found
No related tags found
1 merge request!136Displace NamedBoundaryDescriptor and NumberedBoundaryDescriptor
...@@ -19,18 +19,20 @@ class IBoundaryDescriptor ...@@ -19,18 +19,20 @@ class IBoundaryDescriptor
public: public:
friend std::ostream& 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; [[nodiscard]] virtual bool operator==(const RefId& ref_id) const = 0;
friend bool
operator==(const RefId& ref_id, const IBoundaryDescriptor& bcd) [[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(const IBoundaryDescriptor&) = delete;
IBoundaryDescriptor(IBoundaryDescriptor&&) = delete; IBoundaryDescriptor(IBoundaryDescriptor&&) = delete;
...@@ -38,4 +40,5 @@ class IBoundaryDescriptor ...@@ -38,4 +40,5 @@ class IBoundaryDescriptor
virtual ~IBoundaryDescriptor() = default; virtual ~IBoundaryDescriptor() = default;
}; };
#endif // I_BOUNDARY_DESCRIPTOR_HPP #endif // I_BOUNDARY_DESCRIPTOR_HPP
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
class NamedBoundaryDescriptor : public IBoundaryDescriptor class NamedBoundaryDescriptor final : public IBoundaryDescriptor
{ {
private: private:
std::string m_name; std::string m_name;
...@@ -19,13 +19,13 @@ class NamedBoundaryDescriptor : public IBoundaryDescriptor ...@@ -19,13 +19,13 @@ class NamedBoundaryDescriptor : public IBoundaryDescriptor
} }
public: public:
bool [[nodiscard]] bool
operator==(const RefId& ref_id) const final operator==(const RefId& ref_id) const final
{ {
return m_name == ref_id.tagName(); return m_name == ref_id.tagName();
} }
Type [[nodiscard]] Type
type() const final type() const final
{ {
return Type::named; return Type::named;
...@@ -33,10 +33,7 @@ class NamedBoundaryDescriptor : public IBoundaryDescriptor ...@@ -33,10 +33,7 @@ class NamedBoundaryDescriptor : public IBoundaryDescriptor
NamedBoundaryDescriptor(const NamedBoundaryDescriptor&) = delete; NamedBoundaryDescriptor(const NamedBoundaryDescriptor&) = delete;
NamedBoundaryDescriptor(NamedBoundaryDescriptor&&) = delete; NamedBoundaryDescriptor(NamedBoundaryDescriptor&&) = delete;
NamedBoundaryDescriptor(const std::string& name) : m_name(name) NamedBoundaryDescriptor(const std::string& name) : m_name(name) {}
{
;
}
virtual ~NamedBoundaryDescriptor() = default; virtual ~NamedBoundaryDescriptor() = default;
}; };
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <iostream> #include <iostream>
class NumberedBoundaryDescriptor : public IBoundaryDescriptor class NumberedBoundaryDescriptor final : public IBoundaryDescriptor
{ {
private: private:
unsigned int m_number; unsigned int m_number;
...@@ -17,14 +17,14 @@ class NumberedBoundaryDescriptor : public IBoundaryDescriptor ...@@ -17,14 +17,14 @@ class NumberedBoundaryDescriptor : public IBoundaryDescriptor
return os; return os;
} }
bool [[nodiscard]] bool
operator==(const RefId& ref_id) const final operator==(const RefId& ref_id) const final
{ {
return m_number == ref_id.tagNumber(); return m_number == ref_id.tagNumber();
} }
public: public:
Type [[nodiscard]] Type
type() const final type() const final
{ {
return Type::numbered; return Type::numbered;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment