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;
337 bool isMatch(
const char *inputString)
const;
349 bsl::ostream&
print(bsl::ostream& stream,
351 int spacesPerLevel = 4)
const;
383: d_pattern(
"", basicAllocator)
384, d_thresholds(0, 0, 0, 0)
385, d_attributeSet(basicAllocator)
398: d_pattern(pattern.data(), pattern.length(), basicAllocator)
399, d_thresholds(recordLevel, passLevel, triggerLevel, triggerAllLevel)
400, d_attributeSet(basicAllocator)
408: d_pattern(original.d_pattern, basicAllocator)
409, d_thresholds(original.d_thresholds)
410, d_attributeSet(original.d_attributeSet, basicAllocator)
411, d_hashValue(original.d_hashValue)
412, d_hashSize(original.d_hashSize)
480 return d_attributeSet.
evaluate(containerList);
498 return d_attributeSet.
isMember(value);
510 return d_attributeSet.
begin();
516 return d_attributeSet.
end();
546 return d_pattern.
c_str();
561 if (lhs.d_hashValue > 0
562 && rhs.d_hashValue > 0
563 && lhs.d_hashSize == rhs.d_hashSize
564 && lhs.d_hashValue != rhs.d_hashValue) {
568 return lhs.d_pattern ==
rhs.d_pattern
569 &&
lhs.d_thresholds ==
rhs.d_thresholds
570 &&
lhs.d_attributeSet ==
rhs.d_attributeSet;
582 return rule.print(output, 0, -1);
Definition ball_attributecontainerlist.h:271
Definition ball_managedattributeset.h:128
int numAttributes() const
Return the number of attributes managed by this object.
Definition ball_managedattributeset.h:394
bool removeAttribute(const ManagedAttribute &value)
Definition ball_managedattributeset.h:356
const_iterator end() const
Definition ball_managedattributeset.h:412
const_iterator begin() const
Return an iterator referring to the first member of this attribute set.
Definition ball_managedattributeset.h:406
SetType::const_iterator const_iterator
Definition ball_managedattributeset.h:172
bool addAttribute(const ManagedAttribute &value)
Definition ball_managedattributeset.h:344
void removeAll()
Remove all attributes from this attribute set.
Definition ball_managedattributeset.h:368
bool isMember(const ManagedAttribute &value) const
Definition ball_managedattributeset.h:388
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:538
bool evaluate(const AttributeContainerList &containerList) const
Definition ball_rule.h:478
ManagedAttributeSet::const_iterator end() const
Definition ball_rule.h:514
void removeAllPredicates()
Definition ball_rule.h:451
friend bool operator!=(const Rule &, const Rule &)
int addAttribute(const ManagedAttribute &value)
Definition ball_rule.h:418
int numAttributes() const
Return the number of attributes managed by this object.
Definition ball_rule.h:484
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
bool hasAttribute(const ManagedAttribute &value) const
Definition ball_rule.h:496
int removeAttribute(const ManagedAttribute &value)
Definition ball_rule.h:431
bool hasPredicate(const Predicate &value) const
Definition ball_rule.h:502
friend bsl::ostream & operator<<(bsl::ostream &, const Rule &)
int recordLevel() const
Return the record level of this object.
Definition ball_rule.h:520
void setPattern(const bsl::string_view &value)
Set the pattern of this object to the specified value.
Definition ball_rule.h:470
int setLevels(int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
Definition ball_rule.h:457
const char * pattern() const
Return the pattern of this object.
Definition ball_rule.h:544
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:490
ManagedAttributeSet::const_iterator begin() const
Definition ball_rule.h:508
BSLMF_NESTED_TRAIT_DECLARATION(Rule, bslma::UsesBslmaAllocator)
int passLevel() const
Return the pass level of this object.
Definition ball_rule.h:526
void removeAll()
Remove all attributes from this rule.
Definition ball_rule.h:444
int triggerLevel() const
Return the trigger level of this object.
Definition ball_rule.h:532
Rule(bslma::Allocator *basicAllocator=0)
Definition ball_rule.h:382
friend bool operator==(const Rule &, const Rule &)
static int hash(const Rule &rule, int size)
int addPredicate(const ManagedAttribute &value)
Definition ball_rule.h:425
int removePredicate(const ManagedAttribute &value)
Definition ball_rule.h:438
bool isMatch(const char *inputString) const
Definition ball_rule.h:550
Definition ball_thresholdaggregate.h:101
int triggerLevel() const
Return the trigger level of this threshold aggregate.
Definition ball_thresholdaggregate.h:290
int recordLevel() const
Return the record level of this threshold aggregate.
Definition ball_thresholdaggregate.h:278
int passLevel() const
Return the pass level of this threshold aggregate.
Definition ball_thresholdaggregate.h:284
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:296
Definition bslstl_stringview.h:471
Definition bslstl_string.h:1252
const CHAR_TYPE * c_str() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:7405
basic_string & assign(const basic_string &replacement)
Definition bslstl_string.h:6347
Definition bslma_allocator.h:545
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
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)
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
ALLOCATOR & lhs
Definition bslstl_string.h:3917
static bool isMatch(const char *inputString, const char *pattern)
Definition bslma_usesbslmaallocator.h:344