note
	description: "Summary description for {ABSTRACT_EVENT}."
	author: ""
	date: "$Date$"
	revision: "$Revision$"

deferred class
	ABSTRACT_EVENT
inherit
	THREAD
	STORABLE

feature {NONE} -- creation	
	make (a_state: like state; a_name: like name; a_guard: like guard; a_action: like action)
		do
			state := a_state
			name := a_name
			guard := a_guard
			action := a_action
		end
feature -- event attributes
	mutex: MUTEX
			-- global mutex to access state
		once Result := state.mutex end

	state: ABSTRACT_STATE

	name: STRING

	guard: FUNCTION [ANY, TUPLE, BOOLEAN]

	action: PROCEDURE [ANY, TUPLE]


feature -- guard/activate
	guard_holds: BOOLEAN
		do
			Result := guard.item ([])
		end

	act
		do
			action.call ([])
		end

end
