Kaydet (Commit) f1e5db3e authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use emplace_back

Change-Id: I006e3c8f411b480917d9cfb9c4f3d082b79c833d
üst e0b93ef5
...@@ -132,21 +132,19 @@ void checkAttributes(rtl::Reference< TypeManager > const & manager, ...@@ -132,21 +132,19 @@ void checkAttributes(rtl::Reference< TypeManager > const & manager,
i != ent2->getDirectAttributes().end(); ++i) i != ent2->getDirectAttributes().end(); ++i)
{ {
if (!containsAttribute(attributes, i->name)) { if (!containsAttribute(attributes, i->name)) {
attributes.push_back( attributes.emplace_back(
unoidl::AccumulationBasedServiceEntity::Property( i->name, i->type,
i->name, (unoidl::AccumulationBasedServiceEntity::Property::
i->type, Attributes(
(unoidl::AccumulationBasedServiceEntity::Property:: ((i->bound
Attributes( ? (unoidl::AccumulationBasedServiceEntity::
((i->bound Property::ATTRIBUTE_BOUND)
? (unoidl::AccumulationBasedServiceEntity:: : 0)
Property::ATTRIBUTE_BOUND) | (i->readOnly
: 0) ? (unoidl::AccumulationBasedServiceEntity::
| (i->readOnly Property::ATTRIBUTE_READ_ONLY)
? (unoidl::AccumulationBasedServiceEntity:: : 0)))),
Property::ATTRIBUTE_READ_ONLY) std::vector< OUString >());
: 0)))),
std::vector< OUString >()));
} }
} }
break; break;
......
...@@ -1039,8 +1039,7 @@ enumMember: ...@@ -1039,8 +1039,7 @@ enumMember:
} }
++v; ++v;
} }
pad->members.push_back( pad->members.emplace_back(id, v, annotations($1));
unoidl::EnumTypeEntity::Member(id, v, annotations($1)));
} }
| deprecated_opt identifier '=' expr | deprecated_opt identifier '=' expr
{ {
...@@ -1078,8 +1077,7 @@ enumMember: ...@@ -1078,8 +1077,7 @@ enumMember:
YYERROR; YYERROR;
break; break;
} }
pad->members.push_back( pad->members.emplace_back(id, v, annotations($1));
unoidl::EnumTypeEntity::Member(id, v, annotations($1)));
} }
; ;
...@@ -1399,9 +1397,7 @@ structMember: ...@@ -1399,9 +1397,7 @@ structMember:
p->entity.get()); p->entity.get());
} }
} }
p1->members.push_back( p1->members.emplace_back(id, t.getName(), annotations($1));
unoidl::PlainStructTypeEntity::Member(
id, t.getName(), annotations($1)));
} else { } else {
unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad * unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad *
p2 = dynamic_cast<unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad *>( p2 = dynamic_cast<unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad *>(
...@@ -1420,12 +1416,10 @@ structMember: ...@@ -1420,12 +1416,10 @@ structMember:
YYERROR; YYERROR;
} }
} }
p2->members.push_back( p2->members.emplace_back(
unoidl::PolymorphicStructTypeTemplateEntity::Member( id, t.getName(),
id, t.getName(), t.type == unoidl::detail::SourceProviderType::TYPE_PARAMETER,
(t.type annotations($1));
== unoidl::detail::SourceProviderType::TYPE_PARAMETER),
annotations($1)));
} else { } else {
unoidl::detail::SourceProviderExceptionTypeEntityPad * p3 unoidl::detail::SourceProviderExceptionTypeEntityPad * p3
= dynamic_cast<unoidl::detail::SourceProviderExceptionTypeEntityPad *>( = dynamic_cast<unoidl::detail::SourceProviderExceptionTypeEntityPad *>(
...@@ -1499,9 +1493,7 @@ structMember: ...@@ -1499,9 +1493,7 @@ structMember:
p->entity.get()); p->entity.get());
} }
} }
p3->members.push_back( p3->members.emplace_back(id, t.getName(), annotations($1));
unoidl::ExceptionTypeEntity::Member(
id, t.getName(), annotations($1)));
} }
} }
} }
...@@ -1625,14 +1617,14 @@ interfaceDefn: ...@@ -1625,14 +1617,14 @@ interfaceDefn:
i(pad->directMandatoryBases.begin()); i(pad->directMandatoryBases.begin());
i != pad->directMandatoryBases.end(); ++i) i != pad->directMandatoryBases.end(); ++i)
{ {
mbases.push_back(unoidl::AnnotatedReference(i->name, i->annotations)); mbases.emplace_back(i->name, i->annotations);
} }
std::vector<unoidl::AnnotatedReference> obases; std::vector<unoidl::AnnotatedReference> obases;
for (std::vector<unoidl::detail::SourceProviderInterfaceTypeEntityPad::DirectBase>::const_iterator for (std::vector<unoidl::detail::SourceProviderInterfaceTypeEntityPad::DirectBase>::const_iterator
i(pad->directOptionalBases.begin()); i(pad->directOptionalBases.begin());
i != pad->directOptionalBases.end(); ++i) i != pad->directOptionalBases.end(); ++i)
{ {
obases.push_back(unoidl::AnnotatedReference(i->name, i->annotations)); obases.emplace_back(i->name, i->annotations);
} }
ent->entity = new unoidl::InterfaceTypeEntity( ent->entity = new unoidl::InterfaceTypeEntity(
pad->isPublished(), mbases, obases, pad->directAttributes, pad->isPublished(), mbases, obases, pad->directAttributes,
...@@ -1760,12 +1752,10 @@ interfaceAttribute: ...@@ -1760,12 +1752,10 @@ interfaceAttribute:
if (!pad->addDirectMember(@4, yyscanner, data, id)) { if (!pad->addDirectMember(@4, yyscanner, data, id)) {
YYERROR; YYERROR;
} }
pad->directAttributes.push_back( pad->directAttributes.emplace_back(
unoidl::InterfaceTypeEntity::Attribute( id, t.getName(), ($2 & unoidl::detail::FLAG_BOUND) != 0,
id, t.getName(), ($2 & unoidl::detail::FLAG_BOUND) != 0, ($2 & unoidl::detail::FLAG_READONLY) != 0,
($2 & unoidl::detail::FLAG_READONLY) != 0, std::vector<OUString>(), std::vector<OUString>(), annotations($1));
std::vector<OUString>(), std::vector<OUString>(),
annotations($1)));
} }
attributeAccessDecls_opt ';' attributeAccessDecls_opt ';'
; ;
...@@ -1842,11 +1832,10 @@ interfaceMethod: ...@@ -1842,11 +1832,10 @@ interfaceMethod:
if (!pad->addDirectMember(@3, yyscanner, data, id)) { if (!pad->addDirectMember(@3, yyscanner, data, id)) {
YYERROR; YYERROR;
} }
pad->directMethods.push_back( pad->directMethods.emplace_back(
unoidl::InterfaceTypeEntity::Method( id, t.getName(),
id, t.getName(), std::vector<unoidl::InterfaceTypeEntity::Method::Parameter>(),
std::vector<unoidl::InterfaceTypeEntity::Method::Parameter>(), std::vector<OUString>(), annotations($1));
std::vector<OUString>(), annotations($1)));
} }
'(' methodParams_opt ')' exceptionSpec_opt ';' '(' methodParams_opt ')' exceptionSpec_opt ';'
{ {
...@@ -1910,8 +1899,7 @@ methodParam: ...@@ -1910,8 +1899,7 @@ methodParam:
YYERROR; YYERROR;
} }
} }
pad->directMethods.back().parameters.push_back( pad->directMethods.back().parameters.emplace_back(id, t.getName(), $2);
unoidl::InterfaceTypeEntity::Method::Parameter(id, t.getName(), $2));
} }
; ;
...@@ -2309,8 +2297,7 @@ constant: ...@@ -2309,8 +2297,7 @@ constant:
YYERROR; YYERROR;
break; break;
} }
pad->members.push_back( pad->members.emplace_back(id, v, annotations($1));
unoidl::ConstantGroupEntity::Member(id, v, annotations($1)));
} }
; ;
...@@ -2396,9 +2383,7 @@ singleInterfaceBasedServiceDefn: ...@@ -2396,9 +2383,7 @@ singleInterfaceBasedServiceDefn:
j(i->parameters.begin()); j(i->parameters.begin());
j != i->parameters.end(); ++j) j != i->parameters.end(); ++j)
{ {
parms.push_back( parms.emplace_back(j->name, j->type.getName(), j->rest);
unoidl::SingleInterfaceBasedServiceEntity::Constructor::Parameter(
j->name, j->type.getName(), j->rest));
} }
ctors.push_back( ctors.push_back(
unoidl::SingleInterfaceBasedServiceEntity::Constructor( unoidl::SingleInterfaceBasedServiceEntity::Constructor(
...@@ -2691,7 +2676,7 @@ serviceBase: ...@@ -2691,7 +2676,7 @@ serviceBase:
YYERROR; YYERROR;
} }
} }
v.push_back(unoidl::AnnotatedReference(name, annotations($1))); v.emplace_back(name, annotations($1));
} }
; ;
...@@ -2770,7 +2755,7 @@ serviceInterfaceBase: ...@@ -2770,7 +2755,7 @@ serviceInterfaceBase:
YYERROR; YYERROR;
} }
} }
v.push_back(unoidl::AnnotatedReference(name, annotations($1))); v.emplace_back(name, annotations($1));
} }
; ;
...@@ -2860,11 +2845,10 @@ serviceProperty: ...@@ -2860,11 +2845,10 @@ serviceProperty:
YYERROR; YYERROR;
} }
} }
pad->directProperties.push_back( pad->directProperties.emplace_back(
unoidl::AccumulationBasedServiceEntity::Property( id, t.getName(),
id, t.getName(), unoidl::AccumulationBasedServiceEntity::Property::Attributes(att),
unoidl::AccumulationBasedServiceEntity::Property::Attributes(att), annotations($1));
annotations($1)));
} }
; ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment