[#BloombergLP-balb-ControlManager-registerHandler]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balb.adoc[balb]::xref:BloombergLP/balb/ControlManager.adoc[ControlManager]::registerHandler
:relfileprefix: ../../../
:mrdocs:

Register a handler for messages with the specified prefix&period;

== Synopsis

Declared in `&lt;balb&lowbar;controlmanager&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
registerHandler(
    std::string&lowbar;view const& prefix,
    std::string&lowbar;view const& arguments,
    std::string&lowbar;view const& description,
    xref:BloombergLP/balb/ControlManager/ControlHandler.adoc[ControlHandler] const& handler);
----

== Description

Register the specified `handler` to be invoked whenever a control message having the specified case&hyphen;insensitive `prefix` is received by this control manager&period; Also register the specified `arguments` string to describe the arguments accepted by the message, and the specified `description` to describe its operation&semi; these are printed by `printUsage`&period; Return a positive value if an existing callback was replaced, return 0 if no replacement occurred, and return a negative value otherwise&period;

== Return Value

positive if replaced, 0 if new, negative otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *prefix*
| case&hyphen;insensitive message prefix to handle
| *arguments*
| description of arguments accepted by the message
| *description*
| description of the message&apos;s operation
| *handler*
| callback invoked when a matching message is received
|===


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