mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 02:49:12 +00:00
Crazy factory implementation
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#include "IteratorImplementation.h"
|
||||
|
||||
template <typename P>
|
||||
IteratorFactoryImplementation<P>& iterator_implementations() {
|
||||
static IteratorFactoryImplementation<P> impl;
|
||||
return impl;
|
||||
}
|
||||
|
||||
template IteratorFactoryImplementation<float>& iterator_implementations<float>();
|
||||
template IteratorFactoryImplementation<double>& iterator_implementations<double>();
|
||||
|
||||
#define INIT(a) extern void init_##a(); init_##a();
|
||||
|
||||
template <typename P>
|
||||
IteratorFactoryImplementation<P>::IteratorFactoryImplementation() {
|
||||
INIT(IteratorImplementation_Ifc2x3);
|
||||
INIT(IteratorImplementation_Ifc4);
|
||||
}
|
||||
|
||||
template <class P>
|
||||
void IteratorFactoryImplementation<P>::bind(const std::string& schema_name, typename get_factory_type<P>::type fn) {
|
||||
this->insert(std::make_pair(schema_name, fn));
|
||||
}
|
||||
|
||||
template IteratorFactoryImplementation<float>;
|
||||
template IteratorFactoryImplementation<double>;
|
||||
Reference in New Issue
Block a user