[wave] rational for not allowing copies of the context

The subject says it all What is the rational for not allowing copies of context objects? -- Felipe Magno de Almeida

Felipe Magno de Almeida wrote:
The subject says it all What is the rational for not allowing copies of context objects?
At the time the wave::context object was developed it was not safe to be copied, and in fact it isn't so today. But AFAICS there is no real reason why it couldn't be made copyable (except for the reason that it's _very_ expensive to copy a wave::context object). There was just no usecase yet to make it copyable. Could you please describe in more detail your usecase? Since this change will be interface breaking it perhaps makes sense to adjust other interface deficies you may have as well? Regards Hartmut

On 5/15/06, Hartmut Kaiser <hartmut.kaiser@gmail.com> wrote:
[snipped]
Could you please describe in more detail your usecase? Since this change will be interface breaking it perhaps makes sense to adjust other interface deficies you may have as well?
I need to keep the context saved for various points of the file. The points would contain an iterator and a context. These points are saved for continuing preprocessing from this point after some modifications in the context. Having the ability to copy the context would save me having to keep the context of the preprocessing at that point in some external structure, so that it can recovered later.
Regards Hartmut
Thanks, -- Felipe Magno de Almeida

Felipe Magno de Almeida wrote:
Could you please describe in more detail your usecase? Since this change will be interface breaking it perhaps makes sense to adjust other interface deficies you may have as well?
I need to keep the context saved for various points of the file. The points would contain an iterator and a context. These points are saved for continuing preprocessing from this point after some modifications in the context. Having the ability to copy the context would save me having to keep the context of the preprocessing at that point in some external structure, so that it can recovered later.
Understood. I can change the context object to be copyable, but I'll have to change all of the preprocessing hooks. OTOH it's probably not much more expensive to use boost::serialization to store/restore the context state. So I'm not quite convinced yet to go for the interface change. What do you think? Regards Hartmut
participants (2)
-
Felipe Magno de Almeida
-
Hartmut Kaiser