BloombergLP::balb::ControlManager::registerHandler

Register a handler for messages with the specified prefix.

Synopsis

Declared in <balb_controlmanager.h>

int
registerHandler(
    std::string_view const& prefix,
    std::string_view const& arguments,
    std::string_view const& description,
    ControlHandler const& handler);

Description

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.

Return Value

positive if replaced, 0 if new, negative otherwise

Parameters

NameDescription
prefixcase-insensitive message prefix to handle
argumentsdescription of arguments accepted by the message
descriptiondescription of the message's operation
handlercallback invoked when a matching message is received