This PR expands the CppClassGenerator further by adding the feature of parent classes. Parent classes are specified with a class name, scoping, and optional args for construction. By including parent classes in a spec, the generator will provide the following:
1) Parent classes are listed in the generated classes declaration (with appropriate scoping)
1) The parent class initialization will be included in the generated class's constructor
3) Optional arguments allow setting custom arguments for the parent class initialization
Validations
Note that ParentClassProperties will blow up if you try to assign anything but private, public or protected as a scope specifier. For validation, a simple internal function is used, but the ideal pattern for validations like this could evolve somewhat over time.
Add Parent Classes
This PR expands the
CppClassGenerator
further by adding the feature of parent classes. Parent classes are specified with a class name, scoping, and optional args for construction. By including parent classes in a spec, the generator will provide the following:1) Parent classes are listed in the generated classes declaration (with appropriate scoping) 1) The parent class initialization will be included in the generated class's constructor 3) Optional arguments allow setting custom arguments for the parent class initialization
Validations
Note that
ParentClassProperties
will blow up if you try to assign anything butprivate
,public
orprotected
as a scope specifier. For validation, a simple internal function is used, but the ideal pattern for validations like this could evolve somewhat over time.