ROSE 0.11.145.134
Public Types | Public Member Functions | List of all members
Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K > Class Template Reference

Description

template<class V, class K>
class Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >

Implements a cache for a single datum.

Definition at line 64 of file ParallelPartitioner.h.

#include <Rose/BinaryAnalysis/Partitioner2/ParallelPartitioner.h>

Inheritance diagram for Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >:
Inheritance graph
[legend]

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.
 

Member Typedef Documentation

◆ Value

template<class V , class K >
using Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >::Value = V

Definition at line 66 of file ParallelPartitioner.h.

◆ Key

template<class V , class K >
using Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >::Key = K

Definition at line 67 of file ParallelPartitioner.h.

◆ OptionalValue

template<class V , class K >
using Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >::OptionalValue = Sawyer::Optional<Value>

Definition at line 68 of file ParallelPartitioner.h.

Member Function Documentation

◆ set()

template<class V , class K >
void Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >::set ( const Key &  key,
const Value &  value 
)
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.

◆ maybeSet()

template<class V , class K >
bool Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >::maybeSet ( const Key &  key,
const Value &  value 
)
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.

◆ get()

template<class V , class K >
OptionalValue Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >::get ( const Key &  key) const
inline

Get the cached item if present.

Thread safety: This function is thread safe.

Definition at line 105 of file ParallelPartitioner.h.

◆ take()

template<class V , class K >
OptionalValue Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >::take ( const Key &  key)
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().

◆ reset()

template<class V , class K >
void Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >::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().

◆ exists()

template<class V , class K >
bool Rose::BinaryAnalysis::Partitioner2::Experimental::ParallelPartitioner::CachedItem< V, K >::exists ( const Key &  key) const
inline

Tests whether a value is cached.

Thread safety: This function is thread safe.

Definition at line 138 of file ParallelPartitioner.h.


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