forked from IfcOpenShell/IfcOpenShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXmlSerializer.h
More file actions
40 lines (28 loc) · 965 Bytes
/
Copy pathXmlSerializer.h
File metadata and controls
40 lines (28 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#define SCHEMA_METHOD
#include "../serializers/Serializer.h"
#include "../ifcparse/IfcFile.h"
#include <boost/function.hpp>
#include <map>
class XmlSerializer : public Serializer {
private:
XmlSerializer* implementation_;
protected:
std::string xml_filename;
public:
XmlSerializer(IfcParse::IfcFile* file, const std::string& xml_filename);
virtual ~XmlSerializer() {}
bool ready() { return true; }
void writeHeader() {}
void finalize() { implementation_->finalize(); }
void setFile(IfcParse::IfcFile*) { throw IfcParse::IfcException("Should be supplied on construction"); }
};
struct XmlSerializerFactory {
typedef boost::function2<XmlSerializer*, IfcParse::IfcFile*, std::string> fn;
class Factory : public std::map<std::string, fn> {
public:
Factory();
void bind(const std::string& schema_name, fn);
XmlSerializer* construct(const std::string& schema_name, IfcParse::IfcFile*, std::string);
};
static Factory& implementations();
};