[#BloombergLP-ball-CategoryManager-setCategory-00]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/CategoryManager.adoc[CategoryManager]::setCategory
:relfileprefix: ../../../
:mrdocs:

`setCategory` overloads

== Synopses

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

Add to this category registry a new category having the specified `categoryName`, possibly changed by the registered category name filter callback, and default threshold levels if (the possibly filtered) `categoryName` is not present in the registry and the number of categories in the registry is less than the registry capacity&period; Return the address of the (possibly newly&hyphen;created) non&hyphen;modifiable category having (the possibly filtered) `categoryName`, if such a category exists, and the address of the non&hyphen;modifiable _Default_ _Category_ otherwise&period; The behavior is undefined unless `categoryName` is null&hyphen;terminated&period; Note that a valid category address is _always_ returned&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/ball/Category.adoc[Category] const*
xref:BloombergLP/ball/CategoryManager/setCategory-0d.adoc[setCategory](char const* categoryName);
----

[.small]#xref:BloombergLP/ball/CategoryManager/setCategory-0d.adoc[_» more&period;&period;&period;_]#

Add to this category registry a new category having the specified `categoryName`, possibly changed by the registered category name filter callback, and default threshold levels if (the possibly filtered) `categoryName` is not present in the registry and the number of categories in the registry is less than the registry capacity&period; Return the address of the (possibly newly&hyphen;created) non&hyphen;modifiable category having (the possibly filtered) `categoryName`, if such a category exists, and the address of the non&hyphen;modifiable _Default_ _Category_ otherwise&period; If the specified `categoryHolder` is non&hyphen;null, then also load into `categoryHolder` the returned category and its maximum level and link `categoryHolder` to the category if it has not yet been linked&period; The behavior is undefined unless `categoryName` is null&hyphen;terminated&period; Note that a valid category address is _always_ returned&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/ball/Category.adoc[Category] const*
xref:BloombergLP/ball/CategoryManager/setCategory-04.adoc[setCategory](
    xref:BloombergLP/ball/CategoryHolder.adoc[CategoryHolder]* categoryHolder,
    char const* categoryName);
----

[.small]#xref:BloombergLP/ball/CategoryManager/setCategory-04.adoc[_» more&period;&period;&period;_]#

Add to this category registry a new category having the specified `categoryName`, possibly changed by the registered category name filter callback, and having `recordLevel`, `passLevel`, `triggerLevel`, and `triggerAllLevel` threshold levels, respectively, if (1) (the possibly filtered) `categoryName` is not present in the registry, (2) the number of categories in the registry is less than the registry capacity, and (3) `recordLevel`, `passLevel`, `triggerLevel`, and `triggerAllLevel` are all within the range `&lsqb;0 &period;&period; 255&rsqb;`&period; If (the possibly filtered) `categoryName` is already present and each threshold level is within the valid range then reset the threshold levels of (the possibly filtered) `categoryName` to the specified values&period; Return the address of the (possibly newly&hyphen;created) modifiable category having (the possibly filtered) `categoryName` if that `categoryName` was either created or its thresholds reset, and 0 otherwise&period; The behavior is undefined unless `categoryName` is null&hyphen;terminated&period; Note that 0, and _not_ the _Default_ _Category_, is returned on failure&period;


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

[.small]#xref:BloombergLP/ball/CategoryManager/setCategory-0f.adoc[_» more&period;&period;&period;_]#


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