@@ -1365,7 +1365,7 @@ struct )cpp" << interfaceType.type << R"cpp(
1365
1365
)cpp" ;
1366
1366
for (const auto & outputField : interfaceType.fields )
1367
1367
{
1368
- headerFile << getFieldDeclaration (outputField, true );
1368
+ headerFile << getFieldDeclaration (outputField, true , false );
1369
1369
}
1370
1370
headerFile << R"cpp( };
1371
1371
)cpp" ;
@@ -1432,10 +1432,7 @@ class )cpp" << objectType.type << R"cpp(
1432
1432
1433
1433
for (const auto & outputField : objectType.fields )
1434
1434
{
1435
- if (interfaceFields.find (outputField.name ) != interfaceFields.cend ())
1436
- {
1437
- continue ;
1438
- }
1435
+ const bool inheritedField = interfaceFields.find (outputField.name ) != interfaceFields.cend ();
1439
1436
1440
1437
if (firstField)
1441
1438
{
@@ -1445,7 +1442,7 @@ class )cpp" << objectType.type << R"cpp(
1445
1442
firstField = false ;
1446
1443
}
1447
1444
1448
- headerFile << getFieldDeclaration (outputField, false );
1445
+ headerFile << getFieldDeclaration (outputField, false , inheritedField );
1449
1446
}
1450
1447
1451
1448
headerFile << R"cpp(
@@ -1541,7 +1538,7 @@ std::string Generator::getFieldDeclaration(const InputField & inputField) const
1541
1538
return output.str ();
1542
1539
}
1543
1540
1544
- std::string Generator::getFieldDeclaration (const OutputField & outputField, bool interfaceField) const noexcept
1541
+ std::string Generator::getFieldDeclaration (const OutputField & outputField, bool interfaceField, bool inheritedField ) const noexcept
1545
1542
{
1546
1543
std::ostringstream output;
1547
1544
std::string fieldName (outputField.name );
@@ -1556,7 +1553,16 @@ std::string Generator::getFieldDeclaration(const OutputField & outputField, bool
1556
1553
<< R"cpp( && )cpp" << argument.name << " Arg" ;
1557
1554
}
1558
1555
1559
- output << R"cpp( ) const = 0;
1556
+ output << R"cpp( ) const)cpp" ;
1557
+ if (interfaceField)
1558
+ {
1559
+ output << R"cpp( = 0)cpp" ;
1560
+ }
1561
+ else if (inheritedField)
1562
+ {
1563
+ output << R"cpp( override)cpp" ;
1564
+ }
1565
+ output << R"cpp( ;
1560
1566
)cpp" ;
1561
1567
1562
1568
return output.str ();
@@ -1890,6 +1896,28 @@ namespace object {
1890
1896
1891
1897
fieldName[0 ] = static_cast <char >(std::toupper (static_cast <unsigned char >(fieldName[0 ])));
1892
1898
sourceFile << R"cpp(
1899
+ std::future<)cpp" << getOutputCppType (outputField, false )
1900
+ << R"cpp( > )cpp" << objectType.type
1901
+ << R"cpp( ::get)cpp" << fieldName
1902
+ << R"cpp( (service::FieldParams&&)cpp" ;
1903
+ for (const auto & argument : outputField.arguments )
1904
+ {
1905
+ sourceFile << R"cpp( , )cpp" << getInputCppType (argument)
1906
+ << R"cpp( &&)cpp" ;
1907
+ }
1908
+
1909
+ sourceFile << R"cpp( ) const
1910
+ {
1911
+ std::promise<)cpp" << getOutputCppType (outputField, false )
1912
+ << R"cpp( > promise;
1913
+
1914
+ promise.set_exception(std::make_exception_ptr(std::runtime_error(R"ex()cpp" << objectType.type
1915
+ << R"cpp( ::get)cpp" << fieldName
1916
+ << R"cpp( is not implemented)ex")));
1917
+
1918
+ return promise.get_future();
1919
+ }
1920
+
1893
1921
std::future<response::Value> )cpp" << objectType.type
1894
1922
<< R"cpp( ::resolve)cpp" << fieldName
1895
1923
<< R"cpp( (service::ResolverParams&& params)
0 commit comments