summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-09-23 00:42:43 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-09-23 00:42:43 +0100
commit031f4562ee4736596f1129078ab0128c456bce2c (patch)
tree307e78845e376169959c70b86e762c10a0f2e5ca
parentNew install rules (diff)
downloadslicer-031f4562ee4736596f1129078ab0128c456bce2c.tar.bz2
slicer-031f4562ee4736596f1129078ab0128c456bce2c.tar.xz
slicer-031f4562ee4736596f1129078ab0128c456bce2c.zip
Fold the template argument into createNewModelPartPtrFor
-rw-r--r--slicer/tool/parser.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp
index 1144391..0b7b2a8 100644
--- a/slicer/tool/parser.cpp
+++ b/slicer/tool/parser.cpp
@@ -277,9 +277,8 @@ namespace Slicer {
auto conversions = getAllConversions(dm);
fprintbf(cpp, "\t\tnew ");
auto type = dm->type();
- createNewModelPartPtrFor(t);
- fprintbf(cpp, "< %s >::Hook< %s",
- typeToString(it),
+ createNewModelPartPtrFor(it);
+ fprintbf(cpp, "::Hook< %s",
Slice::typeToString(type, dm->optional()));
fprintbf(cpp, ", %s, &%s, ",
boost::algorithm::trim_right_copy_if(dm->container()->thisScope(), ispunct),
@@ -295,8 +294,6 @@ namespace Slicer {
}
else {
createNewModelPartPtrFor(type);
- fprintbf(cpp, "< %s >",
- Slice::typeToString(type));
}
if (dm->optional()) {
fprintbf(cpp, " > ");
@@ -320,9 +317,8 @@ namespace Slicer {
}
auto type = dm->type();
fprintbf(cpp, "template<>\ntemplate<> DLL_PUBLIC\nconst Metadata\n");
- createNewModelPartPtrFor(t);
- fprintbf(cpp, "< %s >::HookMetadata< %s",
- typeToString(it),
+ createNewModelPartPtrFor(it);
+ fprintbf(cpp, "::HookMetadata< %s",
Slice::typeToString(type, dm->optional()));
fprintbf(cpp, ", %s, &%s >::metadata ",
boost::algorithm::trim_right_copy_if(dm->container()->thisScope(), ispunct),
@@ -456,8 +452,7 @@ namespace Slicer {
d->scoped(),
d->scoped());
createNewModelPartPtrFor(ktype);
- fprintbf(cpp, "< %s >, HookBase >(\"%s\"),\n\t\t",
- Slice::typeToString(ktype),
+ fprintbf(cpp, ", HookBase >(\"%s\"),\n\t\t",
kname ? *kname : "key");
auto vtype = d->valueType();
fprintbf(cpp, "new ModelPartForComplex< %s::value_type >::Hook< %s, %s::value_type, &%s::value_type::second, ",
@@ -466,8 +461,7 @@ namespace Slicer {
d->scoped(),
d->scoped());
createNewModelPartPtrFor(vtype);
- fprintbf(cpp, "< %s >, HookBase >(\"%s\"),\n",
- Slice::typeToString(vtype),
+ fprintbf(cpp, ", HookBase >(\"%s\"),\n",
vname ? *vname : "value");
fprintbf(cpp, "\t};\n");
fprintbf(cpp, "\n");
@@ -516,6 +510,8 @@ namespace Slicer {
else if (auto enumeration = Slice::EnumPtr::dynamicCast(type)) {
fprintbf(cpp, "ModelPartForEnum");
}
+ fprintbf(cpp, "< %s >",
+ Slice::typeToString(type));
}
bool