I need to cache some png and svg images generated by latex in order to avoid parsing many times the same string. I currently do that using global std::map variable but I am at the point where I’d like to move this to some proper/safe place.
Should I follow e.g. the example of the ft_manager which IIUC follows the singleton pattern or do you have some other recommendations? Better, do we have some example of a singleton cache manager class, that can eventually use a FIFO buffer when the cache becomes too large (e.g. after long sessions)? Oh, and if the access to data could be thread safe it would be even better. I know, this looks like a letter to Santa Claus and a french would answer “et tu veux pas cent balles et un mars?” but we never know .