CycloBranch
cIsotopePatternCache.h
Go to the documentation of this file.
1
7#ifndef _CISOTOPEPATTERNCACHE_H
8#define _CISOTOPEPATTERNCACHE_H
9
10
11#include <QMutex>
12#include <unordered_map>
13#include <list>
14#include "core/utilities.h"
15#include "core/cPeaksList.h"
16
17
21class cIsotopePatternCache : public QMutex {
22
23 unordered_map<string, list<pair<string, cPeaksList> >::iterator > cache_map;
24 list<pair<string, cPeaksList> > cache_list;
25
26 int maxnumberofitems;
27
28public:
29
30
35 cIsotopePatternCache(int size = 10000);
36
37
42
43
50 bool get(string& formula, cPeaksList& isotopepattern);
51
52
58 void put(string& formula, cPeaksList& isotopepattern);
59
60
64 void clear();
65
66};
67
68
69#endif
70
The representation of a peak list.
Isotope pattern cache (LRU cache is implemented).
Definition: cIsotopePatternCache.h:21
~cIsotopePatternCache()
The destructor.
Definition: cIsotopePatternCache.cpp:10
void put(string &formula, cPeaksList &isotopepattern)
Put the isotope pattern corresponding to the formula into the cache.
Definition: cIsotopePatternCache.cpp:38
bool get(string &formula, cPeaksList &isotopepattern)
Get the isotope pattern corresponding to the formula from the cache.
Definition: cIsotopePatternCache.cpp:14
void clear()
Clear the cache.
Definition: cIsotopePatternCache.cpp:51
cIsotopePatternCache(int size=10000)
The constructor.
Definition: cIsotopePatternCache.cpp:4
The class representing a peak list.
Definition: cPeaksList.h:68
Auxiliary funtions and structures.