#ifndef LIBDCP_LUT_CACHE_H #define LIBDCP_LUT_CACHE_H #include #include template class LUTCache { public: boost::shared_ptr get (int bit_depth, float gamma) { for (typename std::list >::iterator i = _cache.begin(); i != _cache.end(); ++i) { if ((*i)->bit_depth() == bit_depth && (*i)->gamma() == gamma) { return *i; } } boost::shared_ptr lut (new T (bit_depth, gamma)); _cache.push_back (lut); return lut; } private: std::list > _cache; }; #endif