Ejemplo n.º 1
0
receiver_t *receiver_instantiate(receiver_t *x)
{
    receiver_t *r = receiver_instantiate_super(x);

    map_instantiate_toplevel(&r->fifos);

    dispatcher_instantiate_toplevel(&r->dispatcher);

    r->eval = receiver_eval;
    r->eval_pending = receiver_eval_pending;
    r->eval_all_pending = receiver_eval_all_pending;
    r->peek_pending = receiver_peek_pending;
    r->peek_any_pending = receiver_peek_any_pending;
    r->receive = receiver_receive;
    r->open = receiver_open;
    r->close = receiver_close;
    r->set_definition = receiver_set_definition;

    return r;
}
Ejemplo n.º 2
0
router_t* router_instantiate(router_t* x)
{
    router_t* r = router_instantiate_super (x);

    /* uses the 'self' variant of receivers */
    self_receiver_instantiate(&r->super);

    map_instantiate_toplevel(&r->children);

    r->set_child = router_set_child;
    r->receive_backup = r->super.receive;
    r->super.receive = router_receive;

    {
	dictionary_t* dict = dictionary_get_instance();
	
	route_atom = dict->new_atom(dict, "route");
    }
    
    return r;
}