Changes between Version 3 and Version 4 of Ticket #40


Ignore:
Timestamp:
Oct 21, 2010, 4:02:00 PM (14 years ago)
Author:
Nicolas Pouillon
Comment:

Move selection function

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #40 – Description

    v3 v4  
    8080  void *private;              // port's private.
    8181};
    82 
    83 enum topo_crit_val_e
    84 {
    85   CRIT_DROP,   /// Node is not interesting, stop recursion here in the graph
    86   CRIT_RECURS, /// Node is not selected, but we can recurs through it
    87   CRIT_SELECT, /// Node is selected, and may be recursed down
    88 };
    8982}}}
    9083
     
    110103   struct topo_node_s *start,
    111104   struct topo_addr_s *dest);
    112 
    113 /**
    114   Selector function
    115   @param node Node to filter
    116   @param metrics Metrics from start node to this one
    117   @param priv Selector private data
    118   @returns whether the node is interesting
    119 */
    120 typedef enum topo_crit_val_e crit_func_t(struct topo_node_s *node, struct topo_metrics_s *metrics, void *priv);
    121 
    122 error_t select(
    123    struct topo_node_s *start,          /// Start node
    124    crit_func_t *crit, void *crit_priv, /// Criterium function, telling whether a node is eligible
    125    size_t max_nodes,                   /// Maximal number of nodes to return
    126    struct topo_node_s **nodes);        /// Output nodes. Table must be allocated by caller and be able to contain max_nodes
    127105}}}
    128106(round-trip is sufficient as there is roughly the same energy
     
    161139}}}
    162140
     141== Selection function ==
     142
     143{{{
     144enum topo_crit_val_e
     145{
     146  CRIT_DROP,   /// Node is not interesting, stop recursion here in the graph
     147  CRIT_RECURS, /// Node is not selected, but we can recurs through it
     148  CRIT_SELECT, /// Node is selected, and may be recursed down
     149};
     150
     151/**
     152  Selector function
     153  @param node Node to filter
     154  @param metrics Metrics from start node to this one
     155  @param priv Selector private data
     156  @returns whether the node is interesting
     157*/
     158typedef enum topo_crit_val_e crit_func_t(struct topo_node_s *node, struct topo_metrics_s *metrics, void *priv);
     159
     160error_t select(
     161   struct topo_node_s *start,          /// Start node
     162   crit_func_t *crit, void *crit_priv, /// Criterium function, telling whether a node is eligible
     163   size_t max_nodes,                   /// Maximal number of nodes to return
     164   struct topo_node_s **nodes);        /// Output nodes. Table must be allocated by caller and be able to contain max_nodes
     165}}}
     166
    163167== Needed calls in model-specific functions ==
    164168