Navigation
API > API/Runtime > API/Runtime/Core
Thread-safe ticker class. Fires delegates after a delay.
| Name | FTSTicker |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Containers/Ticker.h |
| Include Path | #include "Containers/Ticker.h" |
Syntax
class FTSTicker
Derived Classes
Structs
| Name | Remarks |
|---|---|
| FElement | Internal structure to store a ticker delegate and related data |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FDelegateHandle | TWeakPtr< FElement > | Containers/Ticker.h | |
| FElementPtr | TSharedPtr< FElement > | Containers/Ticker.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AddedElements | TMpscQueue< FElementPtr > | All added delegates are initially stored in a separate thread-safe queue and then in the next Tick are moved to the main not thread-safe container | Containers/Ticker.h | |
| CurrentTime | std::atomic< double > | Current time of the ticker | Containers/Ticker.h | |
| Elements | TArray< FElementPtr > | Future delegates to fire | Containers/Ticker.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FDelegateHandle AddTicker
(
const FTickerDelegate& InDelegate, |
Add a new ticker with a given delay / interval | Containers/Ticker.h | |
FDelegateHandle AddTicker
(
const TCHAR* InName, |
Add a new ticker with a given delay / interval.Can be called concurrently. | Containers/Ticker.h | |
void Reset() |
Resets the instance to its default state. Must be called from the ticking thread. | Containers/Ticker.h | |
void Tick
(
float DeltaTime |
Fire all tickers who have passed their delay and reschedule the ones that return true | Containers/Ticker.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FTSTicker & GetCoreTicker () |
Singleton used for the ticker in Core / Launch. | Containers/Ticker.h | |
static void RemoveTicker
(
FDelegateHandle Handle |
Removes a previously added ticker delegate. | Containers/Ticker.h |