Kernel (Heart) of the nrEngine

Data Structures

class  nrEngine::ITask
 Each component of the engine/application does run as tasks in the Kernel. More...
class  nrEngine::EmptyTask
 Empty task does not affect anything. It can helps to group tasks by making htem depends on this task. More...
class  nrEngine::IThread
 Abstract class to run a ITask in a thread controlled by Kernel. More...
class  nrEngine::Kernel
 Heart of our engine system, where tasks are running. More...


typedef uint32 nrEngine::TaskId


enum  nrEngine::TaskState {
  nrEngine::TASK_STOPPED = 0,
  nrEngine::TASK_RUNNING = 1,
  nrEngine::TASK_PAUSED = 2
enum  nrEngine::TaskProperty {
  nrEngine::TASK_NONE = 0,
  nrEngine::TASK_IS_THREAD = 1 << 1,
  nrEngine::TASK_RUN_ONCE = 1 << 2
enum  nrEngine::TaskType {
enum  nrEngine::TaskOrder {
  nrEngine::ORDER_STEP = 32768,
  nrEngine::ORDER_SYS_ROOT = 0,
  nrEngine::ORDER_SYS_LAST = 6 * ORDER_STEP,
  nrEngine::ORDER_FIRST = 7 * ORDER_STEP,
  nrEngine::ORDER_HIGH = 10 * ORDER_STEP,
  nrEngine::ORDER_NORMAL = 11 * ORDER_STEP,
  nrEngine::ORDER_LOW = 12 * ORDER_STEP,
  nrEngine::ORDER_VERY_LOW = 13 * ORDER_STEP,
  nrEngine::ORDER_ULTRA_LOW = 14 * ORDER_STEP,
  nrEngine::ORDER_LAST = 15 * ORDER_STEP

Detailed Description

As you know each operating system has got a kernel. This kernel run tasks (user programms) to allow to do a lot of things. So our engine is nothing else as a little operating system. Here we implement kernel of the engine. This kernel runs tasks in there priority order, so you can run for example display task as last task and input as first. Kernel has also support to freeze tasks (suspend) and resume them from sleeping. To run application written for nrEngine it is better if you use this system. Actually kernel is nothing else than the old style game loop. Kernel runs tasks in a one big loop until there is no more tasks.

Typedef Documentation

typedef uint32 nrEngine::TaskId

Each task is defined through it's unique ID-number. The numbers are used to access task through the kernel.
There is no tasks with ID 0, because this number is reserved as for no id.

Definition at line 32 of file ITask.h.

Enumeration Type Documentation

enum nrEngine::TaskOrder

Each task is in the kernel in specified order. This enum describes all order/queue positions of any task in the kernel system

ORDER_STEP  This number defines the a gap between two adjacent order numbers.
ORDER_SYS_ROOT  This is a order position reserved for system tasks, that should realy run as first. You can not add any user task on this order position.
ORDER_SYS_FIRST  First task.
ORDER_SYS_SECOND  Next after first.
ORDER_SYS_THIRD  Next after first.
ORDER_SYS_FOURTH  Next after first.
ORDER_SYS_FIVETH  Next after first.
ORDER_SYS_LAST  Greatest order border for system task (only ordering).
ORDER_FIRST  Task will be updated as first.
ORDER_ULTRA_HIGH  Next after the first.
ORDER_VERY_HIGH  Next smaller order number to the ultra high value.
ORDER_HIGH  Next after very high.
ORDER_NORMAL  Default order number (Center point).
ORDER_LOW  Later update as of the normal position.
ORDER_VERY_LOW  Updating next after low.
ORDER_ULTRA_LOW  Ultra low order by comparison to the normal value.
ORDER_LAST  Task having this order will be updated as last.

Definition at line 89 of file ITask.h.

enum nrEngine::TaskProperty

Task can have on of the property defined.

TASK_NONE  Nothing specialy.
TASK_IS_THREAD  Does this task run in parallel, so it is a thread.
TASK_RUN_ONCE  Should this task be executed only once or it is repeating.

Definition at line 55 of file ITask.h.

enum nrEngine::TaskState

Each task can be in one of this states. It can be either stopped, running or paused (sleeping)

TASK_STOPPED  Task is currently stopped. So it was either started nor paused.
TASK_RUNNING  Task is currently running, so updates of the task are done.
TASK_PAUSED  Task is sleeping. No updates but waiting on resume signal.

Definition at line 39 of file ITask.h.

enum nrEngine::TaskType

Engine does support two types of task: system task and user tasks. System tasks are task essential for engine working. They can not be handled by the user application. User tasks are task handled by the application itself.

TASK_SYSTEM  Root tasks could not be stopped by user, only engine can do this.
TASK_USER  User tasks are task defined by the user.

Definition at line 74 of file ITask.h.

Generated on Wed Sep 12 23:19:43 2007 for nrEngine by  doxygen 1.5.1