--------------------------------------------------------
--  This file was automatically generated by Ocarina  --
--  Do NOT hand-modify this file, as your             --
--  changes will be lost when you re-run Ocarina      --
--------------------------------------------------------
pragma Style_Checks
 ("NM32766");

with PolyORB_HI_Generated.Types;
with PolyORB_HI.Errors;
with PolyORB_HI_Generated.Deployment;
with Ada.Real_Time;
with System;
with PolyORB_HI.Periodic_Task;
pragma Elaborate_All (PolyORB_HI.Periodic_Task);

package PolyORB_HI_Generated.Activity
  with Abstract_State => ((Elaborated_Variables with Synchronous, External),
                          UQ_S),
  Initializes => (Elaborated_Variables, UQ_S)

is

  --  BEGIN: Entities used by all instances of component P.Impl

  type Software_P_Impl_Port_Type is
   (Data_Source);

  type Software_P_Impl_Interface
   (Port : Software_P_Impl_Port_Type := Software_P_Impl_Port_Type'First)
  is
    record
      case Port is
        when Data_Source =>
          Data_Source_DATA : PolyORB_HI_Generated.Types.Alpha_Type;
        pragma Warnings (Off);
        when others =>
          null;
        pragma Warnings (On);
      end case;
    end record;

  procedure Send_Output
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_P_Impl_Port_Type;
    Result : out PolyORB_HI.Errors.Error_Kind);

  procedure Put_Value
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Thread_Interface : Software_P_Impl_Interface);

  procedure Receive_Input
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_P_Impl_Port_Type);

  procedure Get_Value
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_P_Impl_Port_Type;
    Result : out Software_P_Impl_Interface)
    with Global => (In_Out => (Elaborated_Variables), Input => UQ_S);

  procedure Get_Sender
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_P_Impl_Port_Type;
    Result : out PolyORB_HI_Generated.Deployment.Entity_Type)
    with Global => (In_Out => (Elaborated_Variables), Input => UQ_S);

  procedure Get_Count
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_P_Impl_Port_Type;
    Result : out Standard.Integer)
    with Global => (In_Out => (Elaborated_Variables), Input => UQ_S);

  procedure Get_Time_Stamp
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_P_Impl_Port_Type;
    Result : out Ada.Real_Time.Time)
    with Global => (In_Out => Elaborated_Variables);

  procedure Next_Value
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_P_Impl_Port_Type)
    with Global => (In_Out => (Elaborated_Variables, UQ_S));

  procedure Store_Received_Message
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Thread_Interface : Software_P_Impl_Interface;
    From : PolyORB_HI_Generated.Deployment.Entity_Type;
    Time_Stamp : Ada.Real_Time.Time :=
      Ada.Real_Time.Clock);

  procedure Wait_For_Incoming_Events
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : out Software_P_Impl_Port_Type);

  --  END: Entities used by all instances of component P.Impl

  --  Periodic task : Producer

  procedure Producer_Consumer_Producer_Job (Result : out PolyORB_HI.Errors.Error_Kind);

  package Producer_Consumer_Producer_Task is
   new PolyORB_HI.Periodic_Task
     (Entity => PolyORB_HI_Generated.Deployment.pr_A_Producer_K,
      Task_Period => Ada.Real_Time.Milliseconds
       (200),
      Task_Deadline => Ada.Real_Time.Milliseconds
       (200),
      Task_Priority => System.Default_Priority,
      Task_Stack_Size => 100000,
      Job => Producer_Consumer_Producer_Job);

  --  BEGIN: Entities used by all instances of component Q.Impl

  type Software_Q_Impl_Port_Type is
   (Data_Sink);

  type Software_Q_Impl_Interface
   (Port : Software_Q_Impl_Port_Type := Software_Q_Impl_Port_Type'First)
  is
    record
      case Port is
        when Data_Sink =>
          Data_Sink_DATA : PolyORB_HI_Generated.Types.Alpha_Type;
        pragma Warnings (Off);
        when others =>
          null;
        pragma Warnings (On);
      end case;
    end record;

  procedure Send_Output
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_Q_Impl_Port_Type;
    Result : out PolyORB_HI.Errors.Error_Kind);

  procedure Put_Value
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Thread_Interface : Software_Q_Impl_Interface);

  procedure Receive_Input
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_Q_Impl_Port_Type);

  procedure Get_Value
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_Q_Impl_Port_Type;
    Result : out Software_Q_Impl_Interface)
    with Global => (In_Out => (Elaborated_Variables), Input => UQ_S);

  procedure Get_Sender
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_Q_Impl_Port_Type;
    Result : out PolyORB_HI_Generated.Deployment.Entity_Type)
    with Global => (In_Out => (Elaborated_Variables), Input => UQ_S);

  procedure Get_Count
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_Q_Impl_Port_Type;
    Result : out Standard.Integer)
    with Global => (In_Out => (Elaborated_Variables), Input => UQ_S);

  procedure Get_Time_Stamp
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_Q_Impl_Port_Type;
    Result : out Ada.Real_Time.Time)
    with Global => (In_Out => Elaborated_Variables);

  procedure Next_Value
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : Software_Q_Impl_Port_Type)
    with Global => (In_Out => (Elaborated_Variables, UQ_S));

  procedure Store_Received_Message
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Thread_Interface : Software_Q_Impl_Interface;
    From : PolyORB_HI_Generated.Deployment.Entity_Type;
    Time_Stamp : Ada.Real_Time.Time :=
      Ada.Real_Time.Clock);

  procedure Wait_For_Incoming_Events
   (Entity : PolyORB_HI_Generated.Deployment.Entity_Type;
    Port : out Software_Q_Impl_Port_Type);

  --  END: Entities used by all instances of component Q.Impl

  --  Periodic task : Result_Consumer

  procedure Producer_Consumer_Result_Consumer_Job
    (Result : out PolyORB_HI.Errors.Error_Kind);

  package Producer_Consumer_Result_Consumer_Task is
   new PolyORB_HI.Periodic_Task
     (Entity => PolyORB_HI_Generated.Deployment.pr_A_Result_Consumer_K,
      Task_Period => Ada.Real_Time.Milliseconds
       (100),
      Task_Deadline => Ada.Real_Time.Milliseconds
       (100),
      Task_Priority => System.Default_Priority,
      Task_Stack_Size => 100000,
      Job => Producer_Consumer_Result_Consumer_Job);

end PolyORB_HI_Generated.Activity;
