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
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
......@@ -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;
};
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment