Initialise string to type map

This commit is contained in:
Thomas Krijnen
2014-02-26 10:12:25 +01:00
parent b3bf86e697
commit 357357ad78
3 changed files with 3 additions and 0 deletions
+1
View File
@@ -125,6 +125,7 @@ void %(schema_name)s::InitStringMap() {
}
Type::Enum Type::FromString(const std::string& s) {
if (string_map.empty()) InitStringMap();
std::map<std::string,Type::Enum>::const_iterator it = string_map.find(s);
if ( it == string_map.end() ) throw IfcException("Unable to find find keyword in schema");
else return it->second;
+1
View File
@@ -1791,6 +1791,7 @@ void Ifc2x3::InitStringMap() {
}
Type::Enum Type::FromString(const std::string& s) {
if (string_map.empty()) InitStringMap();
std::map<std::string,Type::Enum>::const_iterator it = string_map.find(s);
if ( it == string_map.end() ) throw IfcException("Unable to find find keyword in schema");
else return it->second;
+1
View File
@@ -2091,6 +2091,7 @@ void Ifc4::InitStringMap() {
}
Type::Enum Type::FromString(const std::string& s) {
if (string_map.empty()) InitStringMap();
std::map<std::string,Type::Enum>::const_iterator it = string_map.find(s);
if ( it == string_map.end() ) throw IfcException("Unable to find find keyword in schema");
else return it->second;