Honeycomb  0.1
Component-Model Framework
App.h
Go to the documentation of this file.
1 // Honeycomb, Copyright (C) 2015 NewGamePlus Inc. Distributed under the Boost Software License v1.0.
2 #pragma once
3 
4 #include "Honey/Thread/Thread.h"
6 
7 namespace honey
8 {
9 
11 class App : mt::NoCopy
12 {
13 public:
14  enum class RunMode
15  {
16  term,
17  run
18  };
19 
22 
23  App();
24  ~App();
25 
27  virtual void entry() final;
28 
30  void interrupt(const Exception::ConstPtr& e);
31 
32  RunMode runMode() const { return _runMode; }
33 
36 
37 protected:
39  virtual void run();
40 
44 };
45 
46 }
RunMode
Definition: App.h:14
void interrupt(const Exception::ConstPtr &e)
Request an interrupt in the app's thread.
Definition: App.cpp:32
Thread class.
Definition: Thread.h:128
Atomic< RunMode > _runMode
Definition: App.h:43
Inherit to declare that class is not copyable.
Definition: Meta.h:286
int _interruptFreq
Number of times per second to interrupt modules.
Definition: App.h:35
virtual void entry() final
Application entry point, call from main()
Definition: App.cpp:16
Mutex _lock
Definition: App.h:42
RunMode runMode() const
Definition: App.h:32
#define EXCEPTION(Class)
Declares methods required for every subclass of honey::Exception.
Definition: Exception.h:17
Top-level application flow controller, provides entry point and run loop.
Definition: App.h:11
Base exception class. Exceptions inherited from this class provide debug info and can be thrown polym...
Definition: Exception.h:45
Process terminated. Use this interrupt to exit the run loop.
Definition: App.h:21
App()
Definition: App.cpp:9
~App()
Definition: App.cpp:14
virtual void run()
Module run loop.
Definition: App.cpp:39
A thread lock where the lock is acquired by suspending thread execution until it becomes available...
Definition: Mutex.h:17
Global Honeycomb namespace.
Thread * _thread
Definition: App.h:41