Class CPBComponent

Components and Contexts Overview ,   Working With Components and Contexts


The CPBComponent class provides a streamlined set of functions for working with PB_COMPONENT structures as well as some added C++ specific functionality for push/pop behavior. It can be used to manage either an internal structure or an external one whose address is provided.

Note that the default arguments for the CPBComponent and CPBContext constructors differ in that a component is normally set as the default for the entire module whereas a context is normally set as the default only for the particular thread.

Note also that when a default component is set for a thread the API may appear to leak thread handles. See the Troubleshooting appendix for further information.

Class members:

CPBComponent Initializes and/or sets the component as the default for the thread or module.

~CPBComponent Restores the previous default component if the constructor set a new one.

operator PB_COMPONENT* Returns a pointer to the underlying PB_COMPONENT structure.

SetName Sets the name of the component.

SetMessageKey Sets the message key for the component.

SetExclude Sets the componentís exclusion flags for prefiltering log messages.

Enable Enables or disables all logging under the component.