8#ifndef INCLUDED_BALL_RULE
9#define INCLUDED_BALL_RULE
134#include <balscm_version.h>
148#include <bsl_string.h>
153class AttributeContainerList;
189 mutable int d_hashValue;
192 mutable int d_hashSize;
333 bool isMatch(
const char *inputString)
const;
345 bsl::ostream&
print(bsl::ostream& stream,
347 int spacesPerLevel = 4)
const;
379: d_pattern(
"", basicAllocator)
380, d_thresholds(0, 0, 0, 0)
381, d_attributeSet(basicAllocator)
394: d_pattern(pattern.data(), pattern.length(), basicAllocator)
395, d_thresholds(recordLevel, passLevel, triggerLevel, triggerAllLevel)
396, d_attributeSet(basicAllocator)
404: d_pattern(original.d_pattern, basicAllocator)
405, d_thresholds(original.d_thresholds)
406, d_attributeSet(original.d_attributeSet, basicAllocator)
407, d_hashValue(original.d_hashValue)
408, d_hashSize(original.d_hashSize)
476 return d_attributeSet.
evaluate(containerList);
494 return d_attributeSet.
isMember(value);
506 return d_attributeSet.
begin();
512 return d_attributeSet.
end();
542 return d_pattern.
c_str();
557 if (lhs.d_hashValue > 0
558 && rhs.d_hashValue > 0
559 && lhs.d_hashSize == rhs.d_hashSize
560 && lhs.d_hashValue != rhs.d_hashValue) {
564 return lhs.d_pattern == rhs.d_pattern
565 && lhs.d_thresholds == rhs.d_thresholds
566 && lhs.d_attributeSet == rhs.d_attributeSet;
572 return !(lhs == rhs);
578 return rule.print(output, 0, -1);
Definition ball_attributecontainerlist.h:267
Definition ball_managedattributeset.h:127
int numAttributes() const
Return the number of attributes managed by this object.
Definition ball_managedattributeset.h:388
bool removeAttribute(const ManagedAttribute &value)
Definition ball_managedattributeset.h:350
const_iterator end() const
Definition ball_managedattributeset.h:406
const_iterator begin() const
Definition ball_managedattributeset.h:400
SetType::const_iterator const_iterator
Definition ball_managedattributeset.h:169
bool addAttribute(const ManagedAttribute &value)
Definition ball_managedattributeset.h:338
void removeAll()
Remove all attributes from this attribute set.
Definition ball_managedattributeset.h:362
bool isMember(const ManagedAttribute &value) const
Definition ball_managedattributeset.h:382
bool evaluate(const AttributeContainerList &containerList) const
Definition ball_managedattribute.h:117
Definition ball_rule.h:177
int triggerAllLevel() const
Return the trigger-all level of this object.
Definition ball_rule.h:534
bool evaluate(const AttributeContainerList &containerList) const
Definition ball_rule.h:474
ManagedAttributeSet::const_iterator end() const
Definition ball_rule.h:510
void removeAllPredicates()
Definition ball_rule.h:447
friend bool operator!=(const Rule &, const Rule &)
int addAttribute(const ManagedAttribute &value)
Definition ball_rule.h:414
int numAttributes() const
Return the number of attributes managed by this object.
Definition ball_rule.h:480
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
bool hasAttribute(const ManagedAttribute &value) const
Definition ball_rule.h:492
int removeAttribute(const ManagedAttribute &value)
Definition ball_rule.h:427
bool hasPredicate(const Predicate &value) const
Definition ball_rule.h:498
friend bsl::ostream & operator<<(bsl::ostream &, const Rule &)
int recordLevel() const
Return the record level of this object.
Definition ball_rule.h:516
void setPattern(const bsl::string_view &value)
Set the pattern of this object to the specified value.
Definition ball_rule.h:466
int setLevels(int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
Definition ball_rule.h:453
const char * pattern() const
Return the pattern of this object.
Definition ball_rule.h:540
Rule & operator=(const Rule &rhs)
Assign to this object the value of the specified rhs object.
~Rule()=default
Destroy this object.
int numPredicates() const
Definition ball_rule.h:486
ManagedAttributeSet::const_iterator begin() const
Definition ball_rule.h:504
BSLMF_NESTED_TRAIT_DECLARATION(Rule, bslma::UsesBslmaAllocator)
int passLevel() const
Return the pass level of this object.
Definition ball_rule.h:522
void removeAll()
Remove all attributes from this rule.
Definition ball_rule.h:440
int triggerLevel() const
Return the trigger level of this object.
Definition ball_rule.h:528
Rule(bslma::Allocator *basicAllocator=0)
Definition ball_rule.h:378
friend bool operator==(const Rule &, const Rule &)
static int hash(const Rule &rule, int size)
int addPredicate(const ManagedAttribute &value)
Definition ball_rule.h:421
int removePredicate(const ManagedAttribute &value)
Definition ball_rule.h:434
bool isMatch(const char *inputString) const
Definition ball_rule.h:546
Definition ball_thresholdaggregate.h:97
int triggerLevel() const
Return the trigger level of this threshold aggregate.
Definition ball_thresholdaggregate.h:260
int recordLevel() const
Return the record level of this threshold aggregate.
Definition ball_thresholdaggregate.h:248
int passLevel() const
Return the pass level of this threshold aggregate.
Definition ball_thresholdaggregate.h:254
int setLevels(int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
int triggerAllLevel() const
Return the trigger-all level of this threshold aggregate.
Definition ball_thresholdaggregate.h:266
Definition bslstl_stringview.h:441
Definition bslstl_string.h:1281
const CHAR_TYPE * c_str() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:6705
basic_string & assign(const basic_string &replacement)
Definition bslstl_string.h:5716
Definition bslma_allocator.h:457
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition ball_administration.h:214
bsl::ostream & operator<<(bsl::ostream &output, const Attribute &attribute)
bool operator!=(const Attribute &lhs, const Attribute &rhs)
bool operator==(const Attribute &lhs, const Attribute &rhs)
static bool isMatch(const char *inputString, const char *pattern)
Definition bslma_usesbslmaallocator.h:343