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

Add the specified rule to the unique rule set of this object&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
addRule(xref:BloombergLP/ball/Rule.adoc[Rule] const& ruleToAdd);
----

== Description

Add the specified `ruleToAdd` to the set of (unique) rules maintained by this object&period; Return the number of rules added (i&period;e&period;, 1 on success and 0 if a rule with the same value is already present)&period; The behavior is undefined unless a lock is not held by this thread on the mutex returned by `rulesetMutex`&period;

== Return Value

number of rules added (1 on success, 0 if already present)

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ruleToAdd*
| rule to add
|===


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