Alexandria
2.19
Please provide a description of the project.
|
Go to the documentation of this file.
21 #include <sys/resource.h>
29 getrlimit(RLIMIT_NOFILE, &rlim);
30 assert(rlim.rlim_cur > 3);
46 auto close_call = meta->m_request_close;
48 closed = close_call();
55 throw Elements::Exception() <<
"Limit reached and failed to close any existing file descriptor";
FileMetadata * FileId
Opaque FileId, its concrete type should only be assumed to be copyable and hashable.
unsigned getLimit() const
virtual ~LRUFileManager()
void notifyUsed(FileId id) override
void notifyClosedFile(FileId id) override
unsigned getAvailable() const
void notifyIntentToOpen(bool write) override
void notifyOpenedFile(FileId id) override
std::list< FileId > m_sorted_ids
Sorted from less to more recent.
T emplace_back(T... args)
LRUFileManager(unsigned limit=500)
std::map< FileId, std::list< FileId >::iterator > m_current_pos
std::map< FileId, std::unique_ptr< FileMetadata > > m_files