| [comment encoding = UTF-8 /] |
| [comment |
| ----------------------------------------------------------------------- |
| -- Ada infrastructural code generator -- |
| -- for the CHESS component model -- |
| -- -- |
| -- Copyright (C) 2011-2012 -- |
| -- University of Padova, ITALY -- |
| -- -- |
| -- Author: Marco Panunzio panunzio@math.unipd.it -- |
| -- -- |
| -- All rights reserved. This program and the accompanying materials -- |
| -- are made available under the terms of the Eclipse Public License -- |
| -- v1.0 which accompanies this distribution, and is available at -- |
| -- http://www.eclipse.org/legal/epl-v20.html -- |
| ----------------------------------------------------------------------- |
| /] |
| [module Main('http://www.eclipse.org/uml2/3.0.0/UML')] |
| [import org::polarsys::chess::codegen::ada::main::Copyright /] |
| |
| [template public generateMain(model : Model, procNode : InstanceSpecification) |
| { |
| procNodeName : String = procNode.name; |
| chHwProcessorStName : String = 'CHESS::Predictability::DeploymentConfiguration::HardwareBaseline::CH_HwProcessor'; |
| } |
| ] |
| [file (procNodeName.concat('/src/main.adb').toLower(), false, 'UTF-8')] |
| [generateCopyrightAda(model)/] |
| |
| with Ada.Text_IO; |
| with System; |
| with Deployment; |
| with Ada.Synchronous_Task_Control; |
| |
| procedure main is |
| pragma Priority(System.Priority'Last); |
| Suspension : Ada.Synchronous_Task_Control.Suspension_Object; |
| begin |
| |
| --Ada.Text_IO.Put_Line ("System start"); |
| Ada.Text_IO.Put_Line ("Initialize deployment"); |
| Deployment.Initialize; |
| Deployment.Set_RI; |
| [if (not isSingleNodeSystem(InstanceSpecification.allInstances()->asSequence(), chHwProcessorStName))] |
| Deployment.Set_Remote_Msg_Client_Binding; |
| Deployment.Init_Remote_Msg_Client; |
| Deployment.Set_Remote_Msg_Server_Binding; |
| [/if] |
| Ada.Text_IO.Put_Line("Initialization complete"); |
| |
| -- Suspending indefinitely the main suprogram on a suspension object |
| Ada.Synchronous_Task_Control.Set_False(Suspension); |
| Ada.Synchronous_Task_Control.Suspend_Until_True(Suspension); |
| end main; |
| [/file] |
| [/template] |
| |
| [query public isSingleNodeSystem(arg0 : Sequence(OclAny), arg1 : String) : Boolean |
| = invoke('org.polarsys.chess.codegen.ada.service.UML2Service', 'isSingleNodeSystem(java.util.List, java.lang.String)', Sequence{arg0, arg1}) /] |