Skip to content

Use templated wrappers #30

@kwabenantim

Description

@kwabenantim

Description

Use templating to reduce number of generated wrapper files. Many wrappers only vary in template arguments and the rest of the code is exactly the same.

For example, the aim would be to refactor this

register_AbstractCellPopulation2_2_class(m);
register_AbstractCellPopulation3_3_class(m);

into this:

register_AbstractCellPopulation_class<2, 2>(m);
register_AbstractCellPopulation_class<3, 3>(m);

The first requires separate wrappers to be created for AbstractCellPopulation2_2 and AbstractCellPopulation3_3. Counting hpp and cpp, this generates 4 files.

The second requires a single templated wrapper to be created for AbstractCellPopulation. This would only generate 2 files regardless of the number of different sets of template arguments required. This approach would only need each set of arguments to be explicitly instantiated.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions