note description: "Base class for use cases." author: "Patrick Ruckstuhl " date: "$Date$" revision: "$Revision$" deferred class A_USE_CASE feature {NONE} -- Initialization make (a_node: like node) -- Create. require a_node_ok: a_node /= Void do node := a_node ensure node_set: node = a_node end feature -- Access node: A_NODE_CORE -- Node used for communication. config_parser: A_CONF_PARSER -- Parser for the aranea.conf configuration file do Result := node.config_parser end namespace: STRING -- Namespace of this use case. deferred ensure result_ok: Result /= Void and then not Result.is_empty end type: STRING -- 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: A_MESSAGE) -- Start the use case by a_msg. require a_msg_ok: a_msg /= Void deferred end feature {NONE} -- Implementation forward_to_node (a_msg: A_MESSAGE; a_node: STRING) -- 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 do a_msg.set_reply_handler (agent node.send_message_reply (?, a_msg)) node.send_message_node (a_msg, a_node) end invariant node_set: node /= Void end