Pass around non-static logger instances and programmatic access to messages in-memory

This commit is contained in:
Thomas Krijnen
2026-06-10 18:30:54 +02:00
parent a751fb956d
commit a7738eeb64
132 changed files with 1029 additions and 884 deletions
+5 -4
View File
@@ -21,19 +21,20 @@ void XmlSerializerFactory::Factory::bind(const std::string& schema_name, fn f) {
this->insert(std::make_pair(schema_name_lower, f));
}
XmlSerializer* XmlSerializerFactory::Factory::construct(const std::string& schema_name, IfcParse::IfcFile* file, std::string xml_filename) {
XmlSerializer* XmlSerializerFactory::Factory::construct(const std::string& schema_name, IfcParse::IfcFile* file, std::string xml_filename, Logger& logger) {
const std::string schema_name_lower = boost::to_lower_copy(schema_name);
typename std::map<std::string, fn>::const_iterator it;
it = this->find(schema_name_lower);
if (it == this->end()) {
throw IfcParse::IfcException("No XML serializer registered for " + schema_name);
}
return it->second(file, xml_filename);
return it->second(file, xml_filename, logger);
}
XmlSerializer::XmlSerializer(IfcParse::IfcFile* file, const std::string& xml_filename) {
XmlSerializer::XmlSerializer(IfcParse::IfcFile* file, const std::string& xml_filename, Logger& logger)
: Serializer(logger) {
if (file) {
implementation_ = XmlSerializerFactory::implementations().construct(file->schema()->name(), file, xml_filename);
implementation_ = XmlSerializerFactory::implementations().construct(file->schema()->name(), file, xml_filename, logger_);
}
}