
Basile STARYNKEVITCH wrote:
Hello Roberto and all,
It would be cute if the routine passed to ppl_io_set_variable_output_function could take some client data.
So I suggest an additional variant to the API. In C++, have inside the Parma_Polyhedra_Library::Variable class typedef void output_function_with_data_type (std::ostream &s, const Variable &v, void* data); and the static member function set_output_function_with_data(output_function_with_data_type* f, void *data); so that when a variable v needs to be output, PPL would call f(s,v,data)
And in the C API one would have
ppl_io_set_variable_output_with_data_function(ppl_io_variable_output_function_with_data_type *f, void*data)
Regards.
Hello.
I think I should be missing something.
Can't you "embed" the access to this supplementary data pointer into your own variable output function? That is, you provide an output function that, when called, accesses some (possibly many) global data pointer(s), rather than a single data pointer passed as a parameter.
Wouldn't that be enough for your purposes?
Cheers, Enea.