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
Check_instruction: INTEGER is 7
-- Exception code for violated check
-- (from EXCEP_CONST)
Class_invariant: INTEGER is 6
-- Exception code for violated class invariant
-- (from EXCEP_CONST)
Developer_exception: INTEGER is 24
-- Exception code for developer exception
-- (from EXCEP_CONST)
External_exception: INTEGER is 18
-- Exception code for operating system error
-- which does not set the errno variable
-- (Unix-specific)
-- (from EXCEP_CONST)
Floating_point_exception: INTEGER is 5
-- Exception code for floating point exception
-- (from EXCEP_CONST)
Incorrect_inspect_value: INTEGER is 9
-- Exception code for inspect value which is not one
-- of the inspect constants, if there is no Else_part
-- (from EXCEP_CONST)
Io_exception: INTEGER is 21
-- Exception code for I/O error
-- (from EXCEP_CONST)
Loop_invariant: INTEGER is 11
-- Exception code for violated loop invariant
-- (from EXCEP_CONST)
Loop_variant: INTEGER is 10
-- Exception code for non-decreased loop variant
-- (from EXCEP_CONST)
No_more_memory: INTEGER is 2
-- Exception code for failed memory allocation
-- (from EXCEP_CONST)
Operating_system_exception: INTEGER is 22
-- Exception code for operating system error
-- which sets the errno variable
-- (Unix-specific)
-- (from EXCEP_CONST)
Postcondition: INTEGER is 4
-- Exception code for violated postcondition
-- (from EXCEP_CONST)
Precondition: INTEGER is 3
-- Exception code for violated precondition
-- (from EXCEP_CONST)
Rescue_exception: INTEGER is 14
-- Exception code for exception in rescue clause
-- (from EXCEP_CONST)
retrieve_by_name (file_name: STRING): ANY
-- Retrieve object structure, from external
-- representation previously stored in a file
-- called file_name.
-- To access resulting object under correct type,
-- use assignment attempt.
-- Will raise an exception (code Retrieve_exception)
-- if file content is not a stored Eiffel structure.
-- Will return Void if the file does not exist or
-- is not readable.
require
file_name_exists: file_name /= void;
file_name_meaningful: not file_name.empty
Retrieve_exception: INTEGER is 23
-- Exception code for retrieval error;
-- may be raised by retrieved in IO_MEDIUM.
-- (from EXCEP_CONST)
retrieved (medium: IO_MEDIUM): ANY
-- Retrieved object structure, from external
-- representation previously stored in medium.
-- To access resulting object under correct type,
-- use assignment attempt.
-- Will raise an exception (code Retrieve_exception)
-- if medium content is not a stored Eiffel structure.
require
medium_not_void: medium /= void;
medium_exists: medium.exists;
medium_is_open_read: medium.is_open_read;
medium_supports_storable: medium.support_storable
ensure
result_exists: Result /= void
Routine_failure: INTEGER is 8
-- Exception code for failed routine
-- (from EXCEP_CONST)
Signal_exception: INTEGER is 12
-- Exception code for operating system signal
-- (from EXCEP_CONST)
Void_assigned_to_expanded: INTEGER is 19
-- Exception code for assignment of void value
-- to expanded entity
-- (from EXCEP_CONST)
Void_call_target: INTEGER is 1
-- Exception code for feature applied to void reference
-- (from EXCEP_CONST)
feature -- Status report
assertion_violation: BOOLEAN
-- Is last exception originally due to a violated
-- assertion or non-decreasing variant?
-- (from EXCEPTIONS)
class_name: STRING
-- Name of the class that includes the recipient
-- of original form of last exception
-- (from EXCEPTIONS)
developer_exception_name: STRING
-- Name of last developer-raised exception
-- (from EXCEPTIONS)
require -- from EXCEPTIONS
applicable: is_developer_exception
exception: INTEGER
-- Code of last exception that occurred
-- (from EXCEPTIONS)
exception_trace: STRING
-- String representation of the exception trace
-- (from EXCEPTIONS)
is_developer_exception: BOOLEAN
-- Is the last exception originally due to
-- a developer exception?
-- (from EXCEPTIONS)
is_developer_exception_of_name (name: STRING): BOOLEAN
-- Is the last exception originally due to a developer
-- exception of name name?
-- (from EXCEPTIONS)
is_signal: BOOLEAN
-- Is last exception originally due to an external
-- event (operating system signal)?
-- (from EXCEPTIONS)
is_system_exception: BOOLEAN
-- Is last exception originally due to an
-- external event (operating system error)?
-- (from EXCEPTIONS)
meaning (except: INTEGER): STRING
-- A message in English describing what except is
-- (from EXCEPTIONS)
original_class_name: STRING
-- Name of the class that includes the recipient
-- of original form of last exception
-- (from EXCEPTIONS)
original_exception: INTEGER
-- Original code of last exception that triggered
-- current exception
-- (from EXCEPTIONS)
original_recipient_name: STRING
-- Name of the routine whose execution was
-- interrupted by original form of last exception
-- (from EXCEPTIONS)
original_tag_name: STRING
-- Assertion tag for original form of last
-- assertion violation.
-- (from EXCEPTIONS)
recipient_name: STRING
-- Name of the routine whose execution was
-- interrupted by last exception
-- (from EXCEPTIONS)
tag_name: STRING
-- Tag of last violated asssertion clause
-- (from EXCEPTIONS)
feature -- Status setting
catch (code: INTEGER)
-- Make sure that any exception of code code will be
-- caught. This is the default.
-- (from EXCEPTIONS)
die (code: INTEGER)
-- Terminate execution with exit status code,
-- without triggering an exception.
-- (from EXCEPTIONS)
ignore (code: INTEGER)
-- Make sure that any exception of code code will be
-- ignored. This is not the default.
-- (from EXCEPTIONS)
message_on_failure
-- Print an exception history table
-- in case of failure.
-- This is the default.
-- (from EXCEPTIONS)
no_message_on_failure
-- Do not print an exception history table
-- in case of failure.
-- (from EXCEPTIONS)
raise (name: STRING)
-- Raise a developer exception of name name.
-- (from EXCEPTIONS)
feature -- Element change
basic_store (medium: IO_MEDIUM)
-- Produce on medium an external representation of the
-- entire object structure reachable from current object.
-- Retrievable within current system only.
require
medium_not_void: medium /= void;
medium_exists: medium.exists;
medium_is_open_write: medium.is_open_write;
medium_supports_storable: medium.support_storable
general_store (medium: IO_MEDIUM)
-- Produce on medium an external representation of the
-- entire object structure reachable from current object.
-- Retrievable from other systems for same platform
-- (machine architecture).
require
medium_not_void: medium /= void;
medium_exists: medium.exists;
medium_is_open_write: medium.is_open_write;
medium_supports_storable: medium.support_storable
independent_store (medium: IO_MEDIUM)
-- Produce on medium an external representation of the
-- entire object structure reachable from current object.
-- Retrievable from other systems for the same or other
-- platform (machine architecture).
require
medium_not_void: medium /= void;
medium_exists: medium.exists;
medium_is_open_write: medium.is_open_write;
medium_supports_storable: medium.support_storable
store_by_name (file_name: STRING)
-- Produce on file called file_name an external
-- representation of the entire object structure
-- reachable from current object.
-- Retrievable from other systems for same platform
-- (machine architecture).
require
file_name_not_void: file_name /= void;
file_name_meaningful: not file_name.empty
invariant
-- from GENERAL
reflexive_equality: standard_is_equal (Current);
reflexive_conformance: conforms_to (Current);
end -- class STORABLE