Markers
Markers can be used to trigger events. Markers do not have a duration and are often used to inform when something completed or went wrong. For example when you need some resource present in memory but the cache is cold you can add a marker that you need to load the resource from disk. Adding a marker will give you an application-wide indication of something happening that might affect more than just one activity channel. For example something like this:
#include <quApi.hpp>
std::vector< uint8_t > LoadResource( const File& file )
{
std::vector< uint8_t > binaryData( file.GetFileSize() );
if( !file.ReadData( binaryData.data(), binaryData.size() ) )
{
std::string error = file.GetLastReadErrorString();
QU_MARKER( error.c_str() );
}
return binaryData;
}