Magnum::DebugTools::FrameProfiler::Measurement class

Measurement.

Describes a single measurement passed to FrameProfiler::setup(). See Setting up measurements for introduction and examples.

Constructors, destructors, conversion operators

Measurement(Containers::StringView name, Units units, void(*)(void*) begin, UnsignedLong(*)(void*) end, void* state) explicit
Construct an immediate measurement.
Measurement(Containers::StringView name, Units units, UnsignedInt delay, void(*)(void*, UnsignedInt) begin, void(*)(void*, UnsignedInt) end, UnsignedLong(*)(void*, UnsignedInt, UnsignedInt) query, void* state) explicit
Construct a delayed measurement.

Function documentation

Magnum::DebugTools::FrameProfiler::Measurement::Measurement(Containers::StringView name, Units units, void(*)(void*) begin, UnsignedLong(*)(void*) end, void* state) explicit

Construct an immediate measurement.

Parameters
name Measurement name, used in FrameProfiler::measurementName() and FrameProfiler::statistics()
units Measurement units, used in FrameProfiler::measurementUnits() and FrameProfiler::statistics()
begin Function to call at the beginning of a frame
end Function to call at the end of a frame, returning the measured value
state State pointer passed to both begin and end as a first argument

If name is Containers::StringViewFlag::NullTerminated and Global, no internal copy of the string is made.

Magnum::DebugTools::FrameProfiler::Measurement::Measurement(Containers::StringView name, Units units, UnsignedInt delay, void(*)(void*, UnsignedInt) begin, void(*)(void*, UnsignedInt) end, UnsignedLong(*)(void*, UnsignedInt, UnsignedInt) query, void* state) explicit

Construct a delayed measurement.

Parameters
name Measurement name, used in FrameProfiler::measurementName() and FrameProfiler::statistics()
units Measurement units, used in FrameProfiler::measurementUnits() and FrameProfiler::statistics()
delay How many FrameProfiler::endFrame() calls has to happen before a measured value can be retrieved using query. Has to be at least 1, delay of 1 is equal in behavior to immediate measurements.
begin Function to call at the beginning of a frame. Second argument is a current index that's guaranteed to be less than delay and always different in each consecutive call.
end Function to call at the end of a frame. Second argument is a current index that's guaranteed to be less than delay and always different in each consecutive call.
query Function to call to get the measured value. Called after delay frames. First argument is a previous index that is the same as the current argument passed to a corresponding begin / end function of the measurement to query the value of. Second argument is a current index that corresponds to current frame.
state State pointer passed to both begin and end as a first argument

If name is Containers::StringViewFlag::NullTerminated and Global, no internal copy of the string is made.