Navigation
API > API/Plugins > API/Plugins/AudioInsights > API/Plugins/AudioInsights/FAudioInsightsCacheManager
Description
Find the closest message to a timestamp in the cache for a specific message type and where predicate returns true. Will look backwards from the chosen timestamp until a message is found
| Name | FindClosestMessageByPredicate |
| Type | function |
| Header File | /Engine/Plugins/AudioInsights/Source/AudioInsights/Public/Cache/AudioInsightsCacheManager.h |
| Include Path | #include "Cache/AudioInsightsCacheManager.h" |
template<TIsCacheableMessage T, typename Predicate>
const T * FindClosestMessageByPredicate
(
const FName & MessageID,
const double Timestamp,
Predicate Pred,
const double BackOutTimestamp
) const
Parameters
| Name | Remarks |
|---|---|
| Predicate | A callable that returns a BooleanTestable value. E.g. const T& InMessage{ return InMessage.GetID() == 10; } |
| BackOutTimestamp | When iterating backwards, if a chunk is detected with an end timestamp less than the backout timestamp, the search is canceled and this returns nullptr |