indexing
	cluster: "demangler"
	namespace: "candidate"
	pattern: "Command"
	description: "A fix for a single error in a `synchronised_directory'."
	original_author: "Justin Finnerty"
	original_date: "July 2005"
	current_date: "$Date: 2005/09/27 07:20:33 $"
	current_author: "$Author: finnerty $"
	revision: "$Revision: 2.2 $"
   -- $Log: delayed_command.ge,v $
   -- Revision 2.2  2005/09/27 07:20:33  finnerty
   -- Updated to use GOBO and work with SE and VE
   --
   -- Revision 2.1  2005/09/03 11:09:43  finnerty
   -- Renamed *.e to *.ge for gepp
   --
   -- Revision 2.0  2005/09/02 07:30:39  finnerty
   -- Renamed FUNCTOR to DELAYED_COMMAND
   --

class DELAYED_COMMAND [T_ARG1]
	-- This class provides a generic class for command objects
	-- that can be called with one argument.

	-- Programming note: This class should only be used when the
	-- compiler has agents implemented. When agents are not present an
	-- object of a class derived directly from COMMAND_ONE_ARG should
	-- be used.
inherit
	DP_COMMAND

creation {ANY}
	make
	
feature {ANY}
	-- Access
#ifdef HAS_AGENT
	routine: ROUTINE [ANY,TUPLE[T_ARG1]]
#else
   routine: COMMAND_ONE_ARG [T_ARG1]
#endif

	argument_1: T_ARG1

feature {ANY}
	-- Procedures
	execute is
			-- Execute the command.
		do
#ifdef HAS_AGENT
         routine.call([argument_1])
#else
         routine.execute
#endif
		end

feature {NONE}
	-- Creation
#ifdef HAS_AGENT
	make (a_proc: ROUTINE [ANY,TUPLE [T_ARG1]]; a_arg1: T_ARG1) is
#else
	make (a_proc: COMMAND_ONE_ARG [T_ARG1]; a_arg1: T_ARG1) is
#endif
		require
			a_arg1 /= Void
			a_proc /= Void
		do
			argument_1 := a_arg1
			routine := a_proc
		end
invariant
	argument_1 /= Void
	routine /= Void
end -- class DELAYED_COMMAND
