Statistics
| Branch: | Revision:

grapes / include / scheduler_common.h @ master

History | View | Annotate | Download (796 Bytes)

1
#ifndef SCHEDULER_COMMON_H
2
#define SCHEDULER_COMMON_H
3

    
4
/**
5
 * @file scheduler_common.h
6
 * @brief Common definitions for the scheduler.
7
 *
8
 */
9

    
10

    
11
#include <stdlib.h>
12

    
13

    
14
/**
15
  * @brief Peer identifier used for scheduling
16
  */
17
typedef struct peer *schedPeerID ;
18
/**
19
  * @brief Chunk identifier used for scheduling
20
  */
21
typedef int schedChunkID ;
22

    
23
/**
24
  * @brief The peer-chunk pair, the "atomic unit" of scheduling
25
  */
26
struct PeerChunk {
27
    schedPeerID  peer;
28
    schedChunkID  chunk;
29
};
30

    
31
/**
32
  * @brief Comodity function to convert peer and chunk lists to list of peer-chunk pairs
33
  */
34
void toPairs(schedPeerID  *peers, size_t peers_len, schedChunkID  *chunks, size_t chunks_len,         //in
35
                     struct PeerChunk *pairs, size_t *pairs_len);        //out, inout
36

    
37
#endif        /* SCHEDULER_COMMON_H */