Skip to content
RallyHere Docs
GitHub

Polling

Summary

MembersDescriptions
class URH_PollingSettingsSettings for polling.
struct FRH_PollTimerSettingSettings for polling timers.
struct FRH_PollControlController for the polling.
struct FRH_AutoPollerAuto Poller to poll at a given interval for updates.

class URH_PollingSettings

class URH_PollingSettings
  : public UDeveloperSettings

Settings for polling.

Summary

MembersDescriptions
public TArray< FRH_PollTimerSetting>PollingIntervalsArray of all polling timers.
public float DefaultPollingIntervalDefault polling time.
public float GetPollingInterval(const FName & TimerName) constGets a polling interval by name, or falls back to default if not found.

Members

public TArray< FRH_PollTimerSetting>PollingIntervals

Array of all polling timers.

public float DefaultPollingInterval

Default polling time.

public float GetPollingInterval(const FName & TimerName) const

Gets a polling interval by name, or falls back to default if not found.

Parameters

  • TimerName Name of Timer to get interval for.

struct FRH_PollTimerSetting

Settings for polling timers.

Summary

MembersDescriptions
public FName TimerNameName of the timer.
public float IntervalPoll interval of the timer.
public inline FRH_PollTimerSetting()Default constructor, 60 seconds timer.

Members

public FName TimerName

Name of the timer.

public float Interval

Poll interval of the timer.

public inline FRH_PollTimerSetting()

Default constructor, 60 seconds timer.

struct FRH_PollControl

struct FRH_PollControl
  : public FTickableGameObject

Controller for the polling.

Summary

MembersDescriptions
public FRH_PollControl()Default controller.
public void Register(FRH_AutoPollerPtr Ptr)Register an auto poller with the Poll Controller.
public void Unregister(FRH_AutoPollerPtr Ptr)Unregister an auto poller with the Poll Controller.
public void Unregister(const FRH_AutoPoller * Ptr)Used as a final unregister in the destructor, which cannot use a shared pointer.
public inline FORCEINLINE bool IsRegistered(const TSharedPtr< const FRH_AutoPoller > & Ptr) constGets if a given auto poller is registered.
public inline FORCEINLINE bool IsActive(const TSharedPtr< const FRH_AutoPoller > & Ptr) constGets if a given auto poller is active.
public inline FORCEINLINE bool IsWaiting(const TSharedPtr< const FRH_AutoPoller > & Ptr) constGets if a given auto poller is waiting.
public inline FORCEINLINE bool IsInactive(const TSharedPtr< const FRH_AutoPoller > & Ptr) constGets if a given auto poller is inactive.
public inline FORCEINLINE bool IsExecuting(const TSharedPtr< const FRH_AutoPoller > & Ptr) constGets if a given auto poller is executing.
public void SetPollInactive(FRH_AutoPollerPtr Ptr)Sets an auto poller to inactive.
public void SetPollWaiting(FRH_AutoPollerPtr Ptr)Sets an auto poller to waiting.
public void SetPollExecuting(FRH_AutoPollerPtr Ptr)Sets an auto poller to executing.
public virtual void Tick(float DeltaTime)Scan Waiting list to determine if any need to be kicked off.
public inline virtual bool IsTickable() constPoll controller is always tickable.
public inline virtual TStatId GetStatId() constGets the poll controller stat Id.
protected TArray< FRH_AutoPollerWeakPtr > InactivePollsPolls that are registered but not active.
protected TArray< FRH_AutoPollerWeakPtr > WaitingPollsPolls waiting on their timer to complete, checked each tick.
protected TArray< FRH_AutoPollerWeakPtr > ExecutingPollsPolls with their poll function executing.
protected void SortWaitingPolls()Sorts the waiting pollers for by their next poll time.

Members

public FRH_PollControl()

Default controller.

public void Register(FRH_AutoPollerPtr Ptr)

Register an auto poller with the Poll Controller.

Parameters

  • Ptr Auto poller to register.

public void Unregister(FRH_AutoPollerPtr Ptr)

Unregister an auto poller with the Poll Controller.

Parameters

  • Ptr Auto poller to unregister.

public void Unregister(const FRH_AutoPoller * Ptr)

Used as a final unregister in the destructor, which cannot use a shared pointer.

Parameters

  • Ptr Auto poller to unregister.

public inline FORCEINLINE bool IsRegistered(const TSharedPtr< const FRH_AutoPoller > & Ptr) const

Gets if a given auto poller is registered.

Parameters

  • Ptr Auto poller to check.

public inline FORCEINLINE bool IsActive(const TSharedPtr< const FRH_AutoPoller > & Ptr) const

Gets if a given auto poller is active.

Parameters

  • Ptr Auto poller to check.

public inline FORCEINLINE bool IsWaiting(const TSharedPtr< const FRH_AutoPoller > & Ptr) const

Gets if a given auto poller is waiting.

Parameters

  • Ptr Auto poller to check.

public inline FORCEINLINE bool IsInactive(const TSharedPtr< const FRH_AutoPoller > & Ptr) const

Gets if a given auto poller is inactive.

Parameters

  • Ptr Auto poller to check.

public inline FORCEINLINE bool IsExecuting(const TSharedPtr< const FRH_AutoPoller > & Ptr) const

