mirror of
https://github.com/AdaCore/PolyORB.git
synced 2026-02-12 13:01:15 -08:00
79 lines
2.3 KiB
Plaintext
79 lines
2.3 KiB
Plaintext
This example describes GLADE filtering features. It is based on the
|
|
Erathostene algorithm (see other examples). We have three partitions,
|
|
each one includes a RCI unit.
|
|
|
|
P1 : Partition := (prime_1);
|
|
P2 : Partition := (prime_2);
|
|
P3 : Partition := (prime_3);
|
|
|
|
Partition P4 ensures the compilation of filtering packages included in
|
|
this example. You can discard this partition in the following
|
|
explanations.
|
|
|
|
P4 : Partition := (System.Garlic.Filters.Double,
|
|
System.Garlic.Filters.Shift,
|
|
System.Garlic.Filters.Reversing);
|
|
|
|
We declare 2 channels.
|
|
|
|
C1 : Channel := (P1, P2);
|
|
C2 : Channel := (P2, P3);
|
|
|
|
A channel is a pair of partitions. These partitions have to be
|
|
declared before. Some attributes apply on channels (as well as on
|
|
partitions).
|
|
|
|
(1) for Partition'Filter use "double";
|
|
|
|
This indicates to GLADE that as a default rule, filter "double"
|
|
is used between any partition communication.
|
|
|
|
(2) for Channel'Filter use "shift";
|
|
|
|
This indicates to GLADE that as a default rule, filter "shift" is used
|
|
between 2 partitions when they belong to a channel declared in the
|
|
configuration file.
|
|
|
|
(3) for C1'Filter use "zip";
|
|
|
|
This indicates to GLADE that filter "zip" is used between P1 and P2.
|
|
|
|
|
|
As a result, we have the following:
|
|
|
|
|
|
Filter "zip" is used between P1 and P2.
|
|
|
|
Rule (1) applies, but C1 (P1, P2) has been declared. Rule (1) is
|
|
overloaded by rule (2). C1 has a representation clause on
|
|
it. Therefore, rule (2) is overloaded by rule (3).
|
|
|
|
|
|
Filter "shift" is used between P2 and P3.
|
|
|
|
Rule (1) applies, but C2 (P2, P3) has been declared. Rule (1) is
|
|
overloaded by rule (2).
|
|
|
|
|
|
Filter "double" is used between P1 and P3.
|
|
|
|
Rule (1) applies.
|
|
|
|
|
|
At last, we have the following configuration :
|
|
|
|
P1 -- "zip" --> P2 -- "shift" --> P3
|
|
^ |
|
|
+-------------- "double" -------------+
|
|
|
|
|
|
Filter "shift" generates a key which is used to shift each
|
|
message byte. This key is generated dynamically by a partition and has
|
|
to be sent to the partition on the other side. This exchange can also
|
|
be filtered. This filter is called the registration filter. There is
|
|
only one registration filter for the whole configuration. We declare
|
|
filter "reversing" as a registration filter with the following
|
|
statement:
|
|
|
|
pragma Registration_Filter ("reversing");
|