POK
/home/jaouen/pok_official/pok/trunk/libpok/ada/arinc653/apex-blackboards.ads
00001 -- ---------------------------------------------------------------------------
00002 -- --
00003 -- BLACKBOARD constant and type definitions and management services --
00004 -- --
00005 -- ---------------------------------------------------------------------------
00006 with APEX.Processes;
00007 package APEX.Blackboards is
00008    Max_Number_Of_Blackboards : constant := System_Limit_Number_Of_Blackboards;
00009    subtype Blackboard_Name_Type is Name_Type;
00010    type Blackboard_Id_Type is private;
00011    Null_Blackboard_Id : constant Blackboard_Id_Type;
00012    type Empty_Indicator_Type is (Empty, Occupied);
00013    type Blackboard_Status_Type is record
00014        Empty_Indicator   : Empty_Indicator_Type;
00015        Max_Message_Size : Message_Size_Type;
00016        Waiting_Processes : APEX.Processes.Waiting_Range_Type;
00017    end record;
00018    procedure Create_Blackboard
00019       (Blackboard_Name : in Blackboard_Name_Type;
00020        Max_Message_Size : in Message_Size_Type;
00021        Blackboard_Id    : out Blackboard_Id_Type;
00022        Return_Code      : out Return_Code_Type);
00023    procedure Display_Blackboard
00024       (Blackboard_Id : in Blackboard_Id_Type;
00025        Message_Addr : in Message_Addr_Type;
00026        Length        : in Message_Size_Type;
00027        Return_Code   : out Return_Code_Type);
00028    procedure Read_Blackboard
00029       (Blackboard_Id : in Blackboard_Id_Type;
00030        Time_Out      : in System_Time_Type;
00031        Message_Addr : in Message_Addr_Type;
00032    -- The message address is passed IN, although the respective message is
00033    -- passed OUT
00034        Length        : out Message_Size_Type;
00035        Return_Code   : out Return_Code_Type);
00036    procedure Clear_Blackboard
00037       (Blackboard_Id : in Blackboard_Id_Type;
00038        Return_Code   : out Return_Code_Type);
00039    procedure Get_Blackboard_Id
00040       (Blackboard_Name : in Blackboard_Name_Type;
00041        Blackboard_Id   : out Blackboard_Id_Type;
00042        Return_Code     : out Return_Code_Type);
00043    procedure Get_Blackboard_Status
00044       (Blackboard_Id     : in Blackboard_Id_Type;
00045        Blackboard_Status : out Blackboard_Status_Type;
00046        Return_Code       : out Return_Code_Type);
00047 private
00048    type Blackboard_Id_Type is new APEX_Integer;
00049    Null_Blackboard_Id : constant Blackboard_Id_Type := 0;
00050    pragma Convention (C, Empty_Indicator_Type);
00051    pragma Convention (C, Blackboard_Status_Type);
00052 
00053    -- POK BINDINGS
00054    pragma Import (C, Create_Blackboard, "CREATE_BLACKBOARD");
00055    pragma Import (C, Display_Blackboard, "DISPLAY_BLACKBOARD");
00056    pragma Import (C, Read_Blackboard, "READ_BLACKBOARD");
00057    pragma Import (C, Clear_Blackboard, "CLEAR_BLACKBOARD");
00058    pragma Import (C, Get_Blackboard_Id, "GET_BLACKBOARD_ID");
00059    pragma Import (C, Get_Blackboard_Status, "GET_BLACKBOARD_STATUS");
00060    -- END OF POK BINDINGS
00061 end APEX.Blackboards;