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

Name

Description

prefix

case‐insensitive message prefix to handle

arguments

description of arguments accepted by the message

description

description of the message's operation

handler

callback invoked when a matching message is received

Created with MrDocs