A Strategy is a collection of Action = std::function<void(const Hdu&)>.
It is indexed by some ActionTrigger, e.g. PostFileOpen, PreFileClose, PreHduInit, PostHduInit, PostFirstHduAccess (naming too rude, to be refined) and the HduCategory.
Possibly, some ActionTag (e.g. int or string) could be used to add or remove actions.
A
Strategy
is a collection ofAction = std::function<void(const Hdu&)>
. It is indexed by someActionTrigger
, e.g.PostFileOpen, PreFileClose, PreHduInit, PostHduInit, PostFirstHduAccess
(naming too rude, to be refined) and theHduCategory
. Possibly, someActionTag
(e.g.int
orstring
) could be used to add or remove actions.Something like this must be feasible:
At some point, shortcuts could be introduced, e.g.
s.preHduInit(Compress(Plio()), HduCategory::IntImage);
.For implementation ease, tags could also be replaced with ids, e.g.:
Given that such local behaviors should be used with care, such an extra complexity would probably be acceptable.