indexing description: "User retrieve information reply message" author: "Marco Zietzling " date: "$Date$" revision: "$Revision$" class O_USER_RETRIEVE_INFORMATION_REPLY_MESSAGE inherit O_MESSAGE rename make as make_message redefine make_from_generic end O_USER_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_user_name: like user_name; a_data: like data) is -- Create. require a_user_name_ok: a_user_name /= Void and then not a_user_name.is_empty a_data_ok: a_data /= Void do make_message user_name := a_user_name data := a_data ensure user_name_set: user_name = a_user_name data_set: data = a_data end make_from_generic (a_msg: O_GENERIC_MESSAGE) is -- Create from a generic message. local l_args: HASH_TABLE [STRING, STRING] i: INTEGER do Precursor (a_msg) l_args := a_msg.arguments user_name := l_args.item (user_name_argument).out from i := 1 create data.make (((l_args.count - 2) / 2).rounded) until i > ((l_args.count - 2) / 2).rounded loop data.force (l_args.item (data_argument + "i" + i.out), l_args.item (data_argument + "k" + i.out)) i := i + 1 end end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := user_namespace end type: STRING is -- Type of the message. once Result := user_retrieve_information_reply_type end user_name: STRING -- User name. data: DS_HASH_TABLE [ANY, STRING] -- User information specific data. arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. local i: INTEGER do create Result.make (2) Result.force (user_name.out, user_name_argument) from data.start i := 1 until data.after loop Result.force (data.key_for_iteration, data_argument + "k" + i.out) Result.force (data.item_for_iteration.out, data_argument + "i" + i.out) data.forth i := i + 1 end end feature {NONE} -- Implementation user_name_argument: STRING is "user_name" data_argument: STRING is "data" invariant user_name_ok: user_name /= Void and then not user_name.is_empty data_ok: data /= Void end