OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
PlatformApplication Class Reference

#include <PlatformApplication.h>

Public Member Functions

 PlatformApplication (Platform *platform)
 
 ~PlatformApplication ()
 
void initializeOpenGLContext (const PlatformOpenGLOptions &options)
 
void initializeOpenGLContext (std::unique_ptr< PlatformOpenGLContext > context)
 
Platformplatform ()
 
PlatformEventLoopeventLoop ()
 
PlatformWindowwindow ()
 
PlatformOpenGLContextopenGLContext ()
 
PlatformEventHandlereventHandler ()
 
template<class T >
T * installComponent (std::unique_ptr< T > component)
 
template<class T >
std::unique_ptr< T > removeComponent ()
 
const PlatformComponentStoragecomponents () const
 
template<class T >
T * component () const
 
void processMessages (int count=-1)
 
void waitForMessages ()
 

Private Member Functions

void installComponentInternal (ProxyPlatform *platform)
 
void removeComponentInternal (ProxyPlatform *platform)
 
void installComponentInternal (ProxyEventLoop *eventLoop)
 
void removeComponentInternal (ProxyEventLoop *eventLoop)
 
void installComponentInternal (ProxyWindow *window)
 
void removeComponentInternal (ProxyWindow *window)
 
void installComponentInternal (ProxyOpenGLContext *openGLContext)
 
void removeComponentInternal (ProxyOpenGLContext *openGLContext)
 
void installComponentInternal (PlatformEventFilter *eventFilter)
 
void removeComponentInternal (PlatformEventFilter *eventFilter)
 
void installComponentInternal (PlatformApplicationAware *aware)
 
void removeComponentInternal (PlatformApplicationAware *aware)
 

Private Attributes

Platform_platform
 
std::unique_ptr< PlatformEventLoop_eventLoop
 
std::unique_ptr< PlatformWindow_window
 
std::unique_ptr< PlatformOpenGLContext_openGLContext
 
std::unique_ptr< FilteringEventHandler_eventHandler
 
std::unique_ptr< ApplicationProxy_rootProxy
 
PlatformComponentStorage _components
 

Friends

class PlatformApplicationAware
 

Detailed Description

This class ties together everything in platform for a particular use case of an application with a single window.

The proper way to use it is by creating components that implement the pieces of functionality that you need, and then installing them into the PlatformApplication.

Supported base classes for components are:

Components can have multiple bases, this is handled automatically. If you want to use private bases, befriend PlatformIntrospection.

The components you install are inserted into the proxy and event filter chains exactly in the order of installation. The ordering is usually important, so it makes sense to install everything in a single place. If this model doesn't work for you (e.g. you have two components that implement several proxies that need to be ordered differently w.r.t. each other), then you'll have to split your component into several parts.

Constructor & Destructor Documentation

◆ PlatformApplication()

PlatformApplication::PlatformApplication ( Platform platform)
explicit

◆ ~PlatformApplication()

PlatformApplication::~PlatformApplication ( )

Member Function Documentation

◆ component()

template<class T >
T * PlatformApplication::component ( ) const
inline

◆ components()

const PlatformComponentStorage * PlatformApplication::components ( ) const
inline

◆ eventHandler()

PlatformEventHandler * PlatformApplication::eventHandler ( )

◆ eventLoop()

PlatformEventLoop * PlatformApplication::eventLoop ( )

◆ initializeOpenGLContext() [1/2]

void PlatformApplication::initializeOpenGLContext ( const PlatformOpenGLOptions options)

◆ initializeOpenGLContext() [2/2]

void PlatformApplication::initializeOpenGLContext ( std::unique_ptr< PlatformOpenGLContext context)

◆ installComponent()

template<class T >
T * PlatformApplication::installComponent ( std::unique_ptr< T >  component)
inline

◆ installComponentInternal() [1/6]

void PlatformApplication::installComponentInternal ( PlatformApplicationAware aware)
private

◆ installComponentInternal() [2/6]

void PlatformApplication::installComponentInternal ( PlatformEventFilter eventFilter)
private

◆ installComponentInternal() [3/6]

void PlatformApplication::installComponentInternal ( ProxyEventLoop eventLoop)
private

◆ installComponentInternal() [4/6]

void PlatformApplication::installComponentInternal ( ProxyOpenGLContext openGLContext)
private

◆ installComponentInternal() [5/6]

void PlatformApplication::installComponentInternal ( ProxyPlatform platform)
private

◆ installComponentInternal() [6/6]

void PlatformApplication::installComponentInternal ( ProxyWindow window)
private

◆ openGLContext()

PlatformOpenGLContext * PlatformApplication::openGLContext ( )

◆ platform()

Platform * PlatformApplication::platform ( )

◆ processMessages()

void PlatformApplication::processMessages ( int  count = -1)

◆ removeComponent()

template<class T >
std::unique_ptr< T > PlatformApplication::removeComponent ( )
inline

◆ removeComponentInternal() [1/6]

void PlatformApplication::removeComponentInternal ( PlatformApplicationAware aware)
private

◆ removeComponentInternal() [2/6]

void PlatformApplication::removeComponentInternal ( PlatformEventFilter eventFilter)
private

◆ removeComponentInternal() [3/6]

void PlatformApplication::removeComponentInternal ( ProxyEventLoop eventLoop)
private

◆ removeComponentInternal() [4/6]

void PlatformApplication::removeComponentInternal ( ProxyOpenGLContext openGLContext)
private

◆ removeComponentInternal() [5/6]

void PlatformApplication::removeComponentInternal ( ProxyPlatform platform)
private

◆ removeComponentInternal() [6/6]

void PlatformApplication::removeComponentInternal ( ProxyWindow window)
private

◆ waitForMessages()

void PlatformApplication::waitForMessages ( )

◆ window()

PlatformWindow * PlatformApplication::window ( )

Friends And Related Function Documentation

◆ PlatformApplicationAware

friend class PlatformApplicationAware
friend

Member Data Documentation

◆ _components

PlatformComponentStorage PlatformApplication::_components
private

◆ _eventHandler

std::unique_ptr<FilteringEventHandler> PlatformApplication::_eventHandler
private

◆ _eventLoop

std::unique_ptr<PlatformEventLoop> PlatformApplication::_eventLoop
private

◆ _openGLContext

std::unique_ptr<PlatformOpenGLContext> PlatformApplication::_openGLContext
private

◆ _platform

Platform* PlatformApplication::_platform
private

◆ _rootProxy

std::unique_ptr<ApplicationProxy> PlatformApplication::_rootProxy
private

◆ _window

std::unique_ptr<PlatformWindow> PlatformApplication::_window
private

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