Data container (internal data structure) is an internal data
structure that enables to save both simple and structured values according
to a key.
The owner of a container is always one running instance of script. It can be shared between various scripts and processes.
Data container may be created by the actions CNT_CREATE (a
spare container), or
GETARCHARR_TO_CNT. The second type is filled by pages containing data
read from archive.
The first access to the archive is more effective (memory consumption and partly speed) than using GETARCHARR action. Data container created by GETARCHARR_TO_CNT action can use only the actions CNT_GETNR, CNT_FIND and CNT_DESTROY (example).
Container has its unique identifier. Container is automatically terminated by terminating
the script, to which it belongs,
or by executing the action CNT_DESTROY.
The size of a container is not specified and is only limited by the operating memory size.
Each value included in container is uniquely determined by so-called key.
User can insert, find, read and delete values into/from container. The type of values to be inserted into container is optional (Int, Bool, Text, Real, Time) or structures (entire structured variable, row, ...). The value type of the key must be one of Int, Bool, Text, Real or Time, but all keys in container must be the same type.
The actions that ensure a work with data container are stated on page Script actions.
Transferring data container between running ESL scripts
A container transfer can be done by RPC procedures. In declaration for RPC
procedure, you have to tag the parameter that represents the handle to
container by CNT_HANDLE. An algorithm is contingent on the existence of data
containers. If handle to data container is an invalid value or it points to
missing data container, the algorithm ends with error.
The value of CNT_HANDLE local variables is integer (INT).
RPC procedure declaration:
- The owner of data container can be only one ESL script, which also ensures the cancelling of data container.
- Data containers can be transferred also between ESL scripts that belong to different processes. In this method, all data that are placed in container are transferred.
- When calling the RPC procedure, if you use the value that is not the handle
on the place for a formal parameter of CNT_HANDLE type, ESL script will search
data container according to an input value.
- If data container, tagged by input value, exists, the script transfers it.
- If data container, tagged by input value, does not exist, the script
an error - container with handle = x not found (there are not any data 22).
- If the input value, representing handle, is invalid, the calling Esl script ends with RunTime error.
- If the calling RPC procedure is asynchronous, the container is terminated in this script. Then ESL script that has been called becomes the owner of this container:
- If the calling RPC procedure is synchronous, there are two options:
- If the formal parameter, which represents CNT_HANDLE, is tagged by the
key word IN,
when calling the RPC procedure, the ESL script containing the declaration of
called RPC procedure will be permanently the owner of data
- If the formal parameter, which represents CNT_HANDLE, is not tagged by the
key word IN, when calling RPC procedure, ESL script containing the declaration
of called RPC procedure will be the temporal owner of data
After finishing the called RPC procedure, the script, from which the RPC procedure
has been called, will become the owner.
- If the formal parameter, which represents CNT_HANDLE, is tagged by the key word IN, when calling the RPC procedure, the ESL script containing the declaration of called RPC procedure will be permanently the owner of data container.