+
Point of view
All features
class TYPEDEFS
Summary
A dictionary of C_TYPEDEFs accessible by their names The contained typedefs will be wrapped together as dummy queries into a deferred class When the wrappers generator command is invoked with the proper flag ("--standard-typedefs" ) it will also emit the queries for C types that have different sizes on different architectures and for the type definition of C99 standard. Each query is named like a C typedef and its Result type is the Eiffel equivalent of the fundamental type the typedef refers to. For example: gsize: INTEGER_64
   -- typedef unsigned long int gsize;
do
end
Those queries shall never be invoked but rather used in other
features as anchors like: do_stuff (a_size: like gsize)
Direct parents
Inherit list: LINKED_LIST
Insert list: SHARED_COLLECTIONS, SHARED_SETTINGS
Class invariant
Overview
Creation features
{ANY}
Features
{ANY}
Actual size queries
{}
{}
{}
{LINKED_LIST, ITERATOR_ON_LINKED_LIST}
  • first_link: LINKED_LIST_NODE[E_]
    Void when empty or gives access to the first element.
{LINKED_LIST}
{ANY}
{}
Accessing:
{ANY}
Writing:
{ANY}
Adding:
{ANY}
Removing:
{ANY}
Looking and Searching:
{ANY}
Looking and comparison:
{ANY}
Other features:
{ANY}
Implement manifest generic creation:
{}
{ANY}
Other features:
{ANY}
Agent-based features:
{ANY}
Printing:
{ANY}
{ANY}
{}
Agent-based features:
{ANY}
{}
Indexing:
{ANY}
Looking and Searching:
{ANY}
Implement manifest generic creation:
{}
{ANY}
Plugin
{ANY}
Syntactic sugar
{ANY}
Type mangling
{}
Auxiliary features
{}
Constants
{}
{}
{}
Buffers Temporary buffers used to build enumerations and structures external classes
{}
writable attribute
{ANY}
emit_wrappers
effective procedure
{ANY}
emit_variable_sized_typedefs
effective procedure
{ANY}
Emit dummy queries useful for anchored declarations (i.e. "like long") for C types that can have different sizes on different architectures.
emit_standard_typedefs
effective procedure
{ANY}
long_int_size: INTEGER_32
{}
long_unsigned_int_size: INTEGER_32
{}
size_t_size: INTEGER_32
{}
ssize_t_size: INTEGER_32
{}
ptrdiff_t_size: INTEGER_32
{}
int8_t_size: INTEGER_32
{}
uint8_t_size: INTEGER_32
{}
int16_t_size: INTEGER_32
{}
uint16_t_size: INTEGER_32
{}
int32_t_size: INTEGER_32
{}
uint32_t_size: INTEGER_32
{}
int64_t_size: INTEGER_32
{}
uint64_t_size: INTEGER_32
{}
intptr_t_size: INTEGER_32
{}
uintptr_t_size: INTEGER_32
{}
int_least8_t_size: INTEGER_32
{}
uint_least8_t_size: INTEGER_32
{}
int_least16_t_size: INTEGER_32
{}
uint_least16_t_size: INTEGER_32
{}
int_least32_t_size: INTEGER_32
{}
uint_least32_t_size: INTEGER_32
{}
int_least64_t_size: INTEGER_32
{}
uint_least64_t_size: INTEGER_32
{}
int_fast8_t_size: INTEGER_32
{}
uint_fast8_t_size: INTEGER_32
{}
int_fast16_t_size: INTEGER_32
{}
uint_fast16_t_size: INTEGER_32
{}
int_fast32_t_size: INTEGER_32
{}
uint_fast32_t_size: INTEGER_32
{}
int_fast64_t_size: INTEGER_32
{}
uint_fast64_t_size: INTEGER_32
{}
intmax_t_size: INTEGER_32
{}
uintmax_t_size: INTEGER_32
{}
_inline_agent4 (a_typedef: C_TYPEDEF)
frozen
effective procedure
{}
default_create
effective procedure
{}
Default creation method.
It is used when no creation method is specified if allowed. Note it may be renamed.
first_link: LINKED_LIST_NODE[E_]
writable attribute
Void when empty or gives access to the first element.
last_link: LINKED_LIST_NODE[E_]
writable attribute
Void when empty or gives access to the last element.
mem_idx: INTEGER_32
writable attribute
mem_lnk: LINKED_LIST_NODE[E_]
writable attribute
To speed up accessing, mem_idx and mem_lnk is the memory of the last access done.
For example, after item(1), mem_idx is 1 and mem_lnk is first_link. When list is empty, first_link is Void as well as mem_lnk and mem_idx is 0
make
effective procedure
{ANY}
Make an empty list
ensure
is_empty: BOOLEAN
effective function
{ANY}
Is the hoard empty ?
See also count.
ensure
  • definition: Result = count = 0
