indexing description: "Base class for use cases." author: "Patrick Ruckstuhl " date: "$Date$" revision: "$Revision$" deferred class USE_CASE feature {NONE} -- Initialization make (a_node: like node) is -- Create. require a_node_ok: a_node /= Void and then a_node.peer_module /= Void do node := a_node ensure node_set: node = a_node end feature -- Access node: NODE_CORE -- Node used for communication. config_parser: ORIGO_CONF_PARSER -- Parser for the origo.conf configuration file once create Result.make_default end namespace: STRING is -- Namespace of this use case. deferred ensure result_ok: Result /= Void and then not Result.is_empty end type: STRING is -- Message type of this use case. deferred ensure result_ok: Result /= Void and then not Result.is_empty end feature -- Basic operation start (a_msg: O_MESSAGE) is -- Start the use case by a_msg. require a_msg_ok: a_msg /= Void deferred end feature {NONE} -- Implementation forward_to_node (a_msg: O_MESSAGE; a_node: STRING) is -- Forward a_msg to a_node (and also setup that the reply will be forwarded back to the original sender). require a_msg_ok: a_msg /= Void a_node_valid: a_node /= Void and then not a_node.is_empty local l_fwd: O_GENERIC_MESSAGE do create l_fwd.make (a_msg.namespace, a_msg.type) l_fwd.set_arguments (a_msg.arguments) l_fwd.set_reply_handler (agent node.send_message_reply (?, a_msg)) node.send_message_node (l_fwd, a_node) end invariant node_set: node /= Void end