Gets if a given auto poller is executing.

Parameters

  • Ptr Auto poller to check.

public void SetPollInactive(FRH_AutoPollerPtr Ptr)

Sets an auto poller to inactive.

Parameters

  • Ptr Auto poller to update.

public void SetPollWaiting(FRH_AutoPollerPtr Ptr)

Sets an auto poller to waiting.

Parameters

  • Ptr Auto poller to update.

public void SetPollExecuting(FRH_AutoPollerPtr Ptr)

Sets an auto poller to executing.

Parameters

  • Ptr Auto poller to update.

public virtual void Tick(float DeltaTime)

Scan Waiting list to determine if any need to be kicked off.

public inline virtual bool IsTickable() const

Poll controller is always tickable.

public inline virtual TStatId GetStatId() const

Gets the poll controller stat Id.

protected TArray< FRH_AutoPollerWeakPtr > InactivePolls

Polls that are registered but not active.

protected TArray< FRH_AutoPollerWeakPtr > WaitingPolls

Polls waiting on their timer to complete, checked each tick.

protected TArray< FRH_AutoPollerWeakPtr > ExecutingPolls

Polls with their poll function executing.

protected void SortWaitingPolls()

Sorts the waiting pollers for by their next poll time.

struct FRH_AutoPoller

struct FRH_AutoPoller
  : public TSharedFromThis< FRH_AutoPoller >

Auto Poller to poll at a given interval for updates.

Summary

MembersDescriptions
public friend FRH_PollControl
public FRH_AutoPoller()Exposed for the shared pointer interface, please use CreateAutoPoller for construction.
public virtual ~FRH_AutoPoller()Default descrutor.
public void StartPoll(const FRH_PollFunc & InDelegate,const FName InTimerName,bool bImmediate)Starts a poll, only stores timer name, restart will always query settings for that timer name.
public void StopPoll()Stops the poller.
public void DeferPollTimer()Manually defer the poll timer (ex: out of band update). Safe to call at all times as it does not change state, only increments NextPollTime.
public void ExecutePoll()Executes the poller.
public inline FORCEINLINE bool IsRegistered() constGets if the poller is registered with poll control.
public inline FORCEINLINE bool IsActive() constGets if the poller is active with poll control.
public inline FORCEINLINE bool IsWaiting() constGets if the poller is waiting with poll control.
public inline FORCEINLINE bool IsInactive() constGets if the poller is inactive with poll control.
public inline FORCEINLINE bool IsExecuting() constGets if the poller is executing with poll control.
public inline FORCEINLINE const FDateTime & GetNextPollTime() constGets the next poll time.
public inline FORCEINLINE float GetTimeRemaining()Gets the poll time remaining in seconds. Returns -1.f if the poll is inactive or executing.
protected FDateTime NextPollTimeWhen the next poll should run.
protected FRH_PollFunc PollFuncCall when the poll timer fires.
protected FName TimerNameName of the timer to use for polling.
protected void OnPollFinished(bool bSuccess,bool bResetTimer)Called when a poll finishes.
protected void RestartTimer()
protected void Register()Registers with poll control (does not start timer).
protected void Unregister()Unregisters with poll control.

Members

public friend FRH_PollControl

public FRH_AutoPoller()

Exposed for the shared pointer interface, please use CreateAutoPoller for construction.

public virtual ~FRH_AutoPoller()

Default descrutor.

public void StartPoll(const FRH_PollFunc & InDelegate,const FName InTimerName,bool bImmediate)

Starts a poll, only stores timer name, restart will always query settings for that timer name.

Parameters

  • InDelegate Delegate to call when the poll timer fires.

  • InTimerName Name of Timer to get interval from.

  • bImmediate If the poll should start immediately.

public void StopPoll()

Stops the poller.

public void DeferPollTimer()

Manually defer the poll timer (ex: out of band update). Safe to call at all times as it does not change state, only increments NextPollTime.

public void ExecutePoll()

Executes the poller.

public inline FORCEINLINE bool IsRegistered() const

Gets if the poller is registered with poll control.

public inline FORCEINLINE bool IsActive() const

Gets if the poller is active with poll control.

public inline FORCEINLINE bool IsWaiting() const

Gets if the poller is waiting with poll control.

public inline FORCEINLINE bool IsInactive() const

Gets if the poller is inactive with poll control.

public inline FORCEINLINE bool IsExecuting() const

Gets if the poller is executing with poll control.

public inline FORCEINLINE const FDateTime & GetNextPollTime() const

Gets the next poll time.

public inline FORCEINLINE float GetTimeRemaining()

Gets the poll time remaining in seconds. Returns -1.f if the poll is inactive or executing.

protected FDateTime NextPollTime

When the next poll should run.

protected FRH_PollFunc PollFunc

Call when the poll timer fires.

protected FName TimerName

Name of the timer to use for polling.

protected void OnPollFinished(bool bSuccess,bool bResetTimer)

Called when a poll finishes.

Parameters

  • bSuccess If the poll was successful.

  • bResetTimer If the timer should be reset.

protected void RestartTimer()

protected void Register()

Registers with poll control (does not start timer).

protected void Unregister()

Unregisters with poll control.