add_first (element: E_)
effective procedure
{ANY}
Add a new item in first position : count is increased by one and all other items are shifted right.
See also add_last, first, last, add.
ensure
  • first = element
  • count = 1 + old count
  • lower = old lower
  • upper = 1 + old upper
add_last (element: E_)
effective procedure
{ANY}
Add a new item at the end : count is increased by one.
See also add_first, last, first, add.
ensure
  • last = element
  • count = 1 + old count
  • lower = old lower
  • upper = 1 + old upper
add (element: E_, index: INTEGER_32)
effective procedure
{ANY}
Add a new element at rank index : count is increased by one and range [index .. upper] is shifted right by one position.
require
    • index.in_range(lower, upper + 1)
    • index.in_range(lower, upper + 1)
ensure
  • item(index) = element
  • count = 1 + old count
  • upper = 1 + old upper
remove_first
effective procedure
{ANY}
Remove the first element of the collection.
require
    • not is_empty
    • not is_empty
ensure
  • count = old count - 1
  • lower = old lower + 1 xor upper = old upper - 1
remove (index: INTEGER_32)
effective procedure
{ANY}
Remove the item at position index.
Followings items are shifted left by one position.
See also remove_first, remove_head, remove_tail, remove_last.
require
    • valid_index(index)
    • valid_index(index)
ensure
  • count = old count - 1
  • upper = old upper - 1
first: E_
effective function
{ANY}
The very first item.
See also last, item.
require
      • not is_empty
      • not is_empty
      • not is_empty
      • not is_empty
ensure
  • definition: Result = item(lower)
last: E_
effective function
{ANY}
The last item.
See also first, item.
require
      • not is_empty
      • not is_empty
      • not is_empty
      • not is_empty
ensure
  • definition: Result = item(upper)
item (index: INTEGER_32): E_
effective function
{ANY}
Item at the corresponding index i.
See also lower, upper, valid_index.
require
      • valid_index(index)
      • valid_index(index)
      • valid_index(index)
      • valid_index(index)
put (element: E_, index: INTEGER_32)
effective procedure
{ANY}
Make element the item at index i.
require
    • valid_index(index)
    • valid_index(index)
ensure
  • item(index) = element
  • count = old count
count: INTEGER_32
effective function
{ANY}
Number of available items in the hoard.
See also is_empty
ensure
  • Result >= 0
set_all_with (v: E_)
effective procedure
{ANY}
Set all items with value v.
See also set_slice_with.
ensure
  • count = old count
copy (other: TYPEDEFS)
effective procedure
{ANY}
Reinitialize by copying all the items of other.
require
      • not immutable
      • same_dynamic_type(other)
        • not immutable
        • same_dynamic_type(other)
        • not immutable
        • same_dynamic_type(other)
      • not immutable
      • same_dynamic_type(other)
        • not immutable
        • same_dynamic_type(other)
        • not immutable
        • same_dynamic_type(other)
ensure
  • is_equal(other)
fast_is_equal (other: TYPEDEFS): BOOLEAN
effective function
{ANY}
Do both collections have the same lower, upper, and items?
The basic = is used for comparison of items.
See also is_equal, same_items.
ensure
  • Result implies lower = other.lower and upper = other.upper
is_equal (other: TYPEDEFS): BOOLEAN
effective function
{ANY}
Do both collections have the same lower, upper, and items?
Feature is_equal is used for comparison of items.
See also fast_is_equal, same_items.
require
      • other /= Void
        • other /= Void
        • other /= Void
      • other /= Void
        • other /= Void
        • other /= Void
ensure
  • Result implies lower = other.lower and upper = other.upper
  • commutative: generating_type = other.generating_type implies Result = other.is_equal(Current)
index_of (x: E_, start_index: INTEGER_32): INTEGER_32
effective function
{ANY}
Using is_equal for comparison, gives the index of the first occurrence of element at or after start_index.
Return upper + 1 if the search for element failed.
See also fast_index_of, reverse_index_of, first_index_of.
ensure
  • Result.in_range(start_index, upper + 1)
  • valid_index(Result) implies (create {SAFE_EQUAL}).test(x, item(Result))
reverse_index_of (element: E_, start_index: INTEGER_32): INTEGER_32
effective function
{ANY}
Using is_equal for comparison, gives the index of the first occurrence of element at or before start_index.
Search is done in reverse direction, which means from the start_index down to the lower index . Answer lower -1 when the search fail.
See also fast_reverse_index_of, last_index_of, index_of.
require
    • valid_index(start_index)
    • valid_index(start_index)
ensure
  • Result.in_range(lower - 1, start_index)
  • valid_index(Result) implies item(Result).is_equal(element)
fast_index_of (x: E_, start_index: INTEGER_32): INTEGER_32
effective function
{ANY}
Using basic = for comparison, gives the index of the first occurrence of element at or after start_index.
Answer upper + 1 when element when the search fail.
See also index_of, fast_reverse_index_of, fast_first_index_of.
ensure
  • Result.in_range(start_index, upper + 1)
  • valid_index(Result) implies x = item(Result)
fast_reverse_index_of (element: E_, start_index: INTEGER_32): INTEGER_32
effective function
{ANY}
Using basic = comparison, gives the index of the first occurrence of element at or before start_index.
Search is done in reverse direction, which means from the start_index down to the lower index . Answer lower -1 when the search fail.
See also reverse_index_of, fast_index_of, fast_last_index_of.
require
    • valid_index(start_index)
    • valid_index(start_index)
ensure
  • Result.in_range(lower - 1, start_index)
  • valid_index(Result) implies item(Result) = element
clear_count
effective procedure
{ANY}
Discard all items (is_empty is True after that call).
If possible, the actual implementation supposed to keep its internal storage area in order to refill Current in an efficient way.
See also clear_count_and_capacity.
ensure
  • upper = 0
  • is_empty: count = 0
clear_count_and_capacity
effective procedure
{ANY}
Discard all items (is_empty is True after that call).
If possible, the actual implementation supposed to release its internal storage area for this memory to be used by other objects.
See also clear_count.
ensure
  • upper = 0
  • is_empty: count = 0
from_collection (model: TRAVERSABLE[E_])
effective procedure
{ANY}
Initialize the current object with the contents of model.
require
    • model /= Void
    • useful_work: model /= Current
    • model /= Void
    • useful_work: model /= Current
ensure
  • count = model.count
slice (low: INTEGER_32, up: INTEGER_32): TYPEDEFS
effective function
{ANY}
New collection consisting of items at indexes in [min..max].
Result has the same dynamic type as Current. The lower index of the Result is the same as lower.
See also from_collection, move, replace_all.
require
    • lower <= low
    • up <= upper
    • low <= up + 1
    • lower <= low
    • up <= upper
    • low <= up + 1
ensure
  • same_dynamic_type(Result)
  • Result.count = up - low + 1
  • Result.lower = lower
occurrences (element: E_): INTEGER_32
effective function
{ANY}
Number of occurrences of element using is_equal for comparison.
ensure
  • Result >= 0
fast_occurrences (element: E_): INTEGER_32
effective function
{ANY}
Number of occurrences of element using basic = for comparison.
See also occurrences, index_of.
ensure
  • Result >= 0
force (element: E_, index: INTEGER_32)
effective procedure
{ANY}
Make element the item at index, enlarging the collection if necessary (new bounds except index are initialized with default values).
See also put, item, swap.
require
    • index >= lower
    • index >= lower
ensure
  • upper = index.max(old upper)
  • item(index) = element
all_default: BOOLEAN
effective function
{ANY}
Do all items have their type's default value?
Note: for non Void items, the test is performed with the is_default predicate.
See also clear_all.
remove_last
effective procedure
{ANY}
Remove the last item.
require
    • not is_empty
    • not is_empty
ensure
  • count = old count - 1
  • upper = old upper - 1
replace_all (old_value: E_, new_value: E_)
effective procedure
{ANY}
Replace all occurrences of the element old_value by new_value using is_equal for comparison.
See also fast_replace_all, move.
ensure
  • count = old count
  • not (create {SAFE_EQUAL}).test(old_value, new_value) implies occurrences(old_value) = 0
fast_replace_all (old_value: E_, new_value: E_)
effective procedure
{ANY}
Replace all occurrences of the element old_value by new_value using basic = for comparison.
See also replace_all, move.
ensure
  • count = old count
  • old_value /= new_value implies fast_occurrences(old_value) = 0
new_iterator: ITERATOR[E_]
effective function
{ANY}
ensure
  • Result /= Void
  • Result.generation = generation
reverse
effective procedure
{ANY}
Reverse the order of the elements.
ensure
  • count = old count
go_item (i: INTEGER_32)
effective procedure
{}
require ensure
free_nodes: WEAK_REFERENCE[LINKED_LIST_NODE[E_]]
writable attribute
{}
If any, they are ready to be recycled.
once function
{}
dispose_node (node: LINKED_LIST_NODE[E_]): LINKED_LIST_NODE[E_]
effective function
{}
Add node in the free_nodes list.
require
  • node /= Void
ensure
  • Result = old node.next
new_node (e: E_, next: LINKED_LIST_NODE[E_]): LINKED_LIST_NODE[E_]
effective function
{}
Recycle from free_nodes or create a new one.
infix "@" (i: INTEGER_32): E_
frozen
effective function
{ANY}
The infix notation which is actually just a synonym for item.
See also item.
require ensure
  • definition: Result = item(i)
swap (i1: INTEGER_32, i2: INTEGER_32)
effective procedure
{ANY}
Swap item at index i1 with item at index i2.
See also item, put.
require ensure
set_slice_with (v: ANY, lower_index: INTEGER_32, upper_index: INTEGER_32)
effective procedure
{ANY}
Set all items in range [lower_index .. upper_index] with v.
See also set_all_with.
require ensure
clear_all
effective procedure
{ANY}
Set every item to its default value.
The count is not affected.
See also clear, all_default.
ensure
append_collection (other: COLLECTION[E_])
effective procedure
{ANY}
Append other to Current.
This feature is obsolete: Use `append_traversable' instead.
append_traversable (other: TRAVERSABLE[E_])
effective procedure
{ANY}
Append other to Current.
See also add_last, add_first, add.
require
  • other /= Void
ensure
remove_head (n: INTEGER_32)
deferred procedure
{ANY}
Remove the n elements of the collection.
require ensure
remove_tail (n: INTEGER_32)
deferred procedure
{ANY}
Remove the last n item(s).
require ensure
has (x: ANY): BOOLEAN
effective function
{ANY}
Look for x using is_equal for comparison.
ensure
  • definition: Result = valid_index(first_index_of(x))
fast_has (x: ANY): BOOLEAN
effective function
{ANY}
Look for x using basic = for comparison.
See also has, fast_index_of, index_of.
ensure
  • definition: Result = valid_index(fast_first_index_of(x))
last_index_of (element: ANY): INTEGER_32
effective function
{ANY}
Using is_equal for comparison, gives the index of the last occurrence of element at or before upper.
Search is done in reverse direction, which means from the upper down to the lower index . Answer lower -1 when the search fail.
See also fast_last_index_of, reverse_index_of, index_of.
ensure
  • definition: Result = reverse_index_of(element, upper)
fast_last_index_of (element: ANY): INTEGER_32
effective function
{ANY}
Using basic = for comparison, gives the index of the last occurrence of element at or before upper.
Search is done in reverse direction, which means from the upper down to the lower index . Answer lower -1 when the search fail.
See also fast_reverse_index_of, last_index_of.
ensure
  • definition: Result = fast_reverse_index_of(element, upper)
is_equal_map (other: TYPEDEFS): BOOLEAN
effective function
{ANY}
Do both collections have the same lower, upper, and items?
This feature is obsolete: Use `is_equal' instead.
same_items (other: COLLECTION[E_]): BOOLEAN
effective function
{ANY}
Do both collections have the same items?
The basic = is used for comparison of items and indices are not considered (for example this routine may yield True with Current indexed in range [1..2] and other indexed in range [2..3]).
See also is_equal, fast_is_equal.
require
  • other /= Void
ensure
move (lower_index: INTEGER_32, upper_index: INTEGER_32, distance: INTEGER_32)
effective procedure
{ANY}
Move range lower_index ..
upper_index by distance positions. Negative distance moves towards lower indices. Free places get default values.
See also slice, replace_all.
require ensure
manifest_semicolon_check: BOOLEAN
is False
constant attribute
{}
manifest_put (index: INTEGER_32, element: ANY)
deferred procedure
{}
require
  • index >= 0
enumerate: ENUMERATE[E_]
effective function
{ANY}
get_new_iterator: ITERATOR[E_]
frozen
effective function
{ANY}
This feature is obsolete: Use `new_iterator' instead. This historical SmartEiffel feature is badly named.
for_each (action: PROCEDURE[TUPLE[TUPLE 1[E_]]])
effective procedure
{ANY}
Apply action to every item of Current.
See also for_all, exists, aggregate.
require
  • action /= Void
for_all (test: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
{ANY}
Do all items satisfy test?
See also for_each, exists, aggregate.
require
  • test /= Void
exists (test: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
{ANY}
Does at least one item satisfy test?
See also for_each, for_all, aggregate.
require
  • test /= Void
aggregate (action: FUNCTION[TUPLE[TUPLE 2[E_, E_], E_]], initial: E_): E_
effective function
{ANY}
Aggregate all the elements starting from the initial value.
See also for_each, for_all, exists.
require
  • action /= Void
out_in_tagged_out_memory
effective procedure
{ANY}
Append terse printable representation of current object in tagged_out_memory.
require
  • locked: tagged_out_locked
ensure
  • still_locked: tagged_out_locked
  • not_cleared: tagged_out_memory.count >= old tagged_out_memory.count
  • append_only: old tagged_out_memory.twin.is_equal(tagged_out_memory.substring(1, old tagged_out_memory.count))
generation: INTEGER_32
writable attribute
{ANY}
next_generation
effective procedure
{}
ensure
do_all (action: ROUTINE[TUPLE[TUPLE 1[E_]]])
frozen
effective procedure
{ANY}
Apply action to every item of Current.
This feature is obsolete: Use `for_each` instead. This feature is not secure because it accepts a FUNCTION, the result of which is lost.
_inline_agent2 (a: ROUTINE[TUPLE[TUPLE 1[E_]]], e: E_)
frozen
effective procedure
{}
lower: INTEGER_32
deferred function
{ANY}
Minimum index.
See also upper, valid_index, item.
upper: INTEGER_32
deferred function
{ANY}
Maximum index.
See also lower, valid_index, item.
valid_index (i: INTEGER_32): BOOLEAN
effective function
{ANY}
True when i is valid (i.e., inside actual bounds).
See also lower, upper, item.
ensure
first_index_of (element: ANY): INTEGER_32
deferred function
{ANY}
Give the index of the first occurrence of element using is_equal for comparison.
Answer upper + 1 when element is not inside.
See also fast_first_index_of, index_of, last_index_of, reverse_index_of.
ensure
fast_first_index_of (element: ANY): INTEGER_32
deferred function
{ANY}
Give the index of the first occurrence of element using basic = for comparison.
Answer upper + 1 when element is not inside.
See also first_index_of, last_index_of, fast_last_index_of.
ensure
manifest_make (needed_capacity: INTEGER_32)
effective procedure
{}
Manifest creation of a list of items of type E_.
settings: SETTINGS
once function
{ANY}
The singleton to access all the shared settings
directory: STRING
effective function
{ANY}
Shortcut for settings.directory
include: TEXT_FILE_WRITE
once function
{ANY}
once function
{ANY}
verbose: BOOLEAN
effective function
{ANY}
global: BOOLEAN
effective function
{ANY}
dequalify (an_id: UNICODE_STRING): UNICODE_STRING
effective function
{}
an_id without the type qualifier used by GccXml to mark the identification labels.
"const", "reference" and "volatile" qualifier are represented in a CvQualifiedType node adding 'c', 'r' and 'v' to the identifies. i.e. if "int" has id "_422" a "const int foo" argument type will be of type CvQualifiedType with it "_422c". The same rule is used - as far as I know - also for reference and volatile types. Result is identical to an_id if it does not end with 'c', 'r' and 'v'; otherwise it is a copy of an_id with the last character ('c', 'r' or 'v') removed.
require
  • not_void: an_id /= Void
log (a_string: ABSTRACT_STRING)
effective procedure
{}
buffer: FORMATTER
once function
{}
Buffer to render the text of the feature currently being wrapped (a function call, a structure or an enumeration).
formatter: FORMATTER
once function
{}
Shared formatter used to format various strings.
comment: STRING
is " -- "
constant attribute
{}
variadic_function_note: STRING
is " (variadic call) "
constant attribute
{}
unwrappable_function_note: STRING
is " -- Unwrappable function obsolete "Unwrappable C function" "
constant attribute
{}
expanded_class: STRING
is "expanded class "
constant attribute
{}
deferred_class: STRING
is "deferred class "
constant attribute
{}
inherits_string: STRING
is " insert ANY undefine is_equal, copy end "
constant attribute
{}
queries_header: STRING
is "feature {} -- Low-level queries "
constant attribute
{}
setters_header: STRING
is "feature {} -- Low-level setters "
constant attribute
{}
externals_header: STRING
is "feature {} -- External calls "
constant attribute
{}
typedefs_features_header: STRING
is "feature {WRAPPER_HANDLER} -- C type definitions (typedefs) "
constant attribute
{}
footer: STRING
is "end "
constant attribute
{}
automatically_generated_header: STRING
is "-- This file has been created by wrappers_generator. -- Any change will be lost by the next execution of the tool. "
constant attribute
{}
automatically_generated_c_file: STRING
is "/* ** This file has been created by wrappers_generator. ** Any change will be lost by the next execution of the tool. */ "
constant attribute
{}
automatically_patched_header: STRING
is "-- Th file has been automatically created combining the output file -- of wrappers_generator #(1) -- with the differences patches found into #(2) -- Any change will be lost by the next execution of the tool. "
constant attribute
{}
once function
{}
once function
{}
once function
{}
functions: LINKED_LIST[C_FUNCTION]
once function
{}
once function
{}
once function
{}
typedefs: TYPEDEFS
once function
{}
once function
{}
perhaps its a dictionary of WRAPPER_FEATURE or WRAPPABLE_NODE
variables: LINKED_LIST[C_VARIABLE]
once function
{}
once function
{}
flag_enums: WORDS
once function
{}
Enumerations that will be forcefully wrapped as a flag.
avoided_symbols: WORDS
once function
{}
Symbols that will not be wrapped.
queries: FORMATTER
once function
{}
setters: FORMATTER
once function
{}
low_level_values: FORMATTER
once function
{}
validity_query: FORMATTER
once function
{}