]> rtime.felk.cvut.cz Git - frescor/frsh.git/blob - fres/resmng/frm.idl
FRM: Added get_contracts() method
[frescor/frsh.git] / fres / resmng / frm.idl
1 /**
2  * @file   frm.idl
3  * @author Michal Sojka <sojkam1@fel.cvut.cz>
4  * @date   Sat Oct 25 21:57:56 2008
5  * 
6  * @brief  FORB interface of resource manager
7  * 
8  * 
9  */
10 #ifndef _FRM_IDL
11 #define _FRM_IDL
12
13 #include "../contract/fres_contract_idl.idl"
14
15 /// FRES framework
16 module fres {
17         /** Resource manager */
18         interface resource_manager {
19                 /** 
20                  * Executes admission test and if the contracts are
21                  * accepted, they are put to "reserved" state.
22                  *
23                  * @todo If a contract is in the "reserved" state, and
24                  * reserve_contracts() is called again with the same
25                  * contract, the previously reserved contract should
26                  * be replaced with the new one.
27                  * 
28                  * @param contracts New contracts to be reserved.
29                  * 
30                  * @return
31                  * - Zero if reservation (admisson test) was successfull,
32                  * - one if admission test was not successfull and
33                  * - negative error code if an error occured.
34                  */
35                 long reserve_contracts(in contract::ptr_seq contracts);
36
37                 /** 
38                  * Puts contracts with given IDs to the "commited"
39                  * state and sends back the changes to VRESes to reach
40                  * the new state.
41                  *
42                  * @param[in] ids IDs of contracts to be commited.
43                  * 
44                  * @param[out] schedulable_contracts Schedulable
45                  * contracts, for new or changed VRESes. These
46                  * contract may be extened by one or more data blocks
47                  * for use by the allocator. The allocator receives
48                  * the contracts in the same order as they are
49                  * returned.
50                  */
51                 void commit_contracts(in contract::id_seq ids,
52                                       out contract::ptr_seq schedulable_contracts);
53                 void cancel_contracts(in contract::id_seq ids);
54
55                 /** 
56                  * Returns the list of commited contracts
57                  * 
58                  * @param contracts Commited contracts
59                  * 
60                  * @param utilization Utilization in the range 0-100
61                  * (for visualization) or -1 if utilization cannot be
62                  * calculated.
63                  */
64                 void get_contracts(out contract::ptr_seq contracts, out long utilization);
65         };
66 };
67
68 #endif