Minsky
anonymous_namespace{CSVDialog.cc}::Cache Struct Reference
Inheritance diagram for anonymous_namespace{CSVDialog.cc}::Cache:
Inheritance graph
Collaboration diagram for anonymous_namespace{CSVDialog.cc}::Cache:
Collaboration graph

Public Member Functions

iterator emplace (const string &url)
 

Detailed Description

Definition at line 72 of file CSVDialog.cc.

Member Function Documentation

◆ emplace()

iterator anonymous_namespace{CSVDialog.cc}::Cache::emplace ( const string &  url)
inline

Definition at line 77 of file CSVDialog.cc.

78  {
79  if (size()>=10)
80  {
81  // find oldest element and erase
82  auto entryToErase=begin();
83  auto ts=entryToErase->timestamp;
84  for (auto i=begin(); i!=end(); ++i)
85  if (i->timestamp<ts)
86  {
87  ts=i->timestamp;
88  entryToErase=i;
89  }
90  erase(entryToErase);
91  }
92  return set<CacheEntry>::emplace(url).first;
93  }

The documentation for this struct was generated from the following file: