#ifndef ITERATOR_IMPLEMENTATION_H #define ITERATOR_IMPLEMENTATION_H #include "../ifcparse/IfcFile.h" #include "../ifcgeom/IfcGeomIteratorSettings.h" #include #include #include namespace IfcGeom { template class IteratorImplementation; template class Element; template class BRepElement; } typedef boost::function2*, const IfcGeom::IteratorSettings&, IfcParse::IfcFile*> iterator_float_float_fn; typedef boost::function2*, const IfcGeom::IteratorSettings&, IfcParse::IfcFile*> iterator_float_double_fn; typedef boost::function2*, const IfcGeom::IteratorSettings&, IfcParse::IfcFile*> iterator_double_double_fn; template struct get_factory_type {}; template <> struct get_factory_type { typedef iterator_float_float_fn type; }; template <> struct get_factory_type { typedef iterator_float_double_fn type; }; template <> struct get_factory_type { typedef iterator_double_double_fn type; }; template class IteratorFactoryImplementation : public std::map::type> { public: IteratorFactoryImplementation(); void bind(const std::string& schema_name, typename get_factory_type::type fn); IfcGeom::IteratorImplementation* construct(const std::string& schema_name, const IfcGeom::IteratorSettings&, IfcParse::IfcFile*); }; template IteratorFactoryImplementation& iterator_implementations(); namespace IfcGeom { template class IteratorImplementation { public: virtual bool initialize() = 0; virtual int progress() const = 0; virtual const std::string& getUnitName() const = 0; virtual double getUnitMagnitude() const = 0; virtual IfcParse::IfcFile* file() const = 0; virtual IfcUtil::IfcBaseClass* next() = 0; virtual Element* get() = 0; virtual BRepElement* get_native() = 0; virtual const Element* get_object(int id) = 0; virtual IfcUtil::IfcBaseClass* create() = 0; }; } #endif