NAP
Public Member Functions | Protected Attributes | List of all members
AppEventHandler Class Reference

#include <appeventhandler.h>

Public Member Functions

 AppEventHandler (BaseApp &app)
 
virtual ~AppEventHandler ()=default
 
 AppEventHandler (AppEventHandler &)=delete
 
AppEventHandleroperator= (const AppEventHandler &)=delete
 
 AppEventHandler (AppEventHandler &&)=delete
 
AppEventHandleroperator= (AppEventHandler &&)=delete
 
virtual void start ()
 
virtual void process ()
 
virtual void shutdown ()
 
template<typename T >
T & getApp ()
 

Protected Attributes

BaseAppmApp
 

Description

Helper object that allows for custom app processing behavior inside the AppRunner update loop. By default this object does nothing. Override the various methods to add process logic.

Inheritance diagram for AppEventHandler:
[legend]
Collaboration diagram for AppEventHandler:
[legend]

Constructor & Destructor Documentation

◆ AppEventHandler() [1/3]

Constructor

Parameters
appthe app this event handler works with when processing messages

◆ ~AppEventHandler()

virtual ~AppEventHandler ( )
virtualdefault

◆ AppEventHandler() [2/3]

Copy is not allowed

◆ AppEventHandler() [3/3]

Move is not allowed

Member Function Documentation

◆ getApp()

T & getApp

Returns the application as an object of type T

◆ operator=() [1/2]

AppEventHandler& operator= ( AppEventHandler &&  )
delete

◆ operator=() [2/2]

AppEventHandler& operator= ( const AppEventHandler )
delete

◆ process()

virtual void process ( )
virtual

This is called within the main loop of the app runner to specify specific event process behavior. For example, when working with a window you might want to check for window or input messages and forward those to the application This function is invoked at the beginning of the app loop

Reimplemented in GUIAppEventHandler, and SDLAppEventHandler.

◆ shutdown()

virtual void shutdown ( )
virtual

Called before shutting down all services and exiting the app

Reimplemented in GUIAppEventHandler, and SDLAppEventHandler.

◆ start()

virtual void start ( )
virtual

Called before running the app loop but after all services have been initialized Use this call to initialize functionality before starting the process loop

Reimplemented in GUIAppEventHandler, and SDLAppEventHandler.

Member Data Documentation

◆ mApp

BaseApp& mApp
protected