CAST II Game Engine

   MAIN       FEATURES       SCREENSHOTS       FORUMS       MANUAL       DOWNLOADS       CONTACTS   
Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Class TMessageSubsystem

Unit

BaseMsg

Declaration

type TMessageSubsystem = class

Description

Asynchronous messages queue implementation

The class provides the possibility to handle asynchronous messages.
Message handlers can generate other asynchronous messages which will be handled during next handling cycle. If you use this class there is no need to call any methods of TMessagePool.

Methods

Overview

Publicprocedure Add(const Msg: TMessage);
Publicprocedure BeginHandle;
Publicprocedure EndHandle;
Publicfunction ExtractMessage(out Msg: TMessage): Boolean;

Description

Publicprocedure Add(const Msg: TMessage);

Add an asynchronous message to the queue

Publicprocedure BeginHandle;

Locks current message queue. Should be called before message handling cycle.
All asynchronous messages generated during handling will be available during next handling cycle.
Calls TMessagePool.BeginHandle so application has no need to call it.

Publicprocedure EndHandle;

Should be called after handling cycle. Calls TMessagePool.EndHandle so application has no need to call it

Publicfunction ExtractMessage(out Msg: TMessage): Boolean;

Extracts a message from the queue if any, places it to Msg and returns True if there was a message in queue. Otherwise returns False and nil in Msg. Should be called only between BeginHandle and EndHandle calls.

Last modified: Jan 6, 2010
Copyright (C) 2006-2010, casteng.com