|
Harlinn.Windows 0.1
|
#include <HWDXApplication.h>
Public Types | |
| using | Base = Windows::Application |
Public Types inherited from Harlinn::Common::Core::Application | |
| using | Base = Concurrency::ActiveObject<std::shared_ptr<ApplicationMessage>> |
Public Types inherited from Harlinn::Common::Core::Concurrency::ActiveObject< std::shared_ptr< ApplicationMessage > > | |
| using | Base |
| using | ESFT |
Public Types inherited from Harlinn::Common::Core::Concurrency::ActiveObjectBase< std::shared_ptr< ApplicationMessage >, maxQueueSize > | |
| using | MessageType |
| using | ConcurrentQueue |
| using | Event |
Public Member Functions | |
| HW_EXPORT | DXApplication (const std::shared_ptr< Windows::ApplicationOptions > &options, std::unique_ptr< DXContext > dxContext=std::make_unique< DXContext >()) |
| HW_EXPORT | DXApplication (std::unique_ptr< DXContext > dxContext=std::make_unique< DXContext >()) |
| virtual HW_EXPORT | ~DXApplication () |
| DXContext * | Context () const |
| virtual HW_EXPORT WideString | GetAssetsDirectory () |
| virtual HW_EXPORT WideString | GetAssetPath (const WideString &assetName, bool checkExist=true) |
| virtual HW_EXPORT int | Run (Form &mainForm) override |
| virtual HW_EXPORT int | Run (Form &mainForm, MessageLoop &messageLoop) override |
| virtual HW_EXPORT int | Run (Form &mainForm, DXMessageLoop &messageLoop) |
Public Member Functions inherited from Harlinn::Common::Core::Application | |
| HCC_EXPORT | Application (const std::shared_ptr< ApplicationOptions > &options) |
| HCC_EXPORT | Application () |
| HCC_EXPORT | ~Application () |
| Application (const Application &other)=delete | |
| Application (Application &&other)=delete | |
| Application & | operator= (const Application &other)=delete |
| Application & | operator= (Application &&other)=delete |
| const std::shared_ptr< ApplicationOptions > & | Options () const |
| HCC_EXPORT WideString | ExecutableFilename () |
| HCC_EXPORT WideString | ExecutableDirectory () |
| HCC_EXPORT void | PostThreadAttachedMessage () |
| HCC_EXPORT void | PostThreadDetachedMessage () |
Public Member Functions inherited from Harlinn::Common::Core::Concurrency::ActiveObject< std::shared_ptr< ApplicationMessage > > | |
| ActiveObject (const WideString &threadName) | |
| Constructs a new instance of an ActiveObject object. | |
| virtual | ~ActiveObject ()=default |
| virtual bool | Start (const TimeSpan &timeout) override |
| Starts the message processing thread. | |
| bool | Start () |
| Starts the message processing thread. | |
| virtual bool | Stop (const TimeSpan &timeout) override |
| Stops the message processing thread by posting the stop message, closing the message queue, and waiting for the thread to exit. | |
| bool | Stop () |
| Stops the message processing thread by posting the stop message, closing the message queue, and waiting for the thread to exit. | |
Public Member Functions inherited from Harlinn::Common::Core::Concurrency::ActiveObjectBase< std::shared_ptr< ApplicationMessage >, maxQueueSize > | |
| ActiveObjectBase (const WideString &threadName) | |
| Constructs a new active object. | |
| const WideString & | ThreadName () const noexcept |
| bool | Started () const noexcept |
| Determine whether the active object has started the message processing thread. | |
| bool | Stopped () const noexcept |
| Determine whether the active object has exited the message processing thread. | |
| size_t | MessagesPosted () const |
| Retrieves the number of messages posted to the active object. | |
| size_t | MessagesProcessed () const |
| Retrieves the number of messages processed by the message processing loop. | |
| virtual bool | PostMessage (const MessageType &message) |
| Posts a message to the active object. | |
| virtual bool | PostMessage (MessageType &&message) |
| Posts a message, by moving it, to the active object. | |
Static Public Member Functions | |
| static DXApplication & | Instance () |
Static Public Member Functions inherited from Harlinn::Common::Core::Application | |
| static HCC_EXPORT Application & | Instance () |
| static HCC_EXPORT UInt64 | MainThreadId () noexcept |
| static HCC_EXPORT void | HandleDllMainEvent (HMODULE moduleHandle, DWORD reason, LPVOID freeLibrary) noexcept |
Public Attributes | |
| boost::signals2::signal< void(DXApplication *sender)> | OnInit |
| boost::signals2::signal< void(DXApplication *sender)> | OnExit |
Public Attributes inherited from Harlinn::Common::Core::Application | |
| boost::signals2::signal< void(UInt32 attachedThreadId)> | OnThreadAttached |
| boost::signals2::signal< void(UInt32 detachedThreadId)> | OnThreadDetached |
Public Attributes inherited from Harlinn::Common::Core::Concurrency::ActiveObjectBase< std::shared_ptr< ApplicationMessage >, maxQueueSize > | |
| Event< void(ActiveObjectBase *, const ActiveObjectMessageEventArgs< MessageType > &)> | OnProcessMessage |
| Register callbacks with this signal to process messages passed to the active object. | |
| Event< void(ActiveObjectBase *, const ActiveObjectExceptionEventArgs &)> | OnException |
| Register callbacks with this signal to process exceptions caught in the message event loop of the active object. | |
Protected Member Functions | |
| virtual HW_EXPORT void | DoOnInit () |
| virtual HW_EXPORT void | DoOnExit (bool dontThrow=false) |
Protected Member Functions inherited from Harlinn::Common::Core::Application | |
| virtual HCC_EXPORT void | ProcessMessage (const MessageType &message) override |
| virtual bool | IsStopMessage (const MessageType &message) const noexcept override |
| IsStopMessage must be implemented by derived classes to determine if a message is a stop message causing the event loop to be terminated. | |
| virtual void | PostStopMessage () override |
| PostStopMessage must be implemented by derived classes. The implementation must post a message the will cause IsStopMessage to return true. | |
| virtual HCC_EXPORT void | BeforeProcessMessages () override |
| virtual HCC_EXPORT void | ProcessThreadAttachedMessage (const std::shared_ptr< ApplicationThreadAttachedMessage > &message) |
| virtual HCC_EXPORT void | ProcessThreadDetachedMessage (const std::shared_ptr< ApplicationThreadDetachedMessage > &message) |
Protected Member Functions inherited from Harlinn::Common::Core::Concurrency::ActiveObjectBase< std::shared_ptr< ApplicationMessage >, maxQueueSize > | |
| void | ProcessMessages () |
| This function implements the message processing loop. | |
| virtual void | AfterProcessMessages () |
| Provides an opportunity to implement any cleanup that needs to be performed in the context of the worker thread of the active object after the message loop exits. | |
| virtual void | Run (EventWaitHandle &manualEventWaitHandle) |
| Run must be called by the thread that will be used to process messages for the active object. | |
| virtual void | HandleException (const std::exception &error, const WideString &message) |
| Called when exceptions are caught in the message processing loop. | |
Private Attributes | |
| std::unique_ptr< DXContext > | dxContext_ |
| DXMessageLoop * | messageLoop_ = nullptr |
Additional Inherited Members | |
Static Public Attributes inherited from Harlinn::Common::Core::Concurrency::ActiveObject< std::shared_ptr< ApplicationMessage > > | |
| static constexpr Int64 | DefaultStartStopTimeoutInTicks |
| Harlinn::Windows::DXApplication::DXApplication | ( | const std::shared_ptr< Windows::ApplicationOptions > & | options, |
| std::unique_ptr< DXContext > | dxContext = std::make_unique<DXContext>() ) |
| Harlinn::Windows::DXApplication::DXApplication | ( | std::unique_ptr< DXContext > | dxContext = std::make_unique<DXContext>( ) | ) |
|
virtual |
|
inline |
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
|
virtual |
|
inlinestatic |
|
overridevirtual |
Reimplemented in Harlinn::Windows::ImGui::Application.
|
virtual |
Reimplemented in Harlinn::Windows::ImGui::Application.
|
overridevirtual |
Reimplemented in Harlinn::Windows::ImGui::Application.
|
private |
|
private |
| boost::signals2::signal<void( DXApplication* sender )> Harlinn::Windows::DXApplication::OnExit |
| boost::signals2::signal<void( DXApplication* sender )> Harlinn::Windows::DXApplication::OnInit |