[#BloombergLP-ball-CategoryManager-addCategory-07]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/CategoryManager.adoc[CategoryManager]::addCategory
:relfileprefix: ../../../
:mrdocs:

Add a category with the specified name and threshold levels&period;

== Synopsis

Declared in `&lt;ball&lowbar;categorymanager&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/ball/Category.adoc[Category]*
addCategory(
    char const* categoryName,
    int recordLevel,
    int passLevel,
    int triggerLevel,
    int triggerAllLevel);
----

== Description

Add to the registry of this category manager a category having the specified `categoryName`, possibly changed by the registered category name filter callback, and having the specified `recordLevel`, `passLevel`, `triggerLevel`, and `triggerAllLevel` threshold values, respectively, if there is no category having (the possibly filtered) `categoryName` and each of the specified threshold values is in the range `&lsqb;0 &period;&period; 255&rsqb;`&period; Return the address of the newly&hyphen;created, modifiable category on success, and 0 otherwise&period; The behavior is undefined unless a lock is not held by this thread on the mutex returned by `rulesetMutex`&period; Note that if a category having (the possibly filtered) `categoryName` already exists in the registry, 0 is returned&period; Note that an existing category will not be modified if a category with the (possibly filtered) `categoryName` already exists&period;

== Return Value

address of the newly&hyphen;created category on success, and 0 otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *categoryName*
| name of the category to add
| *recordLevel*
| record threshold level for the new category
| *passLevel*
| pass threshold level for the new category
| *triggerLevel*
| trigger threshold level for the new category
| *triggerAllLevel*
| trigger&hyphen;all threshold level for the new category
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
