mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
+21
-4
@@ -42,7 +42,7 @@ public:
|
|||||||
typedef std::map<unsigned int, std::vector<unsigned int> > entities_by_ref_t;
|
typedef std::map<unsigned int, std::vector<unsigned int> > entities_by_ref_t;
|
||||||
typedef entity_by_id_t::const_iterator const_iterator;
|
typedef entity_by_id_t::const_iterator const_iterator;
|
||||||
|
|
||||||
class type_iterator : public entities_by_type_t::const_iterator {
|
class type_iterator : private entities_by_type_t::const_iterator {
|
||||||
public:
|
public:
|
||||||
type_iterator() : entities_by_type_t::const_iterator() {};
|
type_iterator() : entities_by_type_t::const_iterator() {};
|
||||||
|
|
||||||
@@ -54,12 +54,20 @@ public:
|
|||||||
return &entities_by_type_t::const_iterator::operator->()->first;
|
return &entities_by_type_t::const_iterator::operator->()->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
const entities_by_type_t::key_type& operator*() const {
|
entities_by_type_t::key_type const & operator*() const {
|
||||||
return entities_by_type_t::const_iterator::operator*().first;
|
return entities_by_type_t::const_iterator::operator*().first;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& as_string() const {
|
type_iterator& operator++() {
|
||||||
return (**this)->name();
|
entities_by_type_t::const_iterator::operator++(); return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
type_iterator operator++(int) {
|
||||||
|
type_iterator tmp(*this); operator++(); return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator!=(const type_iterator& other) const {
|
||||||
|
return entities_by_type_t::const_iterator::operator!=(other);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -219,4 +227,13 @@ IFC_PARSE_API IfcFile* parse_ifcxml(const std::string& filename);
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct std::iterator_traits<IfcParse::IfcFile::type_iterator> {
|
||||||
|
typedef ptrdiff_t difference_type;
|
||||||
|
typedef const IfcParse::declaration* value_type;
|
||||||
|
typedef const IfcParse::declaration*& reference;
|
||||||
|
typedef const IfcParse::declaration** pointer;
|
||||||
|
typedef std::forward_iterator_tag iterator_category;
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user