indexing description: "Common routine for RT_EXTENSION classes" status: "See notice at end of class." legal: "See notice at end of class." date: "$Date$" revision: "$Revision$" deferred class RT_EXTENSION_GENERAL inherit RT_EXTENSION_COMMON feature -- RT extension identifiers (check eif_debug.h uses the same values) Op_enter_feature: INTEGER = 10 Op_leave_feature: INTEGER = 11 Op_rescue_feature: INTEGER = 12 Op_rt_hook: INTEGER = 13 Op_rt_assign_attrib: INTEGER = 14 Op_rt_assign_local: INTEGER = 15 feature -- Object storage Access saved_object_to (r: ?ANY; fn: STRING): ?ANY -- Save object `r' into file `fn' local file: RAW_FILE do create file.make (fn) if r /= Void and then (not file.exists or else file.is_writable) then file.create_read_write file.independent_store (r) file.close Result := r else Result := Void end end object_loaded_from (r: ?ANY; fn: STRING): ?ANY -- Loaded object from file `fn'. -- if `r' is Void return a new object -- else load into `r' -- If failure then results Void object. local o: ANY file: RAW_FILE retried: BOOLEAN do if not retried then create file.make (fn) if file.exists and then file.is_readable then file.open_read o := file.retrieved file.close if {o1: ANY} r then if {o2: ANY} o and then o1.same_type (o2) then o1.standard_copy (o2) Result := o1 end else Result := o end else Result := Void end else Result := r end rescue retried := True retry end indexing library: "EiffelBase: Library of reusable components for Eiffel." copyright: "Copyright (c) 1984-2008, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 356 Storke Road, Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end