8#ifndef INCLUDED_BALL_CATEGORY
9#define INCLUDED_BALL_CATEGORY
141#include <balscm_version.h>
161#include <bsl_string_view.h>
231 void resetCategoryHolders();
238 void updateThresholdForHolders();
375 typedef bsls::AtomicOperations::AtomicTypes::Int AtomicInt;
376 typedef bsls::AtomicOperations::AtomicTypes::Pointer AtomicPointer;
512 enum { k_BITS_PER_CHAR = 8 };
522 return d_categoryName.
c_str();
528 return d_threshold >= level;
616 return reinterpret_cast<const Category *
>(
645 category->linkCategoryHolder(categoryHolder);
653 category->resetCategoryHolders();
662 category->updateThresholdForHolders();
676 unsigned int currentMask = category->d_relevantRuleMask.
loadRelaxed();
677 unsigned int expectedMask;
681 expectedMask = currentMask;
685 }
while (expectedMask != currentMask);
691 unsigned int currentMask = category->d_relevantRuleMask.
loadRelaxed();
692 unsigned int expectedMask;
694 const unsigned int updatedMask =
696 expectedMask = currentMask;
700 }
while (expectedMask != currentMask);
Definition ball_category.h:367
int threshold() const
Return the threshold level held by this holder.
Definition ball_category.h:621
AtomicPointer d_category_p
Definition ball_category.h:395
void setCategory(const Category *category)
Definition ball_category.h:595
void setNext(CategoryHolder *holder)
Set this holder to point to the specified holder.
Definition ball_category.h:607
CategoryHolder * next() const
Return the address of the modifiable holder held by this holder.
Definition ball_category.h:627
const Category * category() const
Definition ball_category.h:614
AtomicPointer d_next_p
Definition ball_category.h:396
@ e_DYNAMIC_CATEGORY
Definition ball_category.h:387
@ e_UNINITIALIZED_CATEGORY
Definition ball_category.h:386
void setThreshold(int threshold)
Definition ball_category.h:601
AtomicInt d_threshold
Definition ball_category.h:394
Definition ball_category.h:450
static void updateThresholdForHolders(Category *category)
Definition ball_category.h:657
static void enableRule(Category *category, int ruleIndex)
Definition ball_category.h:674
static void disableRule(Category *category, int ruleIndex)
Definition ball_category.h:689
static void setRuleThreshold(Category *category, int ruleThreshold)
Definition ball_category.h:666
static void linkCategoryHolder(Category *category, CategoryHolder *categoryHolder)
Definition ball_category.h:639
static void setRelevantRuleMask(Category *category, RuleSet::MaskType mask)
Definition ball_category.h:704
static void resetCategoryHolders(Category *category)
Definition ball_category.h:649
Definition ball_category.h:184
int maxLevel() const
Return the numerical maximum of the four levels of this category.
Definition ball_category.h:532
int triggerLevel() const
Return the trigger level of this category.
Definition ball_category.h:552
~Category()=default
Destroy this object.
int triggerAllLevel() const
Return the trigger-all level of this category.
Definition ball_category.h:559
const char * categoryName() const
Return the name of this category.
Definition ball_category.h:520
static bool areValidThresholdLevels(int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
Definition ball_category.h:507
BSLMF_NESTED_TRAIT_DECLARATION(Category, bslma::UsesBslmaAllocator)
RuleSet::MaskType relevantRuleMask() const
Definition ball_category.h:584
int ruleThreshold() const
Definition ball_category.h:578
Category(const bsl::string_view &categoryName, int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel, bslma::Allocator *basicAllocator=0)
int recordLevel() const
Return the record level of this category.
Definition ball_category.h:538
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:566
int passLevel() const
Return the pass level of this category.
Definition ball_category.h:545
bool isEnabled(int level) const
Definition ball_category.h:526
int threshold() const
Definition ball_category.h:572
unsigned int MaskType
Definition ball_ruleset.h:158
static ThresholdAggregate unpack(unsigned packed)
Definition ball_thresholdaggregate.h:397
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 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
Definition bslma_allocator.h:545
Definition bslmt_lockguard.h:234
Definition bslmt_mutex.h:317
Definition bsls_atomic.h:744
int loadAcquire() const
Definition bsls_atomic.h:1753
void storeRelease(int value)
Definition bsls_atomic.h:1687
Definition bsls_atomic.h:1050
unsigned int testAndSwapAcqRel(unsigned int compareValue, unsigned int swapValue)
Definition bsls_atomic.h:2077
unsigned int loadAcquire() const
Definition bsls_atomic.h:2100
unsigned int loadRelaxed() const
Definition bsls_atomic.h:2106
void storeRelease(unsigned int value)
Definition bsls_atomic.h:2032
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
#define BSLS_KEYWORD_DELETED
Definition bsls_keyword.h:651
Definition ball_administration.h:214
static unsigned int withBitSet(unsigned int value, int index)
Definition bdlb_bitutil.h:595
static unsigned int withBitCleared(unsigned int value, int index)
Definition bdlb_bitutil.h:571
Definition bslma_usesbslmaallocator.h:344
Definition bsls_atomicoperations.h:836
static void * getPtrAcquire(AtomicTypes::Pointer const *atomicPtr)
Definition bsls_atomicoperations.h:2314
static void setIntRelaxed(AtomicTypes::Int *atomicInt, int value)
Definition bsls_atomicoperations.h:1554
static int getIntRelaxed(AtomicTypes::Int const *atomicInt)
Definition bsls_atomicoperations.h:1536
static void setPtrRelease(AtomicTypes::Pointer *atomicPtr, void *value)
Definition bsls_atomicoperations.h:2347