1------------------------------------------------------------------------------
2--                                                                          --
3--                            Matreshka Project                             --
4--                                                                          --
5--                          Ada Modeling Framework                          --
6--                                                                          --
7--                        Runtime Library Component                         --
8--                                                                          --
9------------------------------------------------------------------------------
10--                                                                          --
11-- Copyright © 2012, 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: 3421 $ $Date: 2012-11-13 16:34:49 +0400 (Tue, 13 Nov 2012) $
43------------------------------------------------------------------------------
44with AMF.Internals.Factories.Primitive_Types_Factories;
45with AMF.Internals.Factories.Standard_Profile_L2_Factories;
46with AMF.Internals.Factories.Standard_Profile_L3_Factories;
47with AMF.Internals.Factories.UML_Factories;
48with AMF.Internals.Factories.UMLDI_Factories;
49with AMF.Internals.Factories.UML_Module_Factory;
50with AMF.Internals.Tables.Primitive_Types_Metamodel.Links;
51with AMF.Internals.Tables.Primitive_Types_Metamodel.Objects;
52with AMF.Internals.Tables.Primitive_Types_Metamodel.Properties;
53with AMF.Internals.Tables.Standard_Profile_L2_Metamodel.Links;
54with AMF.Internals.Tables.Standard_Profile_L2_Metamodel.Objects;
55with AMF.Internals.Tables.Standard_Profile_L2_Metamodel.Properties;
56with AMF.Internals.Tables.Standard_Profile_L3_Metamodel.Links;
57with AMF.Internals.Tables.Standard_Profile_L3_Metamodel.Objects;
58with AMF.Internals.Tables.Standard_Profile_L3_Metamodel.Properties;
59with AMF.Internals.Tables.UML_Element_Table;
60with AMF.Internals.Tables.UML_Metamodel.Links;
61with AMF.Internals.Tables.UML_Metamodel.Objects;
62with AMF.Internals.Tables.UML_Metamodel.Properties;
63with AMF.Internals.Tables.UMLDI_Metamodel.Links;
64with AMF.Internals.Tables.UMLDI_Metamodel.Objects;
65with AMF.Internals.Tables.UMLDI_Metamodel.Properties;
66
67with AMF.Internals.Modules.CMOF_Module;
68pragma Unreferenced (AMF.Internals.Modules.CMOF_Module);
69pragma Elaborate_All (AMF.Internals.Modules.CMOF_Module);
70--  CMOF module package and all its dependencies must be elaborated before
71--  elaboration of this package.
72
73with AMF.Internals.Modules.DD_Module;
74pragma Unreferenced (AMF.Internals.Modules.DD_Module);
75pragma Elaborate_All (AMF.Internals.Modules.DD_Module);
76--  CMOF module package and all its dependencies must be elaborated before
77--  elaboration of this package.
78
79package body AMF.Internals.Modules.UML_Module is
80
81   --  Global objects of factories for supported metamodels.
82
83   UML_Module_Factory :
84     aliased AMF.Internals.Factories.UML_Module_Factory.UML_Module_Factory;
85   Module             : AMF_Metamodel;
86
87begin
88   --  Register module's factory.
89
90   AMF.Internals.Factories.Register (UML_Module_Factory'Access, Module);
91
92   --  Initialize metamodels.
93
94   AMF.Internals.Tables.Primitive_Types_Metamodel.Objects.Initialize;
95   AMF.Internals.Tables.Standard_Profile_L2_Metamodel.Objects.Initialize;
96   AMF.Internals.Tables.Standard_Profile_L3_Metamodel.Objects.Initialize;
97   AMF.Internals.Tables.UML_Metamodel.Objects.Initialize;
98   AMF.Internals.Tables.UMLDI_Metamodel.Objects.Initialize;
99
100   AMF.Internals.Tables.Primitive_Types_Metamodel.Properties.Initialize;
101   AMF.Internals.Tables.Standard_Profile_L2_Metamodel.Properties.Initialize;
102   AMF.Internals.Tables.Standard_Profile_L3_Metamodel.Properties.Initialize;
103   AMF.Internals.Tables.UML_Metamodel.Properties.Initialize;
104   AMF.Internals.Tables.UMLDI_Metamodel.Properties.Initialize;
105
106   AMF.Internals.Tables.Primitive_Types_Metamodel.Links.Initialize;
107   AMF.Internals.Tables.Standard_Profile_L2_Metamodel.Links.Initialize;
108   AMF.Internals.Tables.Standard_Profile_L3_Metamodel.Links.Initialize;
109   AMF.Internals.Tables.UML_Metamodel.Links.Initialize;
110   AMF.Internals.Tables.UMLDI_Metamodel.Links.Initialize;
111
112   --  Initialize element table of UML module.
113
114   AMF.Internals.Tables.UML_Element_Table.Initialize (Module);
115
116   --  Register factories.
117
118   AMF.Internals.Factories.Register
119    (AMF.Internals.Factories.Primitive_Types_Factories.Get_Package,
120     AMF.Internals.Factories.Primitive_Types_Factories.Constructor'Access);
121   AMF.Internals.Factories.Register
122    (AMF.Internals.Factories.UML_Factories.Get_Package,
123     AMF.Internals.Factories.UML_Factories.Constructor'Access);
124   AMF.Internals.Factories.Register
125    (AMF.Internals.Factories.Standard_Profile_L2_Factories.Get_Package,
126     AMF.Internals.Factories.Standard_Profile_L2_Factories.Constructor'Access);
127   AMF.Internals.Factories.Register
128    (AMF.Internals.Factories.Standard_Profile_L3_Factories.Get_Package,
129     AMF.Internals.Factories.Standard_Profile_L3_Factories.Constructor'Access);
130   AMF.Internals.Factories.Register
131    (AMF.Internals.Factories.UMLDI_Factories.Get_Package,
132     AMF.Internals.Factories.UMLDI_Factories.Constructor'Access);
133end AMF.Internals.Modules.UML_Module;
134