Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.widget

Class EM_COMPONENT_EVENT_QUEUE



Creation

Features

Invariants

indexing

description

Event queue to publish events from EM_COMPONENTs.

Use EM_SHARED_COMPONENT_EVENT_QUEUE to access the singleton instance.

date

$Date$

revision

$Revision$

class

EM_COMPONENT_EVENT_QUEUE

create {EM_SHARED_COMPONENT_EVENT_QUEUE}

make

-- Initilalise default values.

feature -- Access

events: DS_LINEAR [TUPLE [EM_EVENT_TYPE [TUPLE []], TUPLE[]]]

-- Event list

ensure
events_not_void: Result /= Void

feature -- Status report

is_flushing: BOOLEAN

-- Is Current flushing events?
-- (If yes then added events are immediatly processed)

feature -- Status setting

disable_flushing

-- Disable flushing.

ensure
flushing_disabled: not is_flushing
enable_flushing

-- Enable flushing.

ensure
flushing_enabled: is_flushing
set_flushing (a_value: BOOLEAN)

-- Set is_flushing to a_value.

ensure
is_flushing_set: is_flushing = a_value

feature -- Element change

add_event (an_event: EM_EVENT_TYPE [TUPLE[]]; an_arguments: TUPLE [])

-- Add an_event to events.

require
an_event_not_void: an_event /= Void
an_arguments_not_void: an_arguments /= Void
ensure
event_added: not is_flushing and then not an_event.is_suspended implies events.count = old events.count + 1

feature -- Removal

wipe_out

-- Clear all events.

feature -- Basic operations

process_events

-- Process all events.

ensure
events_processed: events.is_empty

invariant

events_impl_not_void: events_impl /= Void

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end