- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# CRTP_Debug< Derived, RequestType > Class Template Reference

Search for all occurrences

## Detailed Description

### template<typename Derived, typename RequestType>
class adsk::Debug::CRTP_Debug< Derived, RequestType >

This template defines virtual methods for calling the statically defined Debug methods within a hierarchy.

A template was used since the patterns for the Debug calls are all the same.

To add a handler for a Debug message you would first derive the class to debug off of this template, once per message type that will be handled. e.g. for messages "MyRequest" and "YourRequest" the class definition would look like this:

class MyClass : public CRTP_Debug<MyClass, MyRequest> , public CRTP_Debug<MyClass, YourRequest>

Static debug methods are then defined and in the source file they will be implemented using this syntax:

bool MyClass::Debug( const MyClass*, MyRequest& ) { ... } bool MyClass::Debug( const MyClass*, YourRequest& ) { ... }

After, you will need to include adskDebugCRTPImpl.h in the compilation unit when you are defining your class (eg MyClass.cpp), so that the templated code gets instantiated once.

`#include <adskDebugCRTP.h>`

List of all members.

## Public Member Functions
virtual bool | debug (RequestType &request) const
| Gather this object's counting information.

## Member Function Documentation

bool debug | ( | RequestType & | request | ) | const`[virtual]`

Search for all occurrences

Gather this object's counting information.

Parameters:

  [in] | request | Debug object accepting the count request

Returns:
  true if the debugging succeeded