Feel++ 0.111.0-preview.14
Finite Element Embedded Library in C++
Feel::FunctionSpaceManager::Impl Struct Reference

Private synchronized storage and policy implementation. More...

+ Collaboration diagram for Feel::FunctionSpaceManager::Impl:

Classes

struct  Entry
 Strongly retained function space and its LRU metadata. More...
 
struct  Key
 Key for one function space associated with a mesh bucket. More...
 
struct  MeshBucket
 Entries, observers, and counters associated with one mesh owner. More...
 

Public Types

using buckets_type = std::map< owner_type, MeshBucket, owner_less_type >
 

Public Member Functions

void eraseEntry (MeshBucket &bucket, typename std::map< Key, Entry >::iterator entry, bool eviction)
 Erase one entry and optionally account for an eviction. More...
 
void evictIfNeeded (MeshBucket &insertedBucket)
 Enforce per-mesh and global LRU capacity limits. More...
 
void increment (MeshBucket &bucket, uint64_type FunctionSpaceManagerStats::*member, uint64_type amount=1)
 Increment the same counter globally and for one mesh. More...
 
void loadRuntimeConfigOnce ()
 Load manager options from the Environment exactly once.
 
void pruneExpiredBuckets ()
 Remove empty buckets whose mesh owner has expired.
 
std::size_t retainedEntries () const
 

Public Attributes

uint64_type accessClock = 0
 
buckets_type buckets
 
FunctionSpaceManagerConfig config
 
FunctionSpaceManagerStats counters
 
bool logStats = false
 
std::recursive_mutex mutex
 
bool runtimeConfigLoaded = false
 
bool shutdownComplete = false
 

Detailed Description

Private synchronized storage and policy implementation.

Member Function Documentation

◆ eraseEntry()

void Feel::FunctionSpaceManager::Impl::eraseEntry ( MeshBucket &  bucket,
typename std::map< Key, Entry >::iterator  entry,
bool  eviction 
)

Erase one entry and optionally account for an eviction.

Parameters
bucketbucket containing entry
entryiterator of the entry to erase
evictionwhether to increment the eviction counter

References Feel::FunctionSpaceManager::Impl::MeshBucket::entries, Feel::FunctionSpaceManagerStats::evictions, and increment().

Referenced by evictIfNeeded().

◆ evictIfNeeded()

void Feel::FunctionSpaceManager::Impl::evictIfNeeded ( MeshBucket &  insertedBucket)

Enforce per-mesh and global LRU capacity limits.

Parameters
insertedBucketbucket in which an entry was inserted

References Feel::FunctionSpaceManager::Impl::MeshBucket::entries, eraseEntry(), and retainedEntries().

◆ increment()

void Feel::FunctionSpaceManager::Impl::increment ( MeshBucket &  bucket,
uint64_type FunctionSpaceManagerStats::*  member,
uint64_type  amount = 1 
)

Increment the same counter globally and for one mesh.

Parameters
bucketmesh bucket whose counter is incremented
membercounter member to update
amountincrement amount

References Feel::FunctionSpaceManager::Impl::MeshBucket::counters.

Referenced by eraseEntry().

◆ retainedEntries()

std::size_t Feel::FunctionSpaceManager::Impl::retainedEntries ( ) const
Returns
number of entries retained across all mesh buckets.

Referenced by evictIfNeeded().