POK
apex-blackboards.ads
1 -- ---------------------------------------------------------------------------
2 -- --
3 -- BLACKBOARD constant and type definitions and management services --
4 -- --
5 -- ---------------------------------------------------------------------------
6 with APEX.Processes;
7 package APEX.Blackboards is
8  Max_Number_Of_Blackboards : constant := System_Limit_Number_Of_Blackboards;
9  subtype Blackboard_Name_Type is Name_Type;
10  type Blackboard_Id_Type is private;
11  Null_Blackboard_Id : constant Blackboard_Id_Type;
12  type Empty_Indicator_Type is (Empty, Occupied);
13  type Blackboard_Status_Type is record
14  Empty_Indicator : Empty_Indicator_Type;
15  Max_Message_Size : Message_Size_Type;
16  Waiting_Processes : APEX.Processes.Waiting_Range_Type;
17  end record;
18  procedure Create_Blackboard
19  (Blackboard_Name : in Blackboard_Name_Type;
20  Max_Message_Size : in Message_Size_Type;
21  Blackboard_Id : out Blackboard_Id_Type;
22  Return_Code : out Return_Code_Type);
23  procedure Display_Blackboard
24  (Blackboard_Id : in Blackboard_Id_Type;
25  Message_Addr : in Message_Addr_Type;
26  Length : in Message_Size_Type;
27  Return_Code : out Return_Code_Type);
28  procedure Read_Blackboard
29  (Blackboard_Id : in Blackboard_Id_Type;
30  Time_Out : in System_Time_Type;
31  Message_Addr : in Message_Addr_Type;
32  -- The message address is passed IN, although the respective message is
33  -- passed OUT
34  Length : out Message_Size_Type;
35  Return_Code : out Return_Code_Type);
36  procedure Clear_Blackboard
37  (Blackboard_Id : in Blackboard_Id_Type;
38  Return_Code : out Return_Code_Type);
39  procedure Get_Blackboard_Id
40  (Blackboard_Name : in Blackboard_Name_Type;
41  Blackboard_Id : out Blackboard_Id_Type;
42  Return_Code : out Return_Code_Type);
43  procedure Get_Blackboard_Status
44  (Blackboard_Id : in Blackboard_Id_Type;
45  Blackboard_Status : out Blackboard_Status_Type;
46  Return_Code : out Return_Code_Type);
47 private
48  type Blackboard_Id_Type is new APEX_Integer;
49  Null_Blackboard_Id : constant Blackboard_Id_Type := 0;
50  pragma Convention (C, Empty_Indicator_Type);
51  pragma Convention (C, Blackboard_Status_Type);
52 
53  -- POK BINDINGS
54  pragma Import (C, Create_Blackboard, "CREATE_BLACKBOARD");
55  pragma Import (C, Display_Blackboard, "DISPLAY_BLACKBOARD");
56  pragma Import (C, Read_Blackboard, "READ_BLACKBOARD");
57  pragma Import (C, Clear_Blackboard, "CLEAR_BLACKBOARD");
58  pragma Import (C, Get_Blackboard_Id, "GET_BLACKBOARD_ID");
59  pragma Import (C, Get_Blackboard_Status, "GET_BLACKBOARD_STATUS");
60  -- END OF POK BINDINGS
61 end APEX.Blackboards;