Skip to content

Add jinja template for Callback class #2495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

geky
Copy link
Contributor

@geky geky commented Aug 18, 2016

To workaround the lack of variadic arguments, multiple template specializations are declared for the Callback class based on the number of arguments. This is not required in C++11.

To avoid the tedious of updating the multiple declarations, the Callback class was ported to a jinja template, which is expanded on changes to the Callback class.

Note: The generated Callback.h file is also committed, and jinja is not necessary to compile the Callback class.

Using j2cli (link):

j2 Callback.j2 > Callback.h

Let me know what your thoughts are about including these files, if there is a better place for them, or if there is a different templating engine we should use.

cc @pan-, @0xc0170, @bogdanm

To workaround the lack of variadic arguments, multiple template
specializations are declared for the Callback class based on the number
of arguments.

To avoid the tedious of updating the multiple declarations, the Callback
class was ported to a jinja template, which is expanded on changes to
the Callback class.

Note: The generated Callback.h file is also committed, and jinja is not
necessary to compile the Callback class.

Using j2cli (https://pypi.python.org/pypi/j2cli/):

  j2 Callback.j2 > Callback.h
@pan-
Copy link
Member

pan- commented Aug 19, 2016

Is it possible to autogenerate the tests for the Callback class ?
I've put other comments in #2496

@geky
Copy link
Contributor Author

geky commented Aug 19, 2016

I'm going to merge this pr with #2496 to simplify things a bit and avoid confusion.

@geky geky closed this Aug 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants