BDE 4.39.x Production Release
Loading...
Searching...
No Matches
ball_thresholddefaults.h
Go to the documentation of this file.
1/// @file ball_thresholddefaults.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// ball_thresholddefaults.h -*-C++-*-
8#ifndef INCLUDED_BALL_THRESHOLDDEFAULTS
9#define INCLUDED_BALL_THRESHOLDDEFAULTS
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup ball_thresholddefaults ball_thresholddefaults
15/// @brief Provide default threshold values.
16/// @addtogroup bal
17/// @{
18/// @addtogroup ball
19/// @{
20/// @addtogroup ball_thresholddefaults
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#ball_thresholddefaults-purpose"> Purpose</a>
25/// * <a href="#ball_thresholddefaults-classes"> Classes </a>
26/// * <a href="#ball_thresholddefaults-description"> Description </a>
27/// * <a href="#ball_thresholddefaults-usage"> Usage </a>
28/// * <a href="#ball_thresholddefaults-example-1-accessing-default-threshold-values"> Example 1: Accessing Default Threshold Values </a>
29///
30/// # Purpose {#ball_thresholddefaults-purpose}
31/// Provide default threshold values.
32///
33/// # Classes {#ball_thresholddefaults-classes}
34///
35/// - ball::ThresholdDefaults: threshold defaults values
36///
37/// @see ball_loggermanagerdefaults, ball_categorymanager
38///
39/// # Description {#ball_thresholddefaults-description}
40/// This component provides a namespace for the 4 default threshold
41/// level constants.
42///
43/// ## Usage {#ball_thresholddefaults-usage}
44///
45///
46/// This section illustrates intended use of this component.
47///
48/// ### Example 1: Accessing Default Threshold Values {#ball_thresholddefaults-example-1-accessing-default-threshold-values}
49///
50///
51/// The following example demonstrates how to access the default threshold
52/// values provided by 'ball::ThresholdDefaults'.
53///
54/// Suppose we are implementing a function that initializes threshold levels
55/// for a logging system. We can use the constants provided by
56/// 'ball::ThresholdDefaults' to supply reasonable default values:
57/// @code
58/// void initializeThresholds(int *recordLevel,
59/// int *passLevel,
60/// int *triggerLevel,
61/// int *triggerAllLevel)
62/// // Initialize the specified threshold levels to their default values.
63/// {
64/// *recordLevel = ball::ThresholdDefaults::k_RECORD_LEVEL;
65/// *passLevel = ball::ThresholdDefaults::k_PASS_LEVEL;
66/// *triggerLevel = ball::ThresholdDefaults::k_TRIGGER_LEVEL;
67/// *triggerAllLevel = ball::ThresholdDefaults::k_TRIGGER_ALL_LEVEL;
68/// }
69/// @endcode
70/// Then, we can call this function and verify it sets the values correctly:
71/// @code
72/// int recordLevel, passLevel, triggerLevel, triggerAllLevel;
73///
74/// initializeThresholds(&recordLevel,
75/// &passLevel,
76/// &triggerLevel,
77/// &triggerAllLevel);
78/// @endcode
79/// Finally, the default values provide a reasonable starting configuration
80/// where 'k_RECORD_LEVEL' (`e_OFF`, 0) disables recording of messages to
81/// memory, 'k_PASS_LEVEL' (`e_ERROR`, 64) passes only ERROR level messages and
82/// above, 'k_TRIGGER_LEVEL' (`e_OFF`, 0) disables trigger of publication on
83/// single message, and 'k_TRIGGER_ALL_LEVEL' (`e_OFF`, 0) disables trigger of
84/// publication on all messages:
85/// @code
86/// assert(ball::Severity::e_OFF == recordLevel );
87/// assert(ball::Severity::e_ERROR == passLevel );
88/// assert(ball::Severity::e_OFF == triggerLevel );
89/// assert(ball::Severity::e_OFF == triggerAllLevel);
90/// @endcode
91/// @}
92/** @} */
93/** @} */
94
95/** @addtogroup bal
96 * @{
97 */
98/** @addtogroup ball
99 * @{
100 */
101/** @addtogroup ball_thresholddefaults
102 * @{
103 */
104
105#include <balscm_version.h>
106
107#include <ball_severity.h>
108
109
110namespace ball {
111
112 // =======================
113 // class ThresholdDefaults
114 // =======================
115
116/// This struct provides a namespace for default threshold level related
117/// constants.
118///
119/// See @ref ball_thresholddefaults
121
122 // CONSTANTS
123 static const int k_RECORD_LEVEL = Severity::e_OFF; // disabled
124 static const int k_PASS_LEVEL = Severity::e_ERROR; // ERROR & above
125 static const int k_TRIGGER_LEVEL = Severity::e_OFF; // disabled
126 static const int k_TRIGGER_ALL_LEVEL = Severity::e_OFF; // disabled
127};
128
129} // close package namespace
130
131
132#endif
133
134// ----------------------------------------------------------------------------
135// Copyright 2025 Bloomberg Finance L.P.
136//
137// Licensed under the Apache License, Version 2.0 (the "License");
138// you may not use this file except in compliance with the License.
139// You may obtain a copy of the License at
140//
141// http://www.apache.org/licenses/LICENSE-2.0
142//
143// Unless required by applicable law or agreed to in writing, software
144// distributed under the License is distributed on an "AS IS" BASIS,
145// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
146// See the License for the specific language governing permissions and
147// limitations under the License.
148// ----------------------------- END-OF-FILE ----------------------------------
149
150/** @} */
151/** @} */
152/** @} */
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition ball_administration.h:214
@ e_ERROR
Definition ball_severity.h:175
@ e_OFF
Definition ball_severity.h:173
Definition ball_thresholddefaults.h:120
static const int k_TRIGGER_ALL_LEVEL
Definition ball_thresholddefaults.h:126
static const int k_RECORD_LEVEL
Definition ball_thresholddefaults.h:123
static const int k_PASS_LEVEL
Definition ball_thresholddefaults.h:124
static const int k_TRIGGER_LEVEL
Definition ball_thresholddefaults.h:125