#include <CacheManagement.h>
Definition at line 25 of file CacheManagement.h.
◆ CacheManagement()
MBMS_RT::CacheManagement::CacheManagement |
( |
const libconfig::Config & |
cfg, |
|
|
boost::asio::io_service & |
io_service |
|
) |
| |
Definition at line 21 of file CacheManagement.cpp.
boost::asio::io_service & _io_service
unsigned _max_cache_file_age
static Config cfg
Global configuration object.
◆ ~CacheManagement()
virtual MBMS_RT::CacheManagement::~CacheManagement |
( |
| ) |
|
|
virtualdefault |
◆ add_item()
void MBMS_RT::CacheManagement::add_item |
( |
std::shared_ptr< CacheItem > |
item | ) |
|
|
inline |
Definition at line 30 of file CacheManagement.h.
std::map< std::string, std::shared_ptr< CacheItem > > _cache_items
◆ check_file_expiry_and_cache_size()
auto MBMS_RT::CacheManagement::check_file_expiry_and_cache_size |
( |
| ) |
|
Definition at line 29 of file CacheManagement.cpp.
31 std::multimap<unsigned, std::string> items_by_age;
33 spdlog::debug(
"checking {}", it->second->content_location());
34 if (it->second->received_at() != 0) {
35 auto age = time(
nullptr) - it->second->received_at();
37 spdlog::info(
"Cache management deleting expired item at {} after {} seconds",
38 it->second->content_location(), age);
41 items_by_age.insert(std::make_pair(age, it->first));
48 uint32_t total_size = 0;
49 for (
const auto& it : items_by_age) {
52 spdlog::info(
"Cache management deleting item at {} (aged {} secs) due to cache size limit",
◆ item_map()
const std::map<std::string, std::shared_ptr<CacheItem> >& MBMS_RT::CacheManagement::item_map |
( |
| ) |
const |
|
inline |
◆ remove_item()
void MBMS_RT::CacheManagement::remove_item |
( |
const std::string & |
location | ) |
|
|
inline |
◆ _cache_items
std::map<std::string, std::shared_ptr<CacheItem> > MBMS_RT::CacheManagement::_cache_items |
|
private |
◆ _io_service
boost::asio::io_service& MBMS_RT::CacheManagement::_io_service |
|
private |
◆ _max_cache_file_age
unsigned MBMS_RT::CacheManagement::_max_cache_file_age = 30 |
|
private |
◆ _max_cache_size
unsigned MBMS_RT::CacheManagement::_max_cache_size = 512 |
|
private |
◆ _total_cache_size
unsigned MBMS_RT::CacheManagement::_total_cache_size = 0 |
|
private |
The documentation for this class was generated from the following files: