ROSS
Data Structures | Macros | Typedefs | Functions
splay.c File Reference
#include <ross.h>

Go to the source code of this file.

Data Structures

struct  tw_pq
 

Macros

#define UP(t)   ((t)->up)
 
#define UPUP(t)   ((t)->up->up)
 
#define LEFT(t)   ((t)->next)
 
#define RIGHT(t)   ((t)->prev)
 
#define KEY(t)   ((t)->recv_ts)
 
#define ROTATE_R(n, p, g)
 
#define ROTATE_L(n, p, g)
 

Typedefs

typedef tw_pq splay_tree
 

Functions

tw_pqtw_pq_create (void)
 
static unsigned int tw_pq_compare_less_than (tw_event *n, tw_event *e)
 
static void splay (tw_event *node)
 
void tw_pq_enqueue (splay_tree *st, tw_event *e)
 
tw_eventtw_pq_dequeue (splay_tree *st)
 
void tw_pq_delete_any (splay_tree *st, tw_event *r)
 
tw_stime tw_pq_minimum (splay_tree *pq)
 
unsigned int tw_pq_get_size (splay_tree *st)
 
unsigned int tw_pq_max_size (splay_tree *pq)
 

Macro Definition Documentation

#define KEY (   t)    ((t)->recv_ts)

Definition at line 34 of file splay.c.

Referenced by tw_pq_compare_less_than().

#define LEFT (   t)    ((t)->next)

Definition at line 32 of file splay.c.

Referenced by splay(), tw_pq_delete_any(), tw_pq_dequeue(), and tw_pq_enqueue().

#define RIGHT (   t)    ((t)->prev)

Definition at line 33 of file splay.c.

Referenced by splay(), tw_pq_delete_any(), tw_pq_dequeue(), and tw_pq_enqueue().

#define ROTATE_L (   n,
  p,
 
)
Value:
if((RIGHT(p) = LEFT(n))) UP(LEFT(n)) = p; LEFT(n) = p; \
UP(n) = g; UP(p) = n;
#define RIGHT(t)
Definition: splay.c:33
#define UP(t)
Definition: splay.c:30
#define LEFT(t)
Definition: splay.c:32

Definition at line 49 of file splay.c.

Referenced by splay().

#define ROTATE_R (   n,
  p,
 
)
Value:
if((LEFT(p) = RIGHT(n))) UP(RIGHT(n)) = p; RIGHT(n) = p; \
UP(n) = g; UP(p) = n;
#define RIGHT(t)
Definition: splay.c:33
#define UP(t)
Definition: splay.c:30
#define LEFT(t)
Definition: splay.c:32

Definition at line 45 of file splay.c.

Referenced by splay().

#define UP (   t)    ((t)->up)

Definition at line 30 of file splay.c.

Referenced by splay(), tw_pq_delete_any(), tw_pq_dequeue(), and tw_pq_enqueue().

#define UPUP (   t)    ((t)->up->up)

Definition at line 31 of file splay.c.

Referenced by splay().

Typedef Documentation

typedef tw_pq splay_tree

Definition at line 43 of file splay.c.

Function Documentation

static void splay ( tw_event node)
static

Definition at line 97 of file splay.c.

References LEFT, RIGHT, ROTATE_L, ROTATE_R, UP, and UPUP.

Referenced by tw_pq_delete_any(), and tw_pq_enqueue().

Here is the caller graph for this function:

static unsigned int tw_pq_compare_less_than ( tw_event n,
tw_event e 
)
static

Definition at line 65 of file splay.c.

References tw_event::dest_lp, tw_event::event_id, tw_lp::gid, KEY, tw_event::recv_ts, tw_event::send_lp, tw_error(), TW_LOC, and TW_STIME_CMP.

Referenced by tw_pq_enqueue().

Here is the call graph for this function:

Here is the caller graph for this function:

tw_pq* tw_pq_create ( void  )

Definition at line 54 of file splay.c.

References tw_pq::least, tw_pq::nitems, tw_pq::root, tw_calloc(), and TW_LOC.

Referenced by setup_pes().

Here is the call graph for this function:

Here is the caller graph for this function:

void tw_pq_delete_any ( splay_tree st,
tw_event r 
)

Definition at line 288 of file splay.c.

References tw_pq::least, LEFT, tw_pq::nitems, tw_event::owner, RIGHT, tw_pq::root, splay(), tw_event::state, tw_error(), TW_LOC, tw_pq_dequeue(), and UP.

Referenced by event_cancel(), and tw_sched_cancel_q().

Here is the call graph for this function:

Here is the caller graph for this function:

tw_event* tw_pq_dequeue ( splay_tree st)
void tw_pq_enqueue ( splay_tree st,
tw_event e 
)

Definition at line 195 of file splay.c.

References tw_pq::least, LEFT, tw_pq::max_size, tw_pq::nitems, tw_event::owner, RIGHT, tw_pq::root, splay(), tw_event::state, TW_pe_pq, tw_pq_compare_less_than(), and UP.

Referenced by recv_finish(), tw_event_send(), tw_kp_rollback_event(), tw_kp_rollback_to(), tw_sched_batch(), tw_sched_batch_realtime(), and tw_sched_event_q().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int tw_pq_get_size ( splay_tree st)

Definition at line 351 of file splay.c.

References tw_pq::nitems.

Referenced by st_collect_engine_data_pes(), and tw_get_stats().

Here is the caller graph for this function:

unsigned int tw_pq_max_size ( splay_tree pq)

Definition at line 357 of file splay.c.

References tw_pq::max_size.

Referenced by gvt_print().

Here is the caller graph for this function:

tw_stime tw_pq_minimum ( splay_tree pq)