This site contains older material on Eiffel. For the main Eiffel page, see http://www.eiffel.com.

Table of Contents Previous Chapter

5.16 Class STORABLE

indexing
    description: "Objects that may be stored and retrieved along with all their dependents. This class may be used as ancestor by classes needing its facilities."
class interface
    STORABLE
feature -- Access
    retrieved (file: FILE): STORABLE
-- Retrieved object structure, from external
-- representation previously stored in file.
-- To access resulting object under correct type,
-- use assignment attempt.
-- Will raise an exception (code Retrieve_exception)
-- if file content is not a STORABLE structure.
      require
file_not_void: file /= Void;
file_exists: file.exists;
file_is_open_read: file.is_open_read
file_not_plain_text: not file.is_plain_text
      ensure
result_exists: Result /= Void
feature -- Element change
    basic_store (file: FILE)
-- Produce on file an external representation of the
-- entire object structure reachable from current object.
-- Retrievable within current system only.
      require
file_not_void: file /= Void;
file_exists: file.exists;
file_is_open_write: file.is_open_write;
file_not_plain_text: not file.is_plain_text
    general_store (file: FILE)
-- Produce on file an external representation of the
-- entire object structure reachable from current object.
-- Retrievable from other systems for same platform
-- (machine architecture).
      require
file_not_void: file /= Void;
file_exists: file.exists;
file_is_open_write: file.is_open_write;
file_not_plain_text: not file.is_plain_text
-- Produce on file an external representation of the
-- entire object structure reachable from current object.
-- Retrievable from other systems for the same or other
-- platforms (machine architectures).
      require
file_not_void: file /= Void;
file_exists: file.exists;
file_is_open_write: file.is_open_write;
file_not_plain_text: not file.is_plain_text
end

Table of Contents Next Chapter