ROSE 0.11.145.134
|
Implements a cache for a single datum.
Definition at line 64 of file ParallelPartitioner.h.
#include <Rose/BinaryAnalysis/Partitioner2/ParallelPartitioner.h>
Public Types | |
using | Value = V |
using | Key = K |
using | OptionalValue = Sawyer::Optional< Value > |
Public Member Functions | |
void | set (const Key &key, const Value &value) |
Set the cache to hold the specified key / value pair. | |
bool | maybeSet (const Key &key, const Value &value) |
Set the cache only if it doesn't contain a value. | |
OptionalValue | get (const Key &key) const |
Get the cached item if present. | |
OptionalValue | take (const Key &key) |
Take the cached item if present. | |
void | reset () |
Remove the item from the cache. | |
bool | exists (const Key &key) const |
Tests whether a value is cached. | |
using Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >::Value = V |
Definition at line 66 of file ParallelPartitioner.h.
using Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >::Key = K |
Definition at line 67 of file ParallelPartitioner.h.
using Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >::OptionalValue = Sawyer::Optional<Value> |
Definition at line 68 of file ParallelPartitioner.h.
|
inline |
Set the cache to hold the specified key / value pair.
Thread safety: This function is thread safe.
Definition at line 79 of file ParallelPartitioner.h.
|
inline |
Set the cache only if it doesn't contain a value.
Returns true of the specified value was placed into the cache, or false if the cache already contained a value. When keys are used, the value is considered to exist already only if it has the same key.
Thread safety: This function is thread safe.
Definition at line 91 of file ParallelPartitioner.h.
|
inline |
Get the cached item if present.
Thread safety: This function is thread safe.
Definition at line 105 of file ParallelPartitioner.h.
|
inline |
Take the cached item if present.
Thread safety: This function is thread safe.
Definition at line 115 of file ParallelPartitioner.h.
References Sawyer::Optional< T >::reset().
|
inline |
Remove the item from the cache.
Thread safety: This function is thread safe.
Definition at line 129 of file ParallelPartitioner.h.
References Sawyer::Optional< T >::reset().
|
inline |
Tests whether a value is cached.
Thread safety: This function is thread safe.
Definition at line 138 of file ParallelPartitioner.h.