Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cAppImpl Class Reference

#include <cAppImpl.h>

Inheritance diagram for Gray::cAppImpl:
Gray::cSingletonStatic< cAppImpl > GrayLib::CWinApp

Public Member Functions

 cAppImpl (const FILECHAR_t *pszAppName=nullptr)
 
virtual ~cAppImpl ()
 
virtual cString get_HelpText () const
 
virtual bool ShowHelp ()
 
virtual bool CheckHelpArgs ()
 
virtual BOOL InitInstance ()
 
virtual bool OnTickApp ()
 
virtual int Run ()
 
virtual int ExitInstance ()
 
APP_EXITCODE_t Main (HMODULE hInstance=((HMODULE) nullptr))
 

Static Public Member Functions

static HINSTANCE get_HInstance ()
 
- Static Public Member Functions inherited from Gray::cSingletonStatic< cAppImpl >
static bool isSingleCreated () noexcept
 
static cAppImplget_SingleU () noexcept
 
static cAppImplget_Single ()
 
static TYPE2 *__stdcall get_SingleCast ()
 
static cAppImplI () noexcept
 

Public Attributes

const FILECHAR_tm_pszAppName
 Specifies the name of my application. (display friendly) More...
 
TIMESYSD_t m_nMinTickTime
 Minimum amount of time to spend in the OnTickApp() (mSec). cThreadId::SleepCurrent() if there is extra time. More...
 
cAppStatem_State
 Quick reference to cAppState singleton. More...
 
bool m_bCloseSignal
 Polite request to close the application. checked in Run() and OnTickApp() More...
 

Static Public Attributes

static const char * k_HelpText
 

Additional Inherited Members

- Protected Member Functions inherited from Gray::cSingletonStatic< cAppImpl >
 cSingletonStatic (cAppImpl *pObject) noexcept
 
virtual ~cSingletonStatic () noexcept
 
- Static Protected Attributes inherited from Gray::cSingletonStatic< cAppImpl >
static cAppImplsm_pThe
 pointer to the one and only object of this TYPE. ASSUME automatically init to = nullptr. More...
 

Detailed Description

Entry point for my implemented application. like (CWinApp for MFC) (maybe windowed or console) I am NOT a library/DLL. I am an application implementation. NOT the same as (or to be merged with) cAppState. Basic framework for my application I implement. Assume a static like cAppImpl theApp is defined some place.

Constructor & Destructor Documentation

◆ cAppImpl()

Gray::cAppImpl::cAppImpl ( const FILECHAR_t pszAppName = nullptr)

◆ ~cAppImpl()

Gray::cAppImpl::~cAppImpl ( )
virtual

Member Function Documentation

◆ CheckHelpArgs()

bool Gray::cAppImpl::CheckHelpArgs ( )
virtual

Is the caller requesting help text via the command line? All apps should support "-help" "-?" requests for assistance. Is this arg present on the command line ? like FindCommandArg()

◆ ExitInstance()

int Gray::cAppImpl::ExitInstance ( )
virtual

APPSTATE_RunExit Override this to make the application do something to clean up. This should be called if Run() fails. NOT called if InitInstance fails. Like CWinApp for MFC

Returns
APP_EXITCODE_t return app exit code. APP_EXITCODE_OK

◆ get_HelpText()

cString Gray::cAppImpl::get_HelpText ( ) const
virtual

◆ get_HInstance()

static HINSTANCE Gray::cAppImpl::get_HInstance ( )
inlinestatic

◆ InitInstance()

BOOL Gray::cAppImpl::InitInstance ( )
virtual

APPSTATE_RunInit Override this to make the application do something. Like CWinApp for MFC

Returns
true = OK. false = exit now.

Reimplemented in GrayLib::CWinApp.

◆ Main()

APP_EXITCODE_t Gray::cAppImpl::Main ( HMODULE  hInstance = ((HMODULE)nullptr))

The main application entry point and process loop. Like MFC AfxWinMain() Assume cAppStateMain was used.

Returns
APP_EXITCODE_t

◆ OnTickApp()

bool Gray::cAppImpl::OnTickApp ( )
virtual

Override this to make the application do something. Main loop of main thread.

Returns
false = exit

Reimplemented in GrayLib::CWinApp.

◆ Run()

int Gray::cAppImpl::Run ( )
virtual

APPSTATE_Run Override this to make the application do something. Main loop of main thread. Like CWinApp for MFC

Returns
APP_EXITCODE_t return app exit code. APP_EXITCODE_OK (NOT THREAD_EXITCODE_t?)
Note
In _WIN32, If my parent is a console, the console will return immediately! Not on first message loop like old docs say.

◆ ShowHelp()

bool Gray::cAppImpl::ShowHelp ( )
virtual

Show my help text via console or dialog .

Member Data Documentation

◆ k_HelpText

const char * Gray::cAppImpl::k_HelpText
static
Initial value:
= " -help, -? = Get a general description of this program." STR_NL
" -debugger = Wait to engage the debugger." STR_NL
#define STR_NL
NL/LF for Linux format text files. (10) Use "#define" so we can concatenate strings at compile time.
Definition: StrT.h:78

◆ m_bCloseSignal

bool Gray::cAppImpl::m_bCloseSignal

Polite request to close the application. checked in Run() and OnTickApp()

◆ m_nMinTickTime

TIMESYSD_t Gray::cAppImpl::m_nMinTickTime

Minimum amount of time to spend in the OnTickApp() (mSec). cThreadId::SleepCurrent() if there is extra time.

◆ m_pszAppName

const FILECHAR_t* Gray::cAppImpl::m_pszAppName

Specifies the name of my application. (display friendly)

◆ m_State

cAppState& Gray::cAppImpl::m_State

Quick reference to cAppState singleton.


The documentation for this class was generated from the following files: