5#include <Foundation/Basics.h>
7#include <Foundation/Application/Implementation/ApplicationEntryPoint.h>
8#include <Foundation/Utilities/CommandLineUtils.h>
10#include <Foundation/Profiling/Profiling.h>
94 virtual plResult BeforeCoreSystemsStartup();
150 inline void SetReturnCode(plInt32 iReturnCode) { m_iReturnCode = iReturnCode; }
160 void SetCommandLineArguments(plUInt32 uiArgumentCount,
const char** pArguments);
171 const char* GetArgument(plUInt32 uiArgument)
const;
176 void EnableMemoryLeakReporting(
bool bEnable) { m_bReportMemoryLeaks = bEnable; }
178 bool IsMemoryLeakReportingEnabled()
const {
return m_bReportMemoryLeaks; }
186 virtual void RequestQuit();
192 bool m_bWasQuitRequested =
false;
195 plInt32 m_iReturnCode = 0;
197 plUInt32 m_uiArgumentCount = 0;
199 const char** m_pArguments =
nullptr;
201 bool m_bReportMemoryLeaks =
true;
207 friend PL_FOUNDATION_DLL_FRIEND
void plRun(
plApplication* pApplicationInstance);
209 friend PL_FOUNDATION_DLL_FRIEND
void plRun_MainLoop(
plApplication* pApplicationInstance);
210 friend PL_FOUNDATION_DLL_FRIEND
void plRun_Shutdown(
plApplication* pApplicationInstance);
Base class to be used by applications based on plEngine.
Definition Application.h:66
Execution
Defines the possible return values for the plApplication::Run() function.
Definition Application.h:72
friend PL_FOUNDATION_DLL_FRIEND void plRun(plApplication *pApplicationInstance)
Platform independent run function for main loop based systems (e.g. Win32, ..)
Definition MainLoop.cpp:90
virtual void AfterHighLevelSystemsShutdown()
Called after plStartup::ShutdownHighLevelSystems() has been executed.
Definition Application.h:113
virtual void BeforeCoreSystemsShutdown()
This function is called after the application main loop has run for the last time,...
Definition Application.h:120
virtual void BeforeEnterForeground()
This function is called whenever an application is resumed from background mode.
Definition Application.h:140
const plString & GetApplicationName() const
Returns the application name.
Definition Application.h:87
plInt32 GetReturnCode() const
Returns the currently set value that the application will return to the OS.
Definition Application.h:153
virtual void BeforeEnterBackground()
This function is called when an application is moved to the background.
Definition Application.h:133
friend PL_FOUNDATION_DLL_FRIEND void plRun_Shutdown(plApplication *pApplicationInstance)
[internal] Called by plRun()
Definition MainLoop.cpp:56
virtual ~plApplication()
Virtual destructor.
friend PL_FOUNDATION_DLL_FRIEND plResult plRun_Startup(plApplication *pApplicationInstance)
[internal] Called by plRun()
Definition MainLoop.cpp:12
virtual void AfterCoreSystemsStartup()
This function is called after basic engine initialization has been done.
Definition Application.h:101
friend PL_FOUNDATION_DLL_FRIEND void plRun_MainLoop(plApplication *pApplicationInstance)
[internal] Called by plRun()
Definition MainLoop.cpp:48
void SetReturnCode(plInt32 iReturnCode)
Sets the value that the application will return to the OS. You can call this function at any point du...
Definition Application.h:150
const char ** GetArgumentsArray() const
Returns the complete array of command line arguments that were passed to the application.
Definition Application.h:174
PL_ALWAYS_INLINE bool WasQuitRequested() const
Returns whether RequestQuit() was called.
Definition Application.h:189
virtual const char * TranslateReturnCode() const
If the return code is not zero, this function might be called to get a string to print the error code...
Definition Application.h:156
plUInt32 GetArgumentCount() const
Returns the number of command line arguments that were passed to the application.
Definition Application.h:168
virtual Execution Run()=0
Main run function which is called periodically. This function must be overridden.
static plApplication * GetApplicationInstance()
Returns the one instance of plApplication that is available.
Definition Application.h:163
virtual void BeforeHighLevelSystemsShutdown()
This function is called after the application main loop has run for the last time,...
Definition Application.h:110
virtual void AfterCoreSystemsShutdown()
This function is called after plStartup::ShutdownCoreSystems() has been called.
Definition Application.h:125
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54