UHD  003.000.c6c4b01e0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Typedefs | Functions
uhd::warning Namespace Reference

Typedefs

typedef boost::function< void(std::string)> handler_t
 Callback function type for a message handler. More...
 

Functions

UHD_API void post (const std::string &msg)
 
UHD_API void register_handler (const std::string &name, const handler_t &handler)
 
UHD_API handler_t unregister_handler (const std::string &name)
 
UHD_API const std::vector< std::string > registry_names (void)
 

Typedef Documentation

◆ handler_t

typedef boost::function<void(std::string)> uhd::warning::handler_t

Callback function type for a message handler.

Function Documentation

◆ post()

UHD_API void uhd::warning::post ( const std::string &  msg)

Post a warning message to all registered handlers.

Parameters
msgthe multiline warning message

◆ register_handler()

UHD_API void uhd::warning::register_handler ( const std::string &  name,
const handler_t handler 
)

Register a new handler with this name. If the name was already registered for this name, the old registered handler will be replaced.

Parameters
namea unique name for this handler
handlerthe callback handler function

◆ registry_names()

UHD_API const std::vector<std::string> uhd::warning::registry_names ( void  )

Get a list of registered handler names.

Returns
a vector of unique string names

◆ unregister_handler()

UHD_API handler_t uhd::warning::unregister_handler ( const std::string &  name)

Unregister a handler for this name.

Parameters
namea unique name for a registered handler
Returns
the handler that was registered
Exceptions
errorwhen the name was not found in the registry