8#ifndef INCLUDED_BALL_CATEGORY
9#define INCLUDED_BALL_CATEGORY
141#include <balscm_version.h>
198 mutable bsls::AtomicOperations::AtomicTypes::Uint
204 mutable int d_ruleThreshold;
230 void resetCategoryHolders();
236 void updateThresholdForHolders();
369 typedef bsls::AtomicOperations::AtomicTypes::Int AtomicInt;
370 typedef bsls::AtomicOperations::AtomicTypes::Pointer AtomicPointer;
505 enum { k_BITS_PER_CHAR = 8 };
515 return d_categoryName.
c_str();
521 return d_threshold >= level;
562 return d_thresholdLevels;
575 return d_ruleThreshold;
611 return reinterpret_cast<const Category *
>(
640 category->linkCategoryHolder(categoryHolder);
648 category->resetCategoryHolders();
657 category->updateThresholdForHolders();
665 category->d_ruleThreshold = ruleThreshold;
671 unsigned int currentMask =
673 unsigned int expectedMask;
677 expectedMask = currentMask;
679 &category->d_relevantRuleMask,
682 }
while (expectedMask != currentMask);
688 unsigned int currentMask =
690 unsigned int expectedMask;
692 const unsigned int updatedMask =
694 expectedMask = currentMask;
696 &category->d_relevantRuleMask,
699 }
while (expectedMask != currentMask);
Definition ball_category.h:362
int threshold() const
Return the threshold level held by this holder.
Definition ball_category.h:616
AtomicPointer d_category_p
Definition ball_category.h:388
void setCategory(const Category *category)
Definition ball_category.h:590
void setNext(CategoryHolder *holder)
Set this holder to point to the specified holder.
Definition ball_category.h:602
CategoryHolder * next() const
Return the address of the modifiable holder held by this holder.
Definition ball_category.h:622
const Category * category() const
Definition ball_category.h:609
AtomicPointer d_next_p
Definition ball_category.h:389
@ e_DYNAMIC_CATEGORY
Definition ball_category.h:380
@ e_UNINITIALIZED_CATEGORY
Definition ball_category.h:379
void setThreshold(int threshold)
Definition ball_category.h:596
AtomicInt d_threshold
Definition ball_category.h:387
Definition ball_category.h:443
static void updateThresholdForHolders(Category *category)
Definition ball_category.h:652
static void enableRule(Category *category, int ruleIndex)
Definition ball_category.h:669
static void disableRule(Category *category, int ruleIndex)
Definition ball_category.h:686
static void setRuleThreshold(Category *category, int ruleThreshold)
Definition ball_category.h:661
static void linkCategoryHolder(Category *category, CategoryHolder *categoryHolder)
Definition ball_category.h:634
static void setRelevantRuleMask(Category *category, RuleSet::MaskType mask)
Definition ball_category.h:703
static void resetCategoryHolders(Category *category)
Definition ball_category.h:644
Definition ball_category.h:184
int maxLevel() const
Return the numerical maximum of the four levels of this category.
Definition ball_category.h:525
int triggerLevel() const
Return the trigger level of this category.
Definition ball_category.h:545
~Category()=default
Destroy this object.
Category(const char *categoryName, int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel, bslma::Allocator *basicAllocator=0)
int triggerAllLevel() const
Return the trigger-all level of this category.
Definition ball_category.h:552
const char * categoryName() const
Return the name of this category.
Definition ball_category.h:513
static bool areValidThresholdLevels(int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
Definition ball_category.h:500
BSLMF_NESTED_TRAIT_DECLARATION(Category, bslma::UsesBslmaAllocator)
RuleSet::MaskType relevantRuleMask() const
Definition ball_category.h:579
int ruleThreshold() const
Definition ball_category.h:572
int recordLevel() const
Return the record level of this category.
Definition ball_category.h:531
int setLevels(int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
ThresholdAggregate thresholdLevels() const
Return the aggregate threshold levels of this category.
Definition ball_category.h:559
int passLevel() const
Return the pass level of this category.
Definition ball_category.h:538
bool isEnabled(int level) const
Definition ball_category.h:519
int threshold() const
Definition ball_category.h:566
unsigned int MaskType
Definition ball_ruleset.h:158
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 triggerAllLevel() const
Return the trigger-all level of this threshold aggregate.
Definition ball_thresholdaggregate.h:266
Definition bslstl_string.h:1281
const CHAR_TYPE * c_str() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:6705
Definition bslma_allocator.h:457
Definition bslmt_lockguard.h:234
Definition bslmt_mutex.h:315
Definition bsls_atomic.h:743
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_DELETED
Definition bsls_keyword.h:609
Definition ball_administration.h:214
static unsigned int withBitSet(unsigned int value, int index)
Definition bdlb_bitutil.h:605
static unsigned int withBitCleared(unsigned int value, int index)
Definition bdlb_bitutil.h:581
Definition bslma_usesbslmaallocator.h:343
Definition bsls_atomicoperations.h:834
static unsigned int getUintAcquire(AtomicTypes::Uint const *atomicUint)
Definition bsls_atomicoperations.h:1908
static unsigned int getUintRelaxed(AtomicTypes::Uint const *atomicUint)
Definition bsls_atomicoperations.h:1915
static void setUintRelease(AtomicTypes::Uint *atomicUint, unsigned int value)
Definition bsls_atomicoperations.h:1943
static void * getPtrAcquire(AtomicTypes::Pointer const *atomicPtr)
Definition bsls_atomicoperations.h:2312
static void setIntRelaxed(AtomicTypes::Int *atomicInt, int value)
Definition bsls_atomicoperations.h:1552
static unsigned int testAndSwapUintAcqRel(AtomicTypes::Uint *atomicUint, unsigned int compareValue, unsigned int swapValue)
Definition bsls_atomicoperations.h:1972
static int getIntRelaxed(AtomicTypes::Int const *atomicInt)
Definition bsls_atomicoperations.h:1534
static void setPtrRelease(AtomicTypes::Pointer *atomicPtr, void *value)
Definition bsls_atomicoperations.h:2345