Class CPBContext

Components and Contexts Overview, Working With Components and Contexts


The CPBContext class provides a streamlined set of functions for working with PB_CONTEXT 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 context is set for a thread the API may appear to leak thread handles. See the Troubleshooting appendix for further information.

Class members

CPBContext Initializes and/or sets the context as the default for the thread or module.

~CPBContext Restores the previous default context if the constructor set a new one.

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

SetName Sets the name of the context.

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

Enable Enables or disables all logging under the context.