Abstract resource profiling context sampler. More...
#include <kanzi/core.ui/resource/resource_profiling_context_factory.hpp>
Public Member Functions | |
AbstractSampler (ResourceProfilingContextFactory &factory) | |
The constructor. More... | |
virtual | ~AbstractSampler () |
Destructor. More... | |
ResourceProfilingContextSharedPtr | getContext () |
Gets the resource profiling context created by this sampler. More... | |
Protected Member Functions | |
virtual ResourceProfilingContextSharedPtr | createContextOverride (ResourceProfilingContext::TimeStamp entryTimeStamp)=0 |
Creates a resource profiling context. More... | |
Abstract resource profiling context sampler.
Base class for all context samplers. To create a sampler call the kzResourceProfilingContextSampler() macro inside the scope which may trigger loading or deployment of resources during its execution. If the resource loading or deployment occurs during the execution of the scope, the sampler creates the corresponding context.
|
explicit |
The constructor.
factory | The resource profiling context factory. |
|
virtual |
Destructor.
ResourceProfilingContextSharedPtr kanzi::ResourceProfilingContextFactory::AbstractSampler::getContext | ( | ) |
Gets the resource profiling context created by this sampler.
When this function is called for the first time, it creates the resource profiling context using the createContextOverride() function.
|
protectedpure virtual |
Creates a resource profiling context.
entryTimeStamp | The timestamp evaluated at entry to the scope of the resource profiling context. |
Implemented in kanzi::ResourceProfilingAcquireContext::Sampler, kanzi::GenericResourceProfilingContext::Sampler, kanzi::NamedResourceProfilingContext::Sampler, kanzi::ResourceProfilingDeployContext::Sampler, kanzi::ResourceProfilingLoadContext::Sampler, and kanzi::ResourceProfilingMainLoopContext::Sampler.