10 #include <boost/noncopyable.hpp> 11 #include <boost/cstdint.hpp> 13 template<
class T>
class fifo_cache:
public boost::noncopyable
21 const T*
data(boost::uint64_t
id)
const;
27 void push(boost::uint64_t
id, T* data);
43 m_fifo.resize(max_size, 0);
53 std::map<boost::uint64_t, T*>::const_iterator it =
m_fifos.find(
id);
55 return (it !=
m_fifos.end()) ? it->second : 0;
66 throw std::runtime_error(
"fifo cache is empty!");
80 throw std::runtime_error(
"fifo cache is full!");
82 std::map<boost::uint64_t, T*>::const_iterator it =
m_fifos.find(
id);
85 throw std::runtime_error(
"fifo cache already has an entry for this fifo!");
96 #endif // __fifo_cache__
std::map< boost::uint64_t, T * > m_fifos
fifo_cache(std::size_t max_size)
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
const T * data(boost::uint64_t id) const
std::vector< boost::uint64_t > m_fifo
void push(boost::uint64_t id, T *data)