Consider unteaching ServiceCodeGenerator
about sources vs. headers
#14198
Labels
cpp: generator
Issues related to the C++ micro-generator
type: cleanup
An internal cleanup or hygiene concern.
We could have one
ServiceCodeGenerator
per file, instead of oneServiceCodeGenerator
per potential pairs of files.ServiceCodeGenerator
writes files. It takes care to distinguish between headers and sources. It has a separatePrinter
for source and header. It has manyCcFoo()
/HeaderFoo()
member functions. But the implementation of these member functions are basically the same.Why we would do this:
ServiceCodeGenerator
that only writes a source file.GenerateHeader()
orGenerateCc()
)Why we wouldn't do this:
If there was a ton of common code shared between headers and sources, then having one class to control both makes sense.
{get,set}_iam_policy_extension_
.ConnectionFactoryFunctionArguments()
We could always factor this stuff out. The processing could happen in
make_generators.cc
, instead of inside the generator. e.g. EachServiceCodeGenerator
callsSetMethods()
which does the same work to produce itsmethods_
,async_methods_
. That could also happen once outside of theServiceCodeGenerators
.The text was updated successfully, but these errors were encountered: