Dynamic Probe Class Library

DPCL Class Reference


Chapter 17. Miscellaneous functions

The functions in this chapter are used to initialize the DPCL environment, handle message processing, and allow the client to override message handling callbacks.

Ais_end_main_loop

Synopsis

#include <AisMainLoop.h>
void Ais_end_main_loop(void);

Description

This function is used to indicate to the main event loop that processing is to be terminated, and no more events are to be consumed. It does not cause any connections to be lost, nor to be closed. It only terminates the event processing loop that gathers event messages from all connected daemons.

See Also

Ais_main_loop

Ais_initialize

Synopsis

#include <AisInit.h>
void Ais_initialize(void);

Description

This function is used to control the initialization of DPCL. It must be called once before using any other DPCL calls.

See Also

Ais_main_loop

Ais_main_loop

Synopsis

#include <AisMainLoop.h>
void Ais_main_loop(void);

Description

This function is the main event loop for the instrumentation system. This loop processes events in the form of special messages from daemons, instrumented processes, signals registered using Ais_add_signal, and file descriptors registered using Ais_add_fd. It must be called after Ais_initialize. It must be called in order for the instrumentation system to process events and messages from the application processes. This function does not return control to the caller until Ais_end_main_loop() is called.

See Also

Ais_add_fd, Ais_add_signal, Ais_end_main_loop

Ais_override_default_callback

Synopsis

#include <AisHandler.h>
AisStatus Ais_override_default_callback(
        unsigned msg_type,
        GCBFuncType new_cb_fp,
        GCBTagType new_cb_tag,
        GCBFuncType &old_cb_fp,
        GCBTagType &old_cb_tag);

Parameters

msg_type
message type (see Chapter 19, Predefined message types for which the callbacks are to be overridden).

new_cb_fp
callback function to be invoked when messages of the specified type are received

new_cb_tag
tag to be used with the new callback function

old_cb_fp
callback function previously registered for this message type

old_cb_tag
tag previously registered for this message type

Description

This function allows the caller to replace the callback associated with the specified message type with a new callback function. When the client receives a message from a daemon or other message source that uses the messaging/callback system there is a message type identifier associated with the message. This message type identifier is used as a key for looking up a callback chain to be executed as a result of receiving that message. The message itself, information contained within the message, the tag, and other information are passed to the callback function.

Return Values

The return value indicates whether the attempt to override the callback was successful. For information on predefined message types, refer to Chapter 19, Predefined message types.

ASC_success
message type is registered and the callback was updated

ASC_operation_failed
message type is not registered

See Also

AIS_DEFAULT_MSG, AIS_EXIT_MSG, AIS_PROC_TERMINATE_MSG


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]