home
wiki
classes/clusters list
class information
+
Point of view
ANY
ANY
All features
class XML_FILE_REPOSITORY [O_ ->
STORABLE
]
Summary
top
To be used with a file that contains the repository (and only that)
Direct parents
inherit list:
XML_REPOSITORY_IMPL
Overview
top
creation features
connect_to
(a_filename:
STRING
)
Connect to a repository with streams as physical store.
exported features
Updating and committing
commit
Commit all the repository objects to the physical store.
is_commitable
:
BOOLEAN
True if the repository can be committed to the underlying physical store.
update
Update the repository objects.
is_updateable
:
BOOLEAN
True if the repository can be updated from data in the physical store.
is_connected
:
BOOLEAN
True if the repository is connected to a physical store.
Creation
connect_to
(a_filename:
STRING
)
Connect to a repository with streams as physical store.
filename
:
STRING
update_stream
:
TEXT_FILE_READ
commit_stream
:
TEXT_FILE_WRITE
commitable_tester
:
TEXT_FILE_WRITE
Error handling on repository update
register_update_error_handler
(a_error_handler:
PROCEDURE
[
TUPLE 3
[
INTEGER_32
,
INTEGER_32
,
STRING
]])
Getting and setting objects in the repository:
has
(object_name:
STRING
):
BOOLEAN
Is
object_name
the name of some stored object.
at
(object_name:
STRING
): O_
Return the object currently associated to
object_name
.
add
(object: O_, object_name:
STRING
)
Update or add a new
object
in the
Current
repository.
put
(object: O_, object_name:
STRING
)
Update or add a new
object
in the
Current
repository.
remove
(object_name:
STRING
)
Remove entry
object_name
from the
Current
repository.
Counting:
count
:
INTEGER_32
Actual
count
of stored elements.
is_empty
:
BOOLEAN
Is it empty ?
Iterating facilities:
lower
:
INTEGER_32
upper
:
INTEGER_32
valid_index
(index:
INTEGER_32
):
BOOLEAN
item
(index:
INTEGER_32
): O_
key
(index:
INTEGER_32
):
STRING
get_new_iterator_on_items
:
ITERATOR
[O_]
get_new_iterator_on_keys
:
ITERATOR
[
STRING
]
key_map_in
(buffer:
COLLECTION
[
STRING
])
Append in
buffer
, all available keys (this may be useful to speed up the traversal).
item_map_in
(buffer:
COLLECTION
[O_])
Append in
buffer
, all available items (this may be useful to speed up the traversal).
commit
effective procedure
top
Commit all the repository objects to the physical store.
require
is_commitable
is_commitable
:
BOOLEAN
effective function
top
True if the repository can be committed to the underlying physical store.
ensure
Result implies is_connected
update
effective procedure
top
Update the repository objects.
Get all objects from the physical store.
require
is_updateable
is_updateable
:
BOOLEAN
effective function
top
True if the repository can be updated from data in the physical store.
ensure
Result implies is_connected
is_connected
:
BOOLEAN
effective function
top
True if the repository is connected to a physical store.
connect_to
(a_filename:
STRING
)
effective procedure
top
Connect to a repository with streams as physical store.
filename
:
STRING
writable attribute
top
update_stream
:
TEXT_FILE_READ
writable attribute
top
commit_stream
:
TEXT_FILE_WRITE
writable attribute
top
commitable_tester
:
TEXT_FILE_WRITE
once function
top
register_update_error_handler
(a_error_handler:
PROCEDURE
[
TUPLE 3
[
INTEGER_32
,
INTEGER_32
,
STRING
]])
effective procedure
top
has
(object_name:
STRING
):
BOOLEAN
frozen
effective function
top
Is
object_name
the name of some stored object.
require
not object_name.is_empty
at
(object_name:
STRING
): O_
frozen
effective function
top
Return the object currently associated to
object_name
.
require
has
(object_name)
ensure
Result /= Void
add
(object: O_, object_name:
STRING
)
frozen
effective procedure
top
Update or add a new
object
in the
Current
repository.
require
object /= Void
new_reference:
not
has
(object_name)
ensure
reference_stored:
object =
at
(object_name)
put
(object: O_, object_name:
STRING
)
frozen
effective procedure
top
Update or add a new
object
in the
Current
repository.
require
object /= Void
ensure
reference_stored:
object =
at
(object_name)
remove
(object_name:
STRING
)
effective procedure
top
Remove entry
object_name
from the
Current
repository.
require
has
(object_name)
ensure
not
has
(object_name)
count
:
INTEGER_32
effective function
top
Actual
count
of stored elements.
is_empty
:
BOOLEAN
effective function
top
Is it empty ?
ensure
Result =
count
= 0
lower
:
INTEGER_32
constant attribute
top
upper
:
INTEGER_32
effective function
top
ensure
Result =
count
valid_index
(index:
INTEGER_32
):
BOOLEAN
effective function
top
ensure
Result = index.in_range(
lower
,
upper
)
item
(index:
INTEGER_32
): O_
effective function
top
require
valid_index
(index)
ensure
Result =
at
(
key
(index))
key
(index:
INTEGER_32
):
STRING
effective function
top
require
valid_index
(index)
ensure
at
(Result) =
item
(index)
get_new_iterator_on_items
:
ITERATOR
[O_]
effective function
top
ensure
Result /= Void
get_new_iterator_on_keys
:
ITERATOR
[
STRING
]
effective function
top
ensure
Result /= Void
key_map_in
(buffer:
COLLECTION
[
STRING
])
effective procedure
top
Append in
buffer
, all available keys (this may be useful to speed up the traversal).
require
buffer /= Void
ensure
buffer.count =
count
+ old buffer.count
item_map_in
(buffer:
COLLECTION
[O_])
effective procedure
top
Append in
buffer
, all available items (this may be useful to speed up the traversal).
require
buffer /= Void
ensure
buffer.count =
count
+ old buffer.count