[#BloombergLP-balb-ControlManager] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balb.adoc[balb]::ControlManager :relfileprefix: ../../ :mrdocs: Dispatch control messages to callbacks by name. == Synopsis Declared in `<balb_controlmanager.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class ControlManager; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balb/ControlManager/ControlHandler.adoc[`ControlHandler`] | Defines a type alias for the function called to handle control messages. The `prefix` argument is the first space‐delimited word read from the message, and the `stream` argument is the `bsl::istream` containing the remainder of the message. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balb/ControlManager/2constructor.adoc[`ControlManager`] [.small]#[constructor]# | Create a control manager object. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. | xref:BloombergLP/balb/ControlManager/2destructor.adoc[`~ControlManager`] [.small]#[destructor]# | Destroy this object. | xref:BloombergLP/balb/ControlManager/allocator.adoc[`allocator`] | Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the default allocator in effect at construction is used. | xref:BloombergLP/balb/ControlManager/deregisterDefaultHandler.adoc[`deregisterDefaultHandler`] | Deregister the callback function previously registered (see `registerDefaultHandler`) to handle messages with unregistered prefixes. Return 0 on success or a non‐zero value otherwise. | xref:BloombergLP/balb/ControlManager/deregisterHandler.adoc[`deregisterHandler`] | Deregister the callback function previously registered to handle the specified `prefix`. Return 0 on success or a non‐zero value otherwise. | xref:BloombergLP/balb/ControlManager/deregisterUsageHandler.adoc[`deregisterUsageHandler`] | Deregister the callback function previously registered to handle "HELP" messages (see `registerUsageHandler`). Return 0 on success or a non‐zero value otherwise. | xref:BloombergLP/balb/ControlManager/dispatchMessage-0a.adoc[`dispatchMessage`] | `dispatchMessage` overloads | xref:BloombergLP/balb/ControlManager/hasDefaultHandler.adoc[`hasDefaultHandler`] | Return `true` if this control manager has a default message handler installed, and `false` otherwise. | xref:BloombergLP/balb/ControlManager/printUsage.adoc[`printUsage`] | Print to the specified `stream` the specified `preamble` text, followed by the registered commands and documentation for this control manager. Note that a newline is appended to `preamble` in the output. | xref:BloombergLP/balb/ControlManager/printUsageHelper.adoc[`printUsageHelper`] | Invoke `printUsage` passing the specified `*stream` and `preamble`. Suitable for binding using the bdlf::BindUtil package. | xref:BloombergLP/balb/ControlManager/registerDefaultHandler.adoc[`registerDefaultHandler`] | Register the specified `handler` to be invoked whenever a control message having an unregistered (case‐insensitive) `prefix` is received by this control manager. Return a positive value if an existing callback was replaced, return 0 if no replacement occurred, and return a negative value otherwise. | xref:BloombergLP/balb/ControlManager/registerHandler.adoc[`registerHandler`] | Register the specified `handler` to be invoked whenever a control message having the specified case‐insensitive `prefix` is received by this control manager. Also register the specified `arguments` string to describe the arguments accepted by the message, and the specified `description` to describe its operation; these are printed by `printUsage`. Return a positive value if an existing callback was replaced, return 0 if no replacement occurred, and return a negative value otherwise. | xref:BloombergLP/balb/ControlManager/registerUsageHandler.adoc[`registerUsageHandler`] | Register a handler that, on receipt of a (case‐insensitive) "HELP" message, prints to the specified stream a list of this `ControlManager`s registered commands and their documentation. Return a positive value if an existing callback was replaced, return 0 if no replacement occurred, and return a negative value otherwise. | xref:BloombergLP/balb/ControlManager/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<ControlManager, UsesBslmaAllocator>`] | Declare that this type uses a `bslma` allocator. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#