#ifndef cp2_ccp_cco_bw_bw_lib_alloc_h #define cp2_ccp_cco_bw_bw_lib_alloc_h /* Cesar project {{{ * * Copyright (C) 2008 Spidcom * * <<>> * * }}} */ /** * \file cp2/cco/bw/bw_lib_alloc.h * \brief schedules allocation. * \ingroup cp2_cco_bw * */ #include "cp2/cco/bw/bw.h" /** Initialise the SET. * \param set the set to initialise. */ void cp_cco_bw_schedules_init (set_t *set); /** Uninitialise the SET. * \param set the set to initialise. */ void cp_cco_bw_schedules_uninit (set_t *set); /** Prepare schedules. * \param ctx the module context. * \param set the set to add the allocations. * \param persistence the type of allocation. * * Get the schedules form the BW and initialise the nodes of each alloc to * insert it in the set. */ void cp_cco_bw_schedules_prepare (cp_t *ctx, set_t *set, cp_cco_bw_persistence_t persistence); /** Add an allocation. * \param set the set to add the allocation. * \param node the node to add. * \param write true if the node is not only hold by this set. */ void cp_cco_bw_schedules_add (set_t *set, cp_cco_bw_alloc_t *alloc, bool write); /** Get the first allocation. * \param set the set. * \return the first allocation of the set. */ cp_cco_bw_alloc_t* cp_cco_bw_schedules_get_first (set_t *set); /** Get the next allocation. * \param set the set. * \return the first allocation of the set. */ cp_cco_bw_alloc_t* cp_cco_bw_schedules_get_next (set_t *set, cp_cco_bw_alloc_t* alloc); /** * Compare two nodes. * \param left Left node. * \param right Right node. * \return true if the left node is lesser than the right one */ bool cp_cco_bw_schedules_allocation_less (set_node_t * left, set_node_t * right); /** Move the nodes from the source set to the dest set. * \param set_dest the destination set. * \param set_src the source set. */ void cp_cco_bw_schedules_move (set_t *set_dest, set_t *set_src); #endif /* cp2_ccp_cco_bw_bw_lib_alloc_h */