@@ -113,11 +113,10 @@ class spf_header;
113113simpletype = """%(documentation)s
114114class IFC_PARSE_API %(name)s : public %(superclass)s {
115115public:
116- %(name)s() {}
117- explicit %(name)s (const std::weak_ptr<instance_data>& data) : %(superclass)s(data) {}
116+ using %(superclass)s::%(superclass_2)s;
118117
119118 static const ifcopenshell::type_declaration& Class();
120- void initialize(%(type)s v);
119+ %(name)s initialize(%(type)s v);
121120 operator %(type)s() const;
122121};
123122"""
@@ -142,8 +141,7 @@ class IFC_PARSE_API %(name)s : public %(superclass)s {
142141select = """%(documentation)s
143142class IFC_PARSE_API %(name)s : public express::Select {
144143public:
145- %(name)s() {}
146- explicit %(name)s(const express::Base& c) : express::Select(c) {}
144+ using express::Select::Select;
147145
148146 static const ifcopenshell::select_type& Class();
149147%(template_items)s
@@ -162,29 +160,27 @@ class IFC_PARSE_API %(name)s : public express::Select {
162160enumeration = """%(documentation)s
163161class IFC_PARSE_API %(name)s : public express::DeclaredType {
164162public:
165- %(name)s() {}
166- explicit %(name)s (const std::weak_ptr<instance_data>& data) : express::DeclaredType(data) {}
163+ using express::DeclaredType::DeclaredType;
167164
168165 typedef enum {%(values)s} Value;
169166 static const char* ToString(Value v);
170167 static Value FromString(const std::string& s);
171168
172169 static const ifcopenshell::enumeration_type& Class();
173- void initialize(Value v);
174- void initialize(const std::string& v);
170+ %(name)s initialize(Value v);
171+ %(name)s initialize(const std::string& v);
175172 operator Value() const;
176173};
177174"""
178175
179176entity = """%(documentation)s
180177class IFC_PARSE_API %(name)s : public %(superclass)s {
181178public:
182- %(name)s() {}
183- explicit %(name)s (const std::weak_ptr<instance_data>& data) : %(superclass)s(data) {}
179+ using %(superclass)s::%(superclass_2)s;
184180
185181%(attributes)s %(inverse)s
186182 static const ifcopenshell::entity& Class();
187- void initialize(%(constructor_arguments)s);
183+ %(name)s initialize(%(constructor_arguments)s);
188184};
189185"""
190186
@@ -227,7 +223,7 @@ class IFC_PARSE_API %(name)s : public %(superclass)s {
227223%(attributes)s
228224%(inverse)s
229225const ifcopenshell::entity& %(schema_name)s::%(name)s::Class() { return *((ifcopenshell::entity*)%(schema_name_upper)s_types[%(index_in_schema)d]); }
230- void %(schema_name)s::%(name)s::initialize(%(constructor_arguments)s) { %(constructor_implementation)s }
226+ %(schema_name)s::%(name)s %(schema_name)s::%(name)s::initialize(%(constructor_arguments)s) { %(constructor_implementation)s; return *this; }
231227"""
232228
233229# data_ = e;
@@ -239,7 +235,7 @@ class IFC_PARSE_API %(name)s : public %(superclass)s {
239235const_function = "%(return_type)s %(schema_name)s::%(class_name)s::%(name)s(%(arguments)s) const { %(body)s }"
240236constructor = "%(schema_name)s::%(class_name)s::%(class_name)s(%(arguments)s) { %(body)s }"
241237initialize_single_initlist = (
242- "void %(schema_name)s::%(class_name)s::initialize(%(arguments)s) { %(body)s }"
238+ "%(schema_name)s::%(class_name)s %(schema_name)s::%(class_name)s::initialize(%(arguments)s) { %(body)s; return *this; }"
243239)
244240cast_function = "%(schema_name)s::%(class_name)s::operator %(return_type)s() const { %(body)s }"
245241
0 commit comments