template<typename DerivedType, typename... BasePack>
class Cori::Profiling::Trackable< DerivedType, BasePack >
For InstanceMetrics to work with a type it should derive from this.
- Template Parameters
-
| DerivedType | Class type you're deriving Trackable for. Example: class Example : public Trackable<Example> |
| BasePack | Optional parameter, the types for whom DerivedType will be considered a derived class when using InstanceMetrics. Can be several types. |
Some examples:
I have a class called OpenGLTexture2D, and it is defined something like this:
|–|class OpenGLTexture2D final : public Texture2D, public Profiling::Trackable<OpenGLTexture2D, Texture2D, Texture>
This way it will be considered derived for Texture2D and Texture in InstanceMetrics.
And calling:
|–|ProfilingInstanceMetrics<Graphics::Texture>::Report();
Will report you data about OpenGLTexture2D, and also calling:
|–|ProfilingInstanceMetrics<Graphics::Texture2D>::Report();
Will report you data about OpenGLTexture2D.
Also when defining a class like this:
|–|class SpriteAtlas : public Profiling::Trackable<SpriteAtlas>
Calling:
|–|ProfilingInstanceMetrics<Graphics::SpriteAtlas>::Report();
Will report the data about SpriteAtlas instances.
Definition at line 29 of file Trackable.hpp.