Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ValueCache.cpp
Go to the documentation of this file.
1 /**
2  * @file ValueCache.cpp
3  */
4 
7 
8 namespace
9 {
10 Cantera::mutex_t id_mutex;
11 }
12 
13 namespace Cantera
14 {
15 
16 int ValueCache::m_last_id = 0;
17 
19 {
20  ScopedLock lock(id_mutex);
21  return ++m_last_id;
22 }
23 
25 {
26  m_scalarCache.clear();
27  m_arrayCache.clear();
28 }
29 
30 }
int getId()
Get a unique id for a cached value.
Definition: ValueCache.cpp:18
static int m_last_id
The last assigned id. Automatically incremented by the getId() method.
Definition: ValueCache.h:186
std::map< int, CachedValue< vector_fp > > m_arrayCache
Cached array values.
Definition: ValueCache.h:183
std::map< int, CachedValue< double > > m_scalarCache
Cached scalar values.
Definition: ValueCache.h:180
void clear()
Clear all cached values.
Definition: ValueCache.cpp:24