This class defines a value-semantic object that holds a pattern, four threshold levels, and an attribute set. For each of these fields there is an accessor for obtaining the field value and a manipulator for changing that value. There are a few methods as well for directly adding/removing/searching attributes.
Additionally, this class supports a complete set of value semantic operations, including copy construction, assignment and equality comparison, and ostream printing. A precise operational definition of when two instances have the same value can be found in the description of operator== for the class. This class is exception neutral with no guarantee of rollback: If an exception is thrown during the invocation of a method on a pre-existing instance, the object is left in a valid state, but its value is undefined. In no event is memory leaked. Finally, aliasing (e.g., using all or part of an object as both source and destination) is supported in all cases.
See ball_rule
|
| | BSLMF_NESTED_TRAIT_DECLARATION (Rule, bslma::UsesBslmaAllocator) |
| |
| | Rule (bslma::Allocator *basicAllocator=0) |
| |
| | Rule (const bsl::string_view &pattern, int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel, bslma::Allocator *basicAllocator=0) |
| |
| | Rule (const Rule &original, bslma::Allocator *basicAllocator=0) |
| |
| | ~Rule ()=default |
| |
| Rule & | operator= (const Rule &rhs) |
| |
| int | addAttribute (const ManagedAttribute &value) |
| |
| int | addPredicate (const ManagedAttribute &value) |
| |
| int | removeAttribute (const ManagedAttribute &value) |
| |
| int | removePredicate (const ManagedAttribute &value) |
| |
| void | removeAll () |
| |
| void | removeAllPredicates () |
| |
| int | setLevels (int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel) |
| |
| void | setPattern (const bsl::string_view &value) |
| |
| bool | evaluate (const AttributeContainerList &containerList) const |
| |
| int | numAttributes () const |
| |
| int | numPredicates () const |
| |
| bool | hasAttribute (const ManagedAttribute &value) const |
| |
| bool | hasPredicate (const Predicate &value) const |
| |
| ManagedAttributeSet::const_iterator | begin () const |
| |
| ManagedAttributeSet::const_iterator | end () const |
| |
| int | recordLevel () const |
| |
| int | passLevel () const |
| |
| int | triggerLevel () const |
| |
| int | triggerAllLevel () const |
| |
| const char * | pattern () const |
| |
| bool | isMatch (const char *inputString) const |
| |
| bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
| |
| bsl::ostream & ball::Rule::print |
( |
bsl::ostream & |
stream, |
|
|
int |
level = 0, |
|
|
int |
spacesPerLevel = 4 |
|
) |
| const |
Format this object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect.
| int ball::Rule::setLevels |
( |
int |
recordLevel, |
|
|
int |
passLevel, |
|
|
int |
triggerLevel, |
|
|
int |
triggerAllLevel |
|
) |
| |
|
inline |
Set the threshold levels of this object to the specified recordLevel, passLevel, triggerLevel, and triggerAllLevel values, respectively, if each of the specified values is in the range [0 .. 255]. Return 0 on success, and a non-zero value otherwise (with no effect on the threshold levels of this object).