GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
REPOSITORY_LAYOUT
+
Point of view
REPOSITORY_IMPL
ANY
INTERNALS_HANDLER
TYPED_INTERNALS
RECYCLING_POOL
REPOSITORY_IMPL
REPOSITORY_LAYOUT
All features
class REPOSITORY_LAYOUT
Summary
top
Used by the update engine of
REPOSITORY_IMPL
to ensure correct object references and cycles handling.
Direct parents
Insert list:
INTERNALS_HANDLER
,
RECYCLABLE
Class invariant
top
has_kind:
kind
/= Void
reference_dont_have_layouts:
kind
.is_equal("reference") implies
layouts
.is_empty
transient_or_ref:
trans_ref
/= Void implies
ref
= 0
assigned_are_layouts:
assigned
.for_all(
layouts
.has())
Overview
top
Creation features
make
Exported features
type
:
STRING
data type, if useful
capacity
:
INTEGER_32
for native arrays only
ref
:
INTEGER_32
object reference, for reference objects only
trans_ref
:
STRING
object transient reference, for reference objects only
name
:
STRING
object name
value
:
STRING
object value, for basic types only
layouts
:
AVL_DICTIONARY
[REPOSITORY_LAYOUT,
STRING
]
child layouts
assigned
:
HASHED_SET
[
STRING
]
each layout for which the
INTERNALS
object was assigned
solved
:
BOOLEAN
solve
(a_solver:
FUNCTION
[
TUPLE 1
[
INTEGER_32
],
INTERNALS
]):
INTERNALS
kind
:
STRING
The layout kind.
is_clear
:
BOOLEAN
set_kind
(a_kind:
STRING
)
set_type
(a_type:
STRING
)
set_capacity
(a_capacity:
INTEGER_32
)
set_ref
(a_ref:
INTEGER_32
)
set_trans_ref
(a_trans_ref:
STRING
)
set_name
(a_name:
STRING
)
set_value
(a_value:
STRING
)
add_layout
(a_layout: REPOSITORY_LAYOUT)
type
:
STRING
writable attribute
top
data type, if useful
capacity
:
INTEGER_32
writable attribute
top
for native arrays only
ref
:
INTEGER_32
writable attribute
top
object reference, for reference objects only
trans_ref
:
STRING
writable attribute
top
object transient reference, for reference objects only
name
:
STRING
writable attribute
top
object name
value
:
STRING
writable attribute
top
object value, for basic types only
layouts
:
AVL_DICTIONARY
[REPOSITORY_LAYOUT,
STRING
]
writable attribute
top
child layouts
assigned
:
HASHED_SET
[
STRING
]
writable attribute
top
each layout for which the
INTERNALS
object was assigned
solved
:
BOOLEAN
writable attribute
top
solve
(a_solver:
FUNCTION
[
TUPLE 1
[
INTEGER_32
],
INTERNALS
]):
INTERNALS
effective function
top
ensure
Result /= Void and then Result.object_can_be_retrieved implies
solved
kind
:
STRING
writable attribute
top
The layout kind.
Almost everything is common between layout kinds. If things begin to diverge too much, change that to a real polymorphism.
is_clear
:
BOOLEAN
effective function
top
set_kind
(a_kind:
STRING
)
effective procedure
top
require
is_clear
FAST_ARRAY[
STRING
]"repository""reference""layout""embedded""basic""array".has(a_kind)
ensure
not
is_clear
kind
.is_equal(a_kind)
set_type
(a_type:
STRING
)
effective procedure
top
require
not
is_clear
type
= Void
a_type /= Void
ensure
type
.is_equal(a_type)
set_capacity
(a_capacity:
INTEGER_32
)
effective procedure
top
ensure
capacity
= a_capacity
set_ref
(a_ref:
INTEGER_32
)
effective procedure
top
require
not
is_clear
ref
= 0
a_ref > 0
trans_ref
= Void
ensure
ref
= a_ref
set_trans_ref
(a_trans_ref:
STRING
)
effective procedure
top
require
not
is_clear
trans_ref
= Void
a_trans_ref /= Void
ref
= 0
ensure
trans_ref
.is_equal(a_trans_ref)
set_name
(a_name:
STRING
)
effective procedure
top
require
not
is_clear
name
= Void
a_name /= Void
ensure
name
.is_equal(a_name)
set_value
(a_value:
STRING
)
effective procedure
top
require
not
is_clear
value
= Void
a_value /= Void
ensure
value
.is_equal(a_value)
add_layout
(a_layout: REPOSITORY_LAYOUT)
effective procedure
top
require
not
is_clear
a_layout.
name
/= Void
not
kind
.is_equal("reference")
ensure
layouts
.at(a_layout.
name
) = a_layout