[#BloombergLP-ball-AttributeContext_RuleEvaluationCache]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::AttributeContext&lowbar;RuleEvaluationCache
:relfileprefix: ../../
:mrdocs:

Implementation type that evaluates and caches whether logging rules are active&period;

== Synopsis

Declared in `&lt;ball&lowbar;attributecontext&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class AttributeContext&lowbar;RuleEvaluationCache;
----

== Description

This is an implementation type of `AttributeContext` and should not be used by clients of this package&period; A rule evaluation cache is a mechanism for evaluating and caching whether a rule is active&period; A rule is considered active if all of its attributes are satisfied by the collection of attributes held in a `AttributeContainerList` object (i&period;e&period;, `Rule&colon;&colon;evaluate` returns `true` for the `AttributeContainerList` object)&period; The rules this cache evaluates are contained in a `RuleSet` object&period; `RuleSet&colon;&colon;MaskType` is a bit mask for a rule set, where each bit is a boolean value associated with the rule at the corresponding index in a rule set&period; An `AttributeContext` determines, using the `isDataAvailable` method, if a particular set of rules (described using a bit mask) have already been evaluated&period; A context accesses the current cache of rule evaluations using the `knownActiveRules` method&period; Finally, a context updates the cache of rule evaluations using the `update` method&period; Note that the `isDataAvailable` method should be used prior to using `knownActiveRules` in order to ensure the relevant rules have been evaluated and that those evaluations are up&hyphen;to&hyphen;date&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/AttributeContext_RuleEvaluationCache/2constructor.adoc[`AttributeContext&lowbar;RuleEvaluationCache`]         [.small]#[constructor]#
| Create an empty rule evaluation cache having a sequence number of &hyphen;1&period;
| xref:BloombergLP/ball/AttributeContext_RuleEvaluationCache/clear.adoc[`clear`] 
| Clear any currently cached rule evaluation data, restoring this object to its default constructed state (empty)&period;
| xref:BloombergLP/ball/AttributeContext_RuleEvaluationCache/isDataAvailable.adoc[`isDataAvailable`] 
| Return whether this cache has up&hyphen;to&hyphen;date evaluations for the given rules&period;
| xref:BloombergLP/ball/AttributeContext_RuleEvaluationCache/knownActiveRules.adoc[`knownActiveRules`] 
| Return a bit mask of rules known to be active after the last update&period;
| xref:BloombergLP/ball/AttributeContext_RuleEvaluationCache/print.adoc[`print`] 
| Format this object to the specified output stream&period;
| xref:BloombergLP/ball/AttributeContext_RuleEvaluationCache/update.adoc[`update`] 
| Update the cache of rule evaluations for the specified sequence number and rules&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
