Minsky: 3.17.0
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 73 of file CSVDialog.cc.

Member Function Documentation

◆ emplace()

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

Definition at line 78 of file CSVDialog.cc.

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

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