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

BoundaryDescriptor now compares to RefId

parent 77e6ceeb
Branches
Tags
No related merge requests found
......@@ -23,6 +23,11 @@ class BoundaryDescriptor
return bd._write(os);
}
virtual bool operator==(const RefId& ref_id) const =0;
friend bool operator==(const RefId& ref_id, const BoundaryDescriptor& bcd)
{
return bcd == ref_id;
}
virtual Type type() const = 0;
BoundaryDescriptor(const BoundaryDescriptor&) = default;
BoundaryDescriptor() = default;
......@@ -42,6 +47,11 @@ class NamedBoundaryDescriptor
}
public:
bool operator==(const RefId& ref_id) const final
{
return m_name == ref_id.tagName();
}
Type type() const final
{
return Type::named;
......@@ -60,7 +70,7 @@ class NumberedBoundaryDescriptor
: public BoundaryDescriptor
{
private:
int m_number;
unsigned int m_number;
std::ostream& _write(std::ostream& os) const final
{
......@@ -68,6 +78,11 @@ class NumberedBoundaryDescriptor
return os;
}
bool operator==(const RefId& ref_id) const final
{
return m_number == ref_id.tagNumber();
}
public:
Type type() const final
{
......@@ -75,7 +90,7 @@ class NumberedBoundaryDescriptor
}
NumberedBoundaryDescriptor(const NumberedBoundaryDescriptor&) = default;
NumberedBoundaryDescriptor(const int& number)
NumberedBoundaryDescriptor(const unsigned int& number)
: m_number(number)
{
;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment