Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Chart Relations Text Flat Contracts Go to:
note description: "Implementation of TUPLE" library: "Free implementation of ELKS library" status: "See notice at end of class." legal: "See notice at end of class." date: "$Date: 2016-03-02 13:15:09 -0800 (Wed, 02 Mar 2016) $" revision: "$Revision: 98557 $" class TUPLE create default_create feature {NONE} -- Initialization default_create -- Process instances of classes with no creation clause. -- (Default: do nothing.) -- (from ANY) do end feature -- Access Any_code: NATURAL_8 = 255 -- Code used to identify type in TUPLE. at alias "@" (index: INTEGER_32): detachable separate ANY assign put -- Entry of key `index'. -- Was declared in TUPLE as synonym of item. do inspect eif_item_type ($Current.to_pointer, index) when Boolean_code then Result := eif_boolean_item ($Current.to_pointer, index) when Character_8_code then Result := eif_character_8_item ($Current.to_pointer, index) when Character_32_code then Result := eif_character_32_item ($Current.to_pointer, index) when Real_64_code then Result := eif_real_64_item ($Current.to_pointer, index) when Real_32_code then Result := eif_real_32_item ($Current.to_pointer, index) when Pointer_code then Result := eif_pointer_item ($Current.to_pointer, index) when Natural_8_code then Result := eif_natural_8_item ($Current.to_pointer, index) when Natural_16_code then Result := eif_natural_16_item ($Current.to_pointer, index) when Natural_32_code then Result := eif_natural_32_item ($Current.to_pointer, index) when Natural_64_code then Result := eif_natural_64_item ($Current.to_pointer, index) when Integer_8_code then Result := eif_integer_8_item ($Current.to_pointer, index) when Integer_16_code then Result := eif_integer_16_item ($Current.to_pointer, index) when Integer_32_code then Result := eif_integer_32_item ($Current.to_pointer, index) when Integer_64_code then Result := eif_integer_64_item ($Current.to_pointer, index) when Reference_code then Result := eif_reference_item ($Current.to_pointer, index) end end Boolean_code: NATURAL_8 = 1 boolean_item (index: INTEGER_32): BOOLEAN -- Boolean item at `index'. require valid_index: valid_index (index) is_boolean: is_boolean_item (index) do Result := eif_boolean_item ($Current.to_pointer, index) end Character_32_code: NATURAL_8 = 14 -- Was declared in TUPLE as synonym of Wide_character_code. character_32_item (index: INTEGER_32): CHARACTER_32 -- Character item at `index'. -- Was declared in TUPLE as synonym of wide_character_item. require valid_index: valid_index (index) is_character_32: is_character_32_item (index) do Result := eif_character_32_item ($Current.to_pointer, index) end Character_8_code: NATURAL_8 = 2 -- Was declared in TUPLE as synonym of Character_code. character_8_item (index: INTEGER_32): CHARACTER_8 -- Character item at `index'. -- Was declared in TUPLE as synonym of character_item. require valid_index: valid_index (index) is_character_8: is_character_8_item (index) do Result := eif_character_8_item ($Current.to_pointer, index) end Character_code: NATURAL_8 = 2 -- Was declared in TUPLE as synonym of Character_8_code. character_item (index: INTEGER_32): CHARACTER_8 -- Character item at `index'. -- Was declared in TUPLE as synonym of character_8_item. require valid_index: valid_index (index) is_character_8: is_character_8_item (index) do Result := eif_character_8_item ($Current.to_pointer, index) end double_item (index: INTEGER_32): REAL_64 -- Double item at `index'. -- Was declared in TUPLE as synonym of real_64_item. require valid_index: valid_index (index) is_numeric: is_double_item (index) do Result := eif_real_64_item ($Current.to_pointer, index) end generating_type: TYPE [detachable TUPLE] -- Type of current object -- (type of which it is a direct instance) -- (from ANY) external "built_in" ensure -- from ANY generating_type_not_void: Result /= Void end generator: STRING_8 -- Name of current object's generating class -- (base class of the type of which it is a direct instance) -- (from ANY) external "built_in" ensure -- from ANY generator_not_void: Result /= Void generator_not_empty: not Result.is_empty end Integer_16_code: NATURAL_8 = 7 integer_16_item (index: INTEGER_32): INTEGER_16 -- INTEGER_16 item at `index'. require valid_index: valid_index (index) is_integer: is_integer_16_item (index) do Result := eif_integer_16_item ($Current.to_pointer, index) end Integer_32_code: NATURAL_8 = 8 integer_32_item (index: INTEGER_32): INTEGER_32 -- INTEGER_32 item at `index'. -- Was declared in TUPLE as synonym of integer_item. require valid_index: valid_index (index) is_integer: is_integer_32_item (index) do Result := eif_integer_32_item ($Current.to_pointer, index) end Integer_64_code: NATURAL_8 = 9 integer_64_item (index: INTEGER_32): INTEGER_64 -- INTEGER_64 item at `index'. require valid_index: valid_index (index) is_integer: is_integer_64_item (index) do Result := eif_integer_64_item ($Current.to_pointer, index) end Integer_8_code: NATURAL_8 = 6 integer_8_item (index: INTEGER_32): INTEGER_8 -- INTEGER_8 item at `index'. require valid_index: valid_index (index) is_integer: is_integer_8_item (index) do Result := eif_integer_8_item ($Current.to_pointer, index) end integer_item (index: INTEGER_32): INTEGER_32 -- INTEGER_32 item at `index'. -- Was declared in TUPLE as synonym of integer_32_item. require valid_index: valid_index (index) is_integer: is_integer_32_item (index) do Result := eif_integer_32_item ($Current.to_pointer, index) end item alias "[]" (index: INTEGER_32): detachable separate ANY assign put -- Entry of key `index'. -- Was declared in TUPLE as synonym of at. require -- from READABLE_INDEXABLE valid_index: valid_index (index) do inspect eif_item_type ($Current.to_pointer, index) when Boolean_code then Result := eif_boolean_item ($Current.to_pointer, index) when Character_8_code then Result := eif_character_8_item ($Current.to_pointer, index) when Character_32_code then Result := eif_character_32_item ($Current.to_pointer, index) when Real_64_code then Result := eif_real_64_item ($Current.to_pointer, index) when Real_32_code then Result := eif_real_32_item ($Current.to_pointer, index) when Pointer_code then Result := eif_pointer_item ($Current.to_pointer, index) when Natural_8_code then Result := eif_natural_8_item ($Current.to_pointer, index) when Natural_16_code then Result := eif_natural_16_item ($Current.to_pointer, index) when Natural_32_code then Result := eif_natural_32_item ($Current.to_pointer, index) when Natural_64_code then Result := eif_natural_64_item ($Current.to_pointer, index) when Integer_8_code then Result := eif_integer_8_item ($Current.to_pointer, index) when Integer_16_code then Result := eif_integer_16_item ($Current.to_pointer, index) when Integer_32_code then Result := eif_integer_32_item ($Current.to_pointer, index) when Integer_64_code then Result := eif_integer_64_item ($Current.to_pointer, index) when Reference_code then Result := eif_reference_item ($Current.to_pointer, index) end end item_code (index: INTEGER_32): NATURAL_8 -- Type code of item at `index'. Used for -- argument processing in ROUTINE require valid_index: valid_index (index) do Result := eif_item_type ($Current.to_pointer, index) end Natural_16_code: NATURAL_8 = 11 natural_16_item (index: INTEGER_32): NATURAL_16 -- NATURAL_16 item at `index'. require valid_index: valid_index (index) is_integer: is_natural_16_item (index) do Result := eif_natural_16_item ($Current.to_pointer, index) end Natural_32_code: NATURAL_8 = 12 natural_32_item (index: INTEGER_32): NATURAL_32 -- NATURAL_32 item at `index'. require valid_index: valid_index (index) is_integer: is_natural_32_item (index) do Result := eif_natural_32_item ($Current.to_pointer, index) end Natural_64_code: NATURAL_8 = 13 natural_64_item (index: INTEGER_32): NATURAL_64 -- NATURAL_64 item at `index'. require valid_index: valid_index (index) is_integer: is_natural_64_item (index) do Result := eif_natural_64_item ($Current.to_pointer, index) end Natural_8_code: NATURAL_8 = 10 natural_8_item (index: INTEGER_32): NATURAL_8 -- NATURAL_8 item at `index'. require valid_index: valid_index (index) is_integer: is_natural_8_item (index) do Result := eif_natural_8_item ($Current.to_pointer, index) end new_cursor: INDEXABLE_ITERATION_CURSOR [detachable separate ANY] -- Fresh cursor associated with current structure -- (from READABLE_INDEXABLE) do create {READABLE_INDEXABLE_ITERATION_CURSOR [detachable separate ANY]} Result.make (Current) Result.start ensure -- from ITERABLE result_attached: Result /= Void end plus alias "+" (a_other: TUPLE): detachable like Current -- Concatenation of `Current' with `a_other' local l_reflector: REFLECTOR i, n1, n2: INTEGER_32 t1, t2: TYPE [detachable TUPLE] l_type_id: INTEGER_32 l_items: SPECIAL [detachable separate ANY] l_type_string: STRING_8 do n1 := count n2 := a_other.count if n1 = 0 then if attached {like plus} a_other.twin as l_res then Result := l_res else check current_is_empty_tuple: count = 0 end end elseif n2 = 0 then Result := twin else create l_type_string.make_from_string ("TUPLE [") create l_items.make_empty (n1 + n2) from t1 := generating_type check same_count: t1.generic_parameter_count = n1 end i := 1 until i > n1 loop if i > 1 then l_type_string.append_character (',') end l_type_string.append (t1.generic_parameter_type (i).name) l_items.force (item (i), i - 1) i := i + 1 end from t2 := a_other.generating_type check same_count: t2.generic_parameter_count = n2 end until i > n1 + n2 loop l_type_string.append_character (',') l_type_string.append (t2.generic_parameter_type (i - n1).name) l_items.force (a_other.item (i - n1), i - 1) i := i + 1 end l_type_string.append_character (']') create l_reflector l_type_id := l_reflector.dynamic_type_from_string (l_type_string) if l_type_id >= 0 then if attached {like plus} l_reflector.new_tuple_from_special (l_type_id, l_items) as res then Result := res end end end ensure has_expected_count: Result /= Void implies Result.count = count + a_other.count has_expected_items: Result /= Void implies ((across 1 |..| count as ic_1 all Result [ic_1.item] = item (ic_1.item) end) and (across 1 |..| a_other.count as ic_2 all Result [count + ic_2.item] = a_other [ic_2.item] end)) end Pointer_code: NATURAL_8 = 5 pointer_item (index: INTEGER_32): POINTER -- Pointer item at `index'. require valid_index: valid_index (index) is_pointer: is_pointer_item (index) do Result := eif_pointer_item ($Current.to_pointer, index) end Real_32_code: NATURAL_8 = 4 real_32_item (index: INTEGER_32): REAL_32 -- real item at `index'. -- Was declared in TUPLE as synonym of real_item. require valid_index: valid_index (index) is_real_or_integer: is_real_item (index) do Result := eif_real_32_item ($Current.to_pointer, index) end Real_64_code: NATURAL_8 = 3 real_64_item (index: INTEGER_32): REAL_64 -- Double item at `index'. -- Was declared in TUPLE as synonym of double_item. require valid_index: valid_index (index) is_numeric: is_double_item (index) do Result := eif_real_64_item ($Current.to_pointer, index) end real_item (index: INTEGER_32): REAL_32 -- real item at `index'. -- Was declared in TUPLE as synonym of real_32_item. require valid_index: valid_index (index) is_real_or_integer: is_real_item (index) do Result := eif_real_32_item ($Current.to_pointer, index) end Reference_code: NATURAL_8 = 0 reference_item (index: INTEGER_32): detachable separate ANY -- Reference item at `index'. require valid_index: valid_index (index) is_reference: is_reference_item (index) do Result := eif_reference_item ($Current.to_pointer, index) end Wide_character_code: NATURAL_8 = 14 -- Was declared in TUPLE as synonym of Character_32_code. wide_character_item (index: INTEGER_32): CHARACTER_32 -- Character item at `index'. -- Was declared in TUPLE as synonym of character_32_item. require valid_index: valid_index (index) is_character_32: is_character_32_item (index) do Result := eif_character_32_item ($Current.to_pointer, index) end feature -- Measurement index_set: INTEGER_INTERVAL obsolete "Use `lower' and `upper' instead." -- Range of acceptable indexes. -- (from READABLE_INDEXABLE) do create Result.make (Lower, count) ensure -- from READABLE_INDEXABLE not_void: Result /= Void same_lower: Result.lower = Lower same_upper: Result.upper = count end feature -- Comparison frozen deep_equal (a: detachable ANY; b: like arg #1): BOOLEAN -- Are `a' and `b' either both void -- or attached to isomorphic object structures? -- (from ANY) do if a = Void then Result := b = Void else Result := b /= Void and then a.is_deep_equal (b) end ensure -- from ANY shallow_implies_deep: standard_equal (a, b) implies Result both_or_none_void: (a = Void) implies (Result = (b = Void)) same_type: (Result and (a /= Void)) implies (b /= Void and then a.same_type (b)) symmetric: Result implies deep_equal (b, a) end frozen equal (a: detachable ANY; b: like arg #1): BOOLEAN -- Are `a' and `b' either both void or attached -- to objects considered equal? -- (from ANY) do if a = Void then Result := b = Void else Result := b /= Void and then a.is_equal (b) end ensure -- from ANY definition: Result = (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.is_equal (b)) end frozen is_deep_equal (other: attached TUPLE): BOOLEAN -- Are `Current' and `other' attached to isomorphic object structures? -- (from ANY) require -- from ANY other_not_void: other /= Void external "built_in" ensure -- from ANY shallow_implies_deep: standard_is_equal (other) implies Result same_type: Result implies same_type (other) symmetric: Result implies other.is_deep_equal (Current) end is_equal (other: like Current): BOOLEAN -- Is `other' attached to an object considered -- equal to current object? require -- from ANY other_not_void: other /= Void local i, nb: INTEGER_32 l_object_compare: BOOLEAN do l_object_compare := object_comparison if l_object_compare = other.object_comparison then if l_object_compare then nb := count if nb = other.count then from Result := True i := 1 until i > nb or not Result loop Result := item (i) ~ other.item (i) i := i + 1 end end else Result := Precursor {HASHABLE} (other) end end ensure -- from ANY symmetric: Result implies other ~ Current consistent: standard_is_equal (other) implies Result end object_comparison: BOOLEAN -- Must search operations use equal rather than `=' -- for comparing references? (Default: no, use `='.) do Result := eif_boolean_item ($Current.to_pointer, 0) end frozen standard_equal (a: detachable ANY; b: like arg #1): BOOLEAN -- Are `a' and `b' either both void or attached to -- field-by-field identical objects of the same type? -- Always uses default object comparison criterion. -- (from ANY) do if a = Void then Result := b = Void else Result := b /= Void and then a.standard_is_equal (b) end ensure -- from ANY definition: Result = (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.standard_is_equal (b)) end frozen standard_is_equal (other: attached TUPLE): BOOLEAN -- Is `other' attached to an object of the same type -- as current object, and field-by-field identical to it? -- (from ANY) require -- from ANY other_not_void: other /= Void external "built_in" ensure -- from ANY same_type: Result implies same_type (other) symmetric: Result implies other.standard_is_equal (Current) end feature -- Status report conforms_to (other: ANY): BOOLEAN -- Does type of current object conform to type -- of `other' (as per Eiffel: The Language, chapter 13)? -- (from ANY) require -- from ANY other_not_void: other /= Void external "built_in" end count: INTEGER_32 -- Number of element in Current. external "built_in" end hash_code: INTEGER_32 -- Hash code value local i, nb, l_hash: INTEGER_32 do from i := 1 nb := count until i > nb loop inspect eif_item_type ($Current.to_pointer, i) when Boolean_code then l_hash := eif_boolean_item ($Current.to_pointer, i).hash_code when Character_8_code then l_hash := eif_character_8_item ($Current.to_pointer, i).hash_code when Character_32_code then l_hash := eif_character_32_item ($Current.to_pointer, i).hash_code when Real_64_code then l_hash := eif_real_64_item ($Current.to_pointer, i).hash_code when Real_32_code then l_hash := eif_real_32_item ($Current.to_pointer, i).hash_code when Pointer_code then l_hash := eif_pointer_item ($Current.to_pointer, i).hash_code when Natural_8_code then l_hash := eif_natural_8_item ($Current.to_pointer, i).hash_code when Natural_16_code then l_hash := eif_natural_16_item ($Current.to_pointer, i).hash_code when Natural_32_code then l_hash := eif_natural_32_item ($Current.to_pointer, i).hash_code when Natural_64_code then l_hash := eif_natural_64_item ($Current.to_pointer, i).hash_code when Integer_8_code then l_hash := eif_integer_8_item ($Current.to_pointer, i).hash_code when Integer_16_code then l_hash := eif_integer_16_item ($Current.to_pointer, i).hash_code when Integer_32_code then l_hash := eif_integer_32_item ($Current.to_pointer, i).hash_code when Integer_64_code then l_hash := eif_integer_64_item ($Current.to_pointer, i).hash_code when Reference_code then if attached {HASHABLE} eif_reference_item ($Current.to_pointer, i) as l_key then l_hash := l_key.hash_code else l_hash := 0 end end Result := Result + l_hash * Internal_primes.i_th (i) i := i + 1 end Result := Result.hash_code ensure -- from HASHABLE good_hash_value: Result >= 0 end is_empty: BOOLEAN -- Is Current empty? do Result := count = 0 end is_hashable: BOOLEAN -- May current object be hashed? -- (True by default.) -- (from HASHABLE) do Result := True end Lower: INTEGER_32 = 1 -- Lower bound of TUPLE. same_type (other: ANY): BOOLEAN -- Is type of current object identical to type of `other'? -- (from ANY) require -- from ANY other_not_void: other /= Void external "built_in" ensure -- from ANY definition: Result = (conforms_to (other) and other.conforms_to (Current)) end upper: INTEGER_32 -- Upper bound of TUPLE. -- Use count instead. do Result := count ensure definition: Result = count end valid_index (k: INTEGER_32): BOOLEAN -- Is `k' a valid key? do Result := k >= 1 and then k <= count ensure -- from READABLE_INDEXABLE only_if_in_index_set: Result implies (Lower <= k and k <= count) end valid_type_for_index (v: detachable separate ANY; index: INTEGER_32): BOOLEAN -- Is object `v' a valid target for element at position `index'? require valid_index: valid_index (index) local l_reflector: REFLECTOR l_type_id: INTEGER_32 do if v = Void then if eif_item_type ($Current.to_pointer, index) = Reference_code then Result := not generating_type.generic_parameter_type (index).is_attached end else inspect eif_item_type ($Current.to_pointer, index) when Boolean_code then Result := attached {BOOLEAN_REF} v as l_b when Character_8_code then Result := attached {CHARACTER_8_REF} v as l_c when Character_32_code then Result := attached {CHARACTER_32_REF} v as l_wc when Real_64_code then Result := attached {REAL_64_REF} v as l_d when Real_32_code then Result := attached {REAL_32_REF} v as l_r when Pointer_code then Result := attached {POINTER_REF} v as l_p when Natural_8_code then Result := attached {NATURAL_8_REF} v as l_ui8 when Natural_16_code then Result := attached {NATURAL_16_REF} v as l_ui16 when Natural_32_code then Result := attached {NATURAL_32_REF} v as l_ui32 when Natural_64_code then Result := attached {NATURAL_64_REF} v as l_ui64 when Integer_8_code then Result := attached {INTEGER_8_REF} v as l_i8 when Integer_16_code then Result := attached {INTEGER_16_REF} v as l_i16 when Integer_32_code then Result := attached {INTEGER_32_REF} v as l_i32 when Integer_64_code then Result := attached {INTEGER_64_REF} v as l_i64 when Reference_code then create l_reflector l_type_id := {ISE_RUNTIME}.dynamic_type (v) Result := l_reflector.field_conforms_to (l_type_id, generating_type.generic_parameter_type (index).type_id) end end end feature -- Status setting compare_objects -- Ensure that future search operations will use equal -- rather than `=' for comparing references. do eif_put_boolean_item ($Current.to_pointer, 0, True) ensure object_comparison: object_comparison end compare_references -- Ensure that future search operations will use `=' -- rather than equal for comparing references. do eif_put_boolean_item ($Current.to_pointer, 0, False) ensure reference_comparison: not object_comparison end feature -- Element change put (v: detachable separate ANY; index: INTEGER_32) -- Insert `v' at position `index'. require valid_index: valid_index (index) valid_type_for_index: valid_type_for_index (v, index) do inspect eif_item_type ($Current.to_pointer, index) when Boolean_code then eif_put_boolean_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Character_8_code then eif_put_character_8_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Character_32_code then eif_put_character_32_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Real_64_code then eif_put_real_64_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Real_32_code then eif_put_real_32_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Pointer_code then eif_put_pointer_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Natural_8_code then eif_put_natural_8_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Natural_16_code then eif_put_natural_16_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Natural_32_code then eif_put_natural_32_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Natural_64_code then eif_put_natural_64_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Integer_8_code then eif_put_integer_8_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Integer_16_code then eif_put_integer_16_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Integer_32_code then eif_put_integer_32_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Integer_64_code then eif_put_integer_64_item_with_object ($Current.to_pointer, index, $v.to_pointer) when Reference_code then eif_put_reference_item_with_object ($Current.to_pointer, index, $v.to_pointer) end end put_boolean (v: BOOLEAN; index: INTEGER_32) -- Put `v' at position `index' in Current. require valid_index: valid_index (index) valid_type: is_boolean_item (index) do eif_put_boolean_item ($Current.to_pointer, index, v) end put_character (v: CHARACTER_8; index: INTEGER_32) -- Put `v' at position `index' in Current. -- Was declared in TUPLE as synonym of put_character_8. require valid_index: valid_index (index) valid_type: is_character_8_item (index) do eif_put_character_8_item ($Current.to_pointer, index, v) end put_character_32 (v: CHARACTER_32; index: INTEGER_32) -- Put `v' at position `index' in Current. -- Was declared in TUPLE as synonym of put_wide_character. require valid_index: valid_index (index) valid_type: is_character_32_item (index) do eif_put_character_32_item ($Current.to_pointer, index, v) end put_character_8 (v: CHARACTER_8; index: INTEGER_32) -- Put `v' at position `index' in Current. -- Was declared in TUPLE as synonym of put_character. require valid_index: valid_index (index) valid_type: is_character_8_item (index) do eif_put_character_8_item ($Current.to_pointer, index, v) end put_double (v: REAL_64; index: INTEGER_32) -- Put `v' at position `index' in Current. -- Was declared in TUPLE as synonym of put_real_64. require valid_index: valid_index (index) valid_type: is_double_item (index) do eif_put_real_64_item ($Current.to_pointer, index, v) end put_integer (v: INTEGER_32; index: INTEGER_32) -- Put `v' at position `index' in Current. -- Was declared in TUPLE as synonym of put_integer_32. require valid_index: valid_index (index) valid_type: is_integer_32_item (index) do eif_put_integer_32_item ($Current.to_pointer, index, v) end put_integer_16 (v: INTEGER_16; index: INTEGER_32) -- Put `v' at position `index' in Current. require valid_index: valid_index (index) valid_type: is_integer_16_item (index) do eif_put_integer_16_item ($Current.to_pointer, index, v) end put_integer_32 (v: INTEGER_32; index: INTEGER_32) -- Put `v' at position `index' in Current. -- Was declared in TUPLE as synonym of put_integer. require valid_index: valid_index (index) valid_type: is_integer_32_item (index) do eif_put_integer_32_item ($Current.to_pointer, index, v) end put_integer_64 (v: INTEGER_64; index: INTEGER_32) -- Put `v' at position `index' in Current. require valid_index: valid_index (index) valid_type: is_integer_64_item (index) do eif_put_integer_64_item ($Current.to_pointer, index, v) end put_integer_8 (v: INTEGER_8; index: INTEGER_32) -- Put `v' at position `index' in Current. require valid_index: valid_index (index) valid_type: is_integer_8_item (index) do eif_put_integer_8_item ($Current.to_pointer, index, v) end put_natural_16 (v: NATURAL_16; index: INTEGER_32) -- Put `v' at position `index' in Current. require valid_index: valid_index (index) valid_type: is_natural_16_item (index) do eif_put_natural_16_item ($Current.to_pointer, index, v) end put_natural_32 (v: NATURAL_32; index: INTEGER_32) -- Put `v' at position `index' in Current. require valid_index: valid_index (index) valid_type: is_natural_32_item (index) do eif_put_natural_32_item ($Current.to_pointer, index, v) end put_natural_64 (v: NATURAL_64; index: INTEGER_32) -- Put `v' at position `index' in Current. require valid_index: valid_index (index) valid_type: is_natural_64_item (index) do eif_put_natural_64_item ($Current.to_pointer, index, v) end put_natural_8 (v: NATURAL_8; index: INTEGER_32) -- Put `v' at position `index' in Current. require valid_index: valid_index (index) valid_type: is_natural_8_item (index) do eif_put_natural_8_item ($Current.to_pointer, index, v) end put_pointer (v: POINTER; index: INTEGER_32) -- Put `v' at position `index' in Current. require valid_index: valid_index (index) valid_type: is_pointer_item (index) do eif_put_pointer_item ($Current.to_pointer, index, v) end put_real (v: REAL_32; index: INTEGER_32) -- Put `v' at position `index' in Current. -- Was declared in TUPLE as synonym of put_real_32. require valid_index: valid_index (index) valid_type: is_real_item (index) do eif_put_real_32_item ($Current.to_pointer, index, v) end put_real_32 (v: REAL_32; index: INTEGER_32) -- Put `v' at position `index' in Current. -- Was declared in TUPLE as synonym of put_real. require valid_index: valid_index (index) valid_type: is_real_item (index) do eif_put_real_32_item ($Current.to_pointer, index, v) end put_real_64 (v: REAL_64; index: INTEGER_32) -- Put `v' at position `index' in Current. -- Was declared in TUPLE as synonym of put_double. require valid_index: valid_index (index) valid_type: is_double_item (index) do eif_put_real_64_item ($Current.to_pointer, index, v) end put_reference (v: detachable separate ANY; index: INTEGER_32) -- Put `v' at position `index' in Current. require valid_index: valid_index (index) valid_type_for_index: valid_type_for_index (v, index) valid_type: is_reference_item (index) do eif_put_reference_item_with_object ($Current.to_pointer, index, $v.to_pointer) end put_wide_character (v: CHARACTER_32; index: INTEGER_32) -- Put `v' at position `index' in Current. -- Was declared in TUPLE as synonym of put_character_32. require valid_index: valid_index (index) valid_type: is_character_32_item (index) do eif_put_character_32_item ($Current.to_pointer, index, v) end feature -- Conversion arrayed: ARRAY [detachable separate ANY] obsolete "Will be removed in future releases" -- Items of Current as array local i, cnt: INTEGER_32 do from i := 1 cnt := count create Result.make_filled (Void, 1, cnt) until i > cnt loop Result.put (item (i), i) i := i + 1 end ensure exists: Result /= Void same_count: Result.count = count end boolean_arrayed: ARRAY [BOOLEAN] obsolete "Will be removed in future releases" -- Items of Current as array require is_uniform_boolean: is_uniform_boolean local i, cnt: INTEGER_32 do from i := 1 cnt := count create Result.make_filled (False, 1, cnt) until i > cnt loop Result.put (boolean_item (i), i) i := i + 1 end ensure exists: Result /= Void same_count: Result.count = count end character_8_arrayed: ARRAY [CHARACTER_8] obsolete "Will be removed in future releases" -- Items of Current as array -- Was declared in TUPLE as synonym of character_arrayed. require is_uniform_character: is_uniform_character local i, cnt: INTEGER_32 do from i := 1 cnt := count create Result.make_filled (' ', 1, cnt) until i > cnt loop Result.put (character_8_item (i), i) i := i + 1 end ensure exists: Result /= Void same_count: Result.count = count end character_arrayed: ARRAY [CHARACTER_8] obsolete "Will be removed in future releases" -- Items of Current as array -- Was declared in TUPLE as synonym of character_8_arrayed. require is_uniform_character: is_uniform_character local i, cnt: INTEGER_32 do from i := 1 cnt := count create Result.make_filled (' ', 1, cnt) until i > cnt loop Result.put (character_8_item (i), i) i := i + 1 end ensure exists: Result /= Void same_count: Result.count = count end double_arrayed: ARRAY [REAL_64] obsolete "Will be removed in future releases" -- Items of Current as array require convertible: convertible_to_double local i, cnt: INTEGER_32 do from i := 1 cnt := count create Result.make_filled ({REAL_64} 0.0, 1, cnt) until i > cnt loop Result.put (double_item (i), i) i := i + 1 end ensure exists: Result /= Void same_count: Result.count = count end integer_arrayed: ARRAY [INTEGER_32] obsolete "Will be removed in future releases" -- Items of Current as array require is_uniform_integer: is_uniform_integer local i, cnt: INTEGER_32 do from i := 1 cnt := count create Result.make_filled ({INTEGER_32} 0, 1, cnt) until i > cnt loop Result.put (integer_32_item (i), i) i := i + 1 end ensure exists: Result /= Void same_count: Result.count = count end pointer_arrayed: ARRAY [POINTER] obsolete "Will be removed in future releases" -- Items of Current as array require is_uniform_pointer: is_uniform_pointer local i, cnt: INTEGER_32 do from i := 1 cnt := count create Result.make_filled (default_pointer, 1, cnt) until i > cnt loop Result.put (pointer_item (i), i) i := i + 1 end ensure exists: Result /= Void same_count: Result.count = count end real_arrayed: ARRAY [REAL_32] obsolete "Will be removed in future releases" -- Items of Current as array require convertible: convertible_to_real local i, cnt: INTEGER_32 do from i := 1 cnt := count create Result.make_filled ({REAL_32} 0.0, 1, cnt) until i > cnt loop Result.put (real_item (i), i) i := i + 1 end ensure exists: Result /= Void same_count: Result.count = count end string_arrayed: ARRAY [detachable STRING_8] obsolete "Will be removed in future releases" -- Items of Current as array -- NOTE: Items with a type not cconforming to --       type STRING are set to Void. local i, cnt: INTEGER_32 do from i := 1 cnt := count create Result.make_filled (Void, 1, cnt) until i > cnt loop if attached {STRING_8} item (i) as s then Result.put (s, i) end i := i + 1 end ensure exists: Result /= Void same_count: Result.count = count end feature -- Duplication frozen clone (other: detachable ANY): like other obsolete "Use `twin' instead." -- Void if `other' is void; otherwise new object -- equal to `other' -- -- For non-void `other', clone calls copy; -- to change copying/cloning semantics, redefine copy. -- (from ANY) do if other /= Void then Result := other.twin end ensure -- from ANY equal: Result ~ other end copy (other: attached TUPLE) -- Update current object using fields of object attached -- to `other', so as to yield equal objects. -- (from ANY) require -- from ANY other_not_void: other /= Void type_identity: same_type (other) external "built_in" ensure -- from ANY is_equal: Current ~ other end frozen deep_clone (other: detachable ANY): like other obsolete "Use `deep_twin' instead." -- Void if `other' is void: otherwise, new object structure -- recursively duplicated from the one attached to `other' -- (from ANY) do if other /= Void then Result := other.deep_twin end ensure -- from ANY deep_equal: deep_equal (other, Result) end frozen deep_copy (other: attached TUPLE) -- Effect equivalent to that of: -- copy (`other' . deep_twin) -- (from ANY) require -- from ANY other_not_void: other /= Void do copy (other.deep_twin) ensure -- from ANY deep_equal: deep_equal (Current, other) end frozen deep_twin: attached TUPLE -- New object structure recursively duplicated from Current. -- (from ANY) external "built_in" ensure -- from ANY deep_twin_not_void: Result /= Void deep_equal: deep_equal (Current, Result) end frozen standard_clone (other: detachable ANY): like other obsolete "Use `standard_twin' instead." -- Void if `other' is void; otherwise new object -- field-by-field identical to `other'. -- Always uses default copying semantics. -- (from ANY) do if other /= Void then Result := other.standard_twin end ensure -- from ANY equal: standard_equal (Result, other) end frozen standard_copy (other: attached TUPLE) -- Copy every field of `other' onto corresponding field -- of current object. -- (from ANY) require -- from ANY other_not_void: other /= Void type_identity: same_type (other) external "built_in" ensure -- from ANY is_standard_equal: standard_is_equal (other) end frozen standard_twin: attached TUPLE -- New object field-by-field identical to `other'. -- Always uses default copying semantics. -- (from ANY) external "built_in" ensure -- from ANY standard_twin_not_void: Result /= Void equal: standard_equal (Result, Current) end frozen twin: attached TUPLE -- New object equal to `Current' -- twin calls copy; to change copying/twinning semantics, redefine copy. -- (from ANY) external "built_in" ensure -- from ANY twin_not_void: Result /= Void is_equal: Result ~ Current end feature -- Basic operations frozen as_attached: attached TUPLE -- Attached version of Current -- (Can be used during transitional period to convert -- non-void-safe classes to void-safe ones.) -- (from ANY) do Result := Current end frozen default: detachable TUPLE -- Default value of object's type -- (from ANY) do end frozen default_pointer: POINTER -- Default value of type `POINTER' -- (Avoid the need to write `p'.default for -- some `p' of type `POINTER'.) -- (from ANY) do end default_rescue -- Process exception for routines with no Rescue clause. -- (Default: do nothing.) -- (from ANY) do end frozen do_nothing -- Execute a null action. -- (from ANY) do end feature {NONE} -- Implementation Area_name: STRING_8 = "area" -- Name of attributes where TUPLE elements were stored. Internal_primes: PRIMES -- For quick access to prime numbers. once create Result end is_tuple_uniform (code: like item_code): BOOLEAN -- Are all items of type `code'? local i, nb: INTEGER_32 l_code: like item_code do Result := True if count > 0 then from nb := count if code = Any_code then i := 2 l_code := eif_item_type ($Current.to_pointer, 1) else i := 1 l_code := code end until i > nb or not Result loop Result := l_code = eif_item_type ($Current.to_pointer, i) i := i + 1 end end end feature -- Correction Mismatch_information: MISMATCH_INFORMATION -- Original attribute values of mismatched object -- (from MISMATCH_CORRECTOR) once create Result end feature {NONE} -- Externals: Access eif_boolean_item (obj: POINTER; pos: INTEGER_32): BOOLEAN -- Boolean item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_character_32_item (obj: POINTER; pos: INTEGER_32): CHARACTER_32 -- Wide character item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_character_8_item (obj: POINTER; pos: INTEGER_32): CHARACTER_8 -- Character item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_integer_16_item (obj: POINTER; pos: INTEGER_32): INTEGER_16 -- INTEGER_16 item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_integer_32_item (obj: POINTER; pos: INTEGER_32): INTEGER_32 -- INTEGER_32 item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_integer_64_item (obj: POINTER; pos: INTEGER_32): INTEGER_64 -- INTEGER_64 item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_integer_8_item (obj: POINTER; pos: INTEGER_32): INTEGER_8 -- INTEGER_8 item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_item_type (obj: POINTER; pos: INTEGER_32): NATURAL_8 -- Code for generic parameter `pos' in `obj'. external "C macro use %"eif_rout_obj.h%"" alias "eif_item_type" end eif_natural_16_item (obj: POINTER; pos: INTEGER_32): NATURAL_16 -- NATURAL_16 item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_natural_32_item (obj: POINTER; pos: INTEGER_32): NATURAL_32 -- NATURAL_32 item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_natural_64_item (obj: POINTER; pos: INTEGER_32): NATURAL_64 -- NATURAL_64 item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_natural_8_item (obj: POINTER; pos: INTEGER_32): NATURAL_8 -- NATURAL_8 item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_pointer_item (obj: POINTER; pos: INTEGER_32): POINTER -- Pointer item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_real_32_item (obj: POINTER; pos: INTEGER_32): REAL_32 -- Real item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_real_64_item (obj: POINTER; pos: INTEGER_32): REAL_64 -- Double item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end eif_reference_item (obj: POINTER; pos: INTEGER_32): detachable ANY -- Reference item at position `pos' in tuple `obj'. external "C macro use %"eif_rout_obj.h%"" end feature {NONE} -- Externals: Setting eif_put_boolean_item (obj: POINTER; pos: INTEGER_32; v: BOOLEAN) -- Set boolean item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_boolean_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set boolean item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_character_32_item (obj: POINTER; pos: INTEGER_32; v: CHARACTER_32) -- Set character_32 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_character_32_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set wide character item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_character_8_item (obj: POINTER; pos: INTEGER_32; v: CHARACTER_8) -- Set character_8 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_character_8_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set character item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_integer_16_item (obj: POINTER; pos: INTEGER_32; v: INTEGER_16) -- Set integer_16 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_integer_16_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set integer_16 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_integer_32_item (obj: POINTER; pos: INTEGER_32; v: INTEGER_32) -- Set integer_32 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_integer_32_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set integer_32 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_integer_64_item (obj: POINTER; pos: INTEGER_32; v: INTEGER_64) -- Set integer_64 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_integer_64_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set integer_64 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_integer_8_item (obj: POINTER; pos: INTEGER_32; v: INTEGER_8) -- Set integer_8 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_integer_8_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set integer_8 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_natural_16_item (obj: POINTER; pos: INTEGER_32; v: NATURAL_16) -- Set NATURAL_16 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_natural_16_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set NATURAL_16 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_natural_32_item (obj: POINTER; pos: INTEGER_32; v: NATURAL_32) -- Set NATURAL_32 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_natural_32_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set NATURAL_32 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_natural_64_item (obj: POINTER; pos: INTEGER_32; v: NATURAL_64) -- Set NATURAL_64 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_natural_64_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set NATURAL_64 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_natural_8_item (obj: POINTER; pos: INTEGER_32; v: NATURAL_8) -- Set NATURAL_8 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_natural_8_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set NATURAL_8 item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_pointer_item (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set pointer item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_pointer_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set pointer item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_real_32_item (obj: POINTER; pos: INTEGER_32; v: REAL_32) -- Set real item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_real_32_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set real item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_real_64_item (obj: POINTER; pos: INTEGER_32; v: REAL_64) -- Set double item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_real_64_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set double item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end eif_put_reference_item_with_object (obj: POINTER; pos: INTEGER_32; v: POINTER) -- Set reference item at position `pos' in tuple `obj' with `v'. external "C macro use %"eif_rout_obj.h%"" end feature -- Output Io: STD_FILES -- Handle to standard file setup -- (from ANY) once create Result Result.set_output_default ensure -- from ANY io_not_void: Result /= Void end out: STRING_8 -- New string containing terse printable representation -- of current object -- (from ANY) do Result := tagged_out ensure -- from ANY out_not_void: Result /= Void end print (o: detachable ANY) -- Write terse external representation of `o' -- on standard output. -- (from ANY) do if o /= Void then Io.put_string (o.out) end end frozen tagged_out: STRING_8 -- New string containing terse printable representation -- of current object -- (from ANY) external "built_in" ensure -- from ANY tagged_out_not_void: Result /= Void end feature -- Platform Operating_environment: OPERATING_ENVIRONMENT -- Objects available from the operating system -- (from ANY) once create Result ensure -- from ANY operating_environment_not_void: Result /= Void end feature -- Retrieval correct_mismatch -- Attempt to correct object mismatch using Mismatch_information. local i, nb: INTEGER_32 l_any: ANY do if attached {SPECIAL [ANY]} Mismatch_information.item (Area_name) as l_area then from i := 1 nb := l_area.count until i > nb loop l_any := l_area.item (i - 1) if valid_type_for_index (l_any, i) then put (l_any, i) else Precursor {MISMATCH_CORRECTOR} end i := i + 1 end else Precursor {MISMATCH_CORRECTOR} end end feature {NONE} -- Retrieval frozen internal_correct_mismatch -- Called from runtime to perform a proper dynamic dispatch on correct_mismatch -- from MISMATCH_CORRECTOR. -- (from ANY) local l_msg: STRING_8 l_exc: EXCEPTIONS do if attached {MISMATCH_CORRECTOR} Current as l_corrector then l_corrector.correct_mismatch else create l_msg.make_from_string ("Mismatch: ") create l_exc l_msg.append (generating_type.name) l_exc.raise_retrieval_exception (l_msg) end end feature -- Type conversion queries convertible_to_double: BOOLEAN obsolete "Will be removed in future releases" -- Is current convertible to an array of doubles? local i, cnt: INTEGER_32 tcode: like item_code do Result := True from i := 1 cnt := count until i > cnt or else not Result loop tcode := eif_item_type ($Current.to_pointer, i) inspect tcode when Integer_8_code, Integer_16_code, Integer_32_code, Integer_64_code, Real_32_code, Real_64_code then Result := True else Result := False end i := i + 1 end ensure yes_if_empty: (count = 0) implies Result end convertible_to_real: BOOLEAN obsolete "Will be removed in future releases" -- Is current convertible to an array of reals? local i, cnt: INTEGER_32 tcode: like item_code do Result := True from i := 1 cnt := count until i > cnt or else not Result loop tcode := eif_item_type ($Current.to_pointer, i) inspect tcode when Integer_8_code, Integer_16_code, Integer_32_code, Integer_64_code, Real_32_code then Result := True else Result := False end i := i + 1 end ensure yes_if_empty: (count = 0) implies Result end feature -- Type queries is_boolean_item (index: INTEGER_32): BOOLEAN -- Is item at `index' a BOOLEAN? require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Boolean_code) end is_character_32_item (index: INTEGER_32): BOOLEAN -- Is item at `index' a CHARACTER_32? -- Was declared in TUPLE as synonym of is_wide_character_item. require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Character_32_code) end is_character_8_item (index: INTEGER_32): BOOLEAN -- Is item at `index' a CHARACTER_8? -- Was declared in TUPLE as synonym of is_character_item. require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Character_8_code) end is_character_item (index: INTEGER_32): BOOLEAN -- Is item at `index' a CHARACTER_8? -- Was declared in TUPLE as synonym of is_character_8_item. require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Character_8_code) end is_double_item (index: INTEGER_32): BOOLEAN -- Is item at `index' a REAL_64? require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Real_64_code) end is_integer_16_item (index: INTEGER_32): BOOLEAN -- Is item at `index' an INTEGER_16? require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Integer_16_code) end is_integer_32_item (index: INTEGER_32): BOOLEAN -- Is item at `index' an INTEGER_32? -- Was declared in TUPLE as synonym of is_integer_item. require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Integer_32_code) end is_integer_64_item (index: INTEGER_32): BOOLEAN -- Is item at `index' an INTEGER_64? require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Integer_64_code) end is_integer_8_item (index: INTEGER_32): BOOLEAN -- Is item at `index' an INTEGER_8? require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Integer_8_code) end is_integer_item (index: INTEGER_32): BOOLEAN -- Is item at `index' an INTEGER_32? -- Was declared in TUPLE as synonym of is_integer_32_item. require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Integer_32_code) end is_natural_16_item (index: INTEGER_32): BOOLEAN -- Is item at `index' an NATURAL_16? require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Natural_16_code) end is_natural_32_item (index: INTEGER_32): BOOLEAN -- Is item at `index' an NATURAL_32? require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Natural_32_code) end is_natural_64_item (index: INTEGER_32): BOOLEAN -- Is item at `index' an NATURAL_64? require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Natural_64_code) end is_natural_8_item (index: INTEGER_32): BOOLEAN -- Is item at `index' an NATURAL_8? require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Natural_8_code) end is_numeric_item (index: INTEGER_32): BOOLEAN obsolete "Use the precise type query instead." -- Is item at `index' a number? require valid_index: valid_index (index) local tcode: like item_code do tcode := eif_item_type ($Current.to_pointer, index) inspect tcode when Integer_8_code, Integer_16_code, Integer_32_code, Integer_64_code, Real_32_code, Real_64_code then Result := True else end end is_pointer_item (index: INTEGER_32): BOOLEAN -- Is item at `index' a POINTER? require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Pointer_code) end is_real_item (index: INTEGER_32): BOOLEAN -- Is item at `index' a REAL_32? require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Real_32_code) end is_reference_item (index: INTEGER_32): BOOLEAN -- Is item at `index' a REFERENCE? require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Reference_code) end is_uniform: BOOLEAN -- Are all items of the same basic type or all of reference type? do Result := is_tuple_uniform (Any_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_boolean: BOOLEAN -- Are all items of type BOOLEAN? do Result := is_tuple_uniform (Boolean_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_character: BOOLEAN -- Are all items of type CHARACTER_8? -- Was declared in TUPLE as synonym of is_uniform_character_8. do Result := is_tuple_uniform (Character_8_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_character_32: BOOLEAN -- Are all items of type CHARACTER_32? -- Was declared in TUPLE as synonym of is_uniform_wide_character. do Result := is_tuple_uniform (Character_32_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_character_8: BOOLEAN -- Are all items of type CHARACTER_8? -- Was declared in TUPLE as synonym of is_uniform_character. do Result := is_tuple_uniform (Character_8_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_double: BOOLEAN -- Are all items of type REAL_64? do Result := is_tuple_uniform (Real_64_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_integer: BOOLEAN -- Are all items of type INTEGER? -- Was declared in TUPLE as synonym of is_uniform_integer_32. do Result := is_tuple_uniform (Integer_32_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_integer_16: BOOLEAN -- Are all items of type INTEGER_16? do Result := is_tuple_uniform (Integer_16_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_integer_32: BOOLEAN -- Are all items of type INTEGER? -- Was declared in TUPLE as synonym of is_uniform_integer. do Result := is_tuple_uniform (Integer_32_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_integer_64: BOOLEAN -- Are all items of type INTEGER_64? do Result := is_tuple_uniform (Integer_64_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_integer_8: BOOLEAN -- Are all items of type INTEGER_8? do Result := is_tuple_uniform (Integer_8_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_natural_16: BOOLEAN -- Are all items of type NATURAL_16? do Result := is_tuple_uniform (Natural_16_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_natural_32: BOOLEAN -- Are all items of type NATURAL_32? do Result := is_tuple_uniform (Natural_32_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_natural_64: BOOLEAN -- Are all items of type NATURAL_64? do Result := is_tuple_uniform (Natural_64_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_natural_8: BOOLEAN -- Are all items of type NATURAL_8? do Result := is_tuple_uniform (Natural_8_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_pointer: BOOLEAN -- Are all items of type POINTER? do Result := is_tuple_uniform (Pointer_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_real: BOOLEAN -- Are all items of type REAL_32? do Result := is_tuple_uniform (Real_32_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_reference: BOOLEAN -- Are all items of reference type? do Result := is_tuple_uniform (Reference_code) ensure yes_if_empty: (count = 0) implies Result end is_uniform_wide_character: BOOLEAN -- Are all items of type CHARACTER_32? -- Was declared in TUPLE as synonym of is_uniform_character_32. do Result := is_tuple_uniform (Character_32_code) ensure yes_if_empty: (count = 0) implies Result end is_wide_character_item (index: INTEGER_32): BOOLEAN -- Is item at `index' a CHARACTER_32? -- Was declared in TUPLE as synonym of is_character_32_item. require valid_index: valid_index (index) do Result := (eif_item_type ($Current.to_pointer, index) = Character_32_code) end invariant -- from ANY reflexive_equality: standard_is_equal (Current) reflexive_conformance: conforms_to (Current) -- from READABLE_INDEXABLE consistent_boundaries: count < Lower implies count = Lower - 1 note copyright: "Copyright (c) 1984-2016, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end -- class TUPLE
Classes Clusters Cluster hierarchy Chart Relations Text Flat Contracts Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com