CRTP_Debug< Derived, RequestType > Class Template Reference

CRTP_Debug< Derived, RequestType > Class Template Reference

#include <adskDebugCRTP.h>

Class 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.

Public Member Functions

virtual bool debug (RequestType &request) const
 Gather this object's counting information. More...
 

Member Function Documentation

bool debug ( RequestType &  request) const
virtual

Gather this object's counting information.

Parameters
[in]requestDebug object accepting the count request
Returns
true if the debugging succeeded

The documentation for this class was generated from the following files:
  • adskDebugCRTP.h
  • adskDebugCRTPImpl.h