Skip to content
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

Why not updating in-place? #27

Open
peci1 opened this issue May 13, 2019 · 1 comment
Open

Why not updating in-place? #27

peci1 opened this issue May 13, 2019 · 1 comment

Comments

@peci1
Copy link
Contributor

peci1 commented May 13, 2019

Is there a good reason for not having function

virtual bool update(T& data)=0;

in FilterBase?

It seems to me it might help getting the filter chain even more efficient.

Regarding backwards compatibility, it'd probably need to have a default implementation that calls the copying update(data_in, data_out), but filters that are capable of working in-place would get the chance to do so.

@tfoote
Copy link
Member

tfoote commented May 13, 2019

Improving support for in place would be reasonable. I believe that many of them are coded so as to actually support that by passing the same reference to both arguments. But possibly setting a flag that can be used in in the tempalte logic for the FilterChain might be much more powerful. The availability of the single argument update is one such indicator that could be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants