Stroika Library 3.0d23
 
Loading...
Searching...
No Matches
Stroika::Foundation::Cache::ICache Concept Reference

Check if the argument CACHE is a valid 'stroika cache' class, following its api. More...

#include <Common.h>

Concept definition

template<typename CACHE, typename KEY, typename VALUE>
concept Stroika::Foundation::Cache::ICache = IKey<KEY> and IValue<VALUE> and not(not IKeyedCache<KEY> and IValuelessCache<VALUE>) and
(
(IKeyedCache<KEY> and ((IValuelessCache<VALUE> and
requires (CACHE c, KEY k) {
{ c.Add (k) };
{ c.Lookup (k) } -> convertible_to<optional<KEY>>;
{ c.LookupValue (k, function<VALUE (KEY)>{}) } -> convertible_to<KEY>;
}) or
(not IValuelessCache<VALUE> and
requires (CACHE c, KEY k, VALUE v) {
{ c.Add (k, v) };
{ c.Lookup (k) } -> convertible_to<optional<VALUE>>;
{ c.LookupValue (k, function<VALUE (KEY)>{}) } -> convertible_to<VALUE>;
})))
or (not IKeyedCache<KEY> and requires (CACHE c, VALUE v) {
{ c.Add (v) };
{ c.Lookup () } -> convertible_to<optional<VALUE>>;
{ c.LookupValue (function<VALUE ()>{}) } -> convertible_to<VALUE>;
}))
Check if the argument CACHE is a valid 'stroika cache' class, following its api.
A KEY is any copyable value (or the sentinal type void - indicating a keyless - single valued - cache...
any copyable type can use used as the value, or the special sentinal type - ValuelessSentinalType,...

Detailed Description

Check if the argument CACHE is a valid 'stroika cache' class, following its api.

Note
ICache allows for both Valueless (IValuelessCache) and Keyless (IKeyedCache) caches, but some cache implementations may not support one or the other.

Also, this API/Interface does NOT support BloomFilters, because they don't have the lookup () function (due to false positives).

Definition at line 73 of file Foundation/Cache/Common.h.