1------------------------------------------------------------------------------
2--                                                                          --
3--                            Matreshka Project                             --
4--                                                                          --
5--                               Web Framework                              --
6--                                                                          --
7--                              Tools Component                             --
8--                                                                          --
9------------------------------------------------------------------------------
10--                                                                          --
11-- Copyright © 2013, Vadim Godunko <vgodunko@gmail.com>                     --
12-- All rights reserved.                                                     --
13--                                                                          --
14-- Redistribution and use in source and binary forms, with or without       --
15-- modification, are permitted provided that the following conditions       --
16-- are met:                                                                 --
17--                                                                          --
18--  * Redistributions of source code must retain the above copyright        --
19--    notice, this list of conditions and the following disclaimer.         --
20--                                                                          --
21--  * Redistributions in binary form must reproduce the above copyright     --
22--    notice, this list of conditions and the following disclaimer in the   --
23--    documentation and/or other materials provided with the distribution.  --
24--                                                                          --
25--  * Neither the name of the Vadim Godunko, IE nor the names of its        --
26--    contributors may be used to endorse or promote products derived from  --
27--    this software without specific prior written permission.              --
28--                                                                          --
29-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      --
30-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT        --
31-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR    --
32-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT     --
33-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,   --
34-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
35-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR   --
36-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF   --
37-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING     --
38-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS       --
39-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.             --
40--                                                                          --
41------------------------------------------------------------------------------
42--  $Revision: 3983 $ $Date: 2013-07-11 19:49:37 +0400 (Thu, 11 Jul 2013) $
43------------------------------------------------------------------------------
44--  This package provides abstract declaration for MEP representation.
45------------------------------------------------------------------------------
46with Ada.Containers.Hashed_Maps;
47
48with League.Strings;
49
50with WSDL.AST;
51
52package WSDL.MEPs is
53
54   pragma Preelaborate;
55
56   package Interface_Fault_Reference_Maps is
57     new Ada.Containers.Hashed_Maps
58          (WSDL.AST.Qualified_Name,
59           WSDL.AST.Interface_Fault_Reference_Access,
60           WSDL.AST.Hash,
61           WSDL.AST."=",
62           WSDL.AST."=");
63
64   type Message_Placeholder is record
65      Label     : League.Strings.Universal_String;
66      Direction : WSDL.AST.Message_Directions;
67      Message   : WSDL.AST.Interface_Message_Access;
68      --  Interface Message Reference actually mapped to this placeholder.
69      Faults    : Interface_Fault_Reference_Maps.Map;
70      --  Interface Fault References actually associated with this placeholder.
71   end record;
72
73   type Message_Placeholder_Array is
74     array (Positive range <>) of Message_Placeholder;
75
76   type Fault_Propagation_Rules is
77    (Fault_Replaces_Message,
78     Message_Triggers_Fault,
79     No_Faults);
80
81   type MEP (Length : Natural) is limited record
82      IRI                  : League.Strings.Universal_String;
83      Placeholders         : Message_Placeholder_Array (1 .. Length);
84      --  Placeholder messages of the MEP.
85      FPR                  : Fault_Propagation_Rules;
86      --  Fault propagation rule of the MEP.
87
88      Has_In               : Boolean;
89      --  MEP has at least one 'in' placeholder message.
90      Has_Out              : Boolean;
91      --  MEP has at least one 'out' placeholder message.
92      Has_Single_In        : Boolean;
93      --  MEP has only one 'in' placeholder message.
94      Has_Single_Out       : Boolean;
95      --  MEP has only one 'out' placeholder message.
96      Has_In_Fault         : Boolean;
97      --  MEP supports at least one fault in the 'In' direction.
98      Has_Out_Fault        : Boolean;
99      --  MEP supports at least one fault in the 'Out' direction.
100      Has_Single_In_Fault  : Boolean;
101      --  MEP supports only one fault in the 'In' direction.
102      Has_Single_Out_Fault : Boolean;
103      --  MEP supports only one fault in the 'Out' direction.
104   end record;
105
106   type MEP_Access is access all MEP;
107
108end WSDL.MEPs;
109