- bool contains(Structure* structure) const
- {
- for (size_t i = 0; i < m_structures.size(); ++i) {
- if (m_structures[i] == structure)
- return true;
- }
- return false;
- }
-
- bool containsOnly(Structure* structure) const
- {
- if (size() != 1)
- return false;
- return singletonStructure() == structure;
- }
-
- bool isSubsetOf(const StructureSet& other) const
- {
- for (size_t i = 0; i < m_structures.size(); ++i) {
- if (!other.contains(m_structures[i]))
- return false;
- }
- return true;
- }
-
- bool isSupersetOf(const StructureSet& other) const
- {
- return other.isSubsetOf(*this);
- }
-
- size_t size() const { return m_structures.size(); }
-
- // Call this if you know that the structure set must consist of exactly
- // one structure.
- Structure* singletonStructure() const