// return the physical node of the source vnode of the virtual // adjacency in the ring. *operation* Node* get_phys_node() *wrapper* VirtualAdjacency (@ VNode* vnode = this->get_source(); return_val = vnode->get_phys_node(); @) // find the adjacency of a given node *operation* Adjacency* find(Node* node) *init* (@ NULL @) *traverse* *from* Network *to* Adjacency *wrapper* Adjacency (@ if (get_source() == node) return_val=this; @) *operation* Tree_Adjacency* find(Node* node) *init* (@ NULL @) *traverse* *from* Tree *to* Tree_Adjacency *wrapper* Tree_Adjacency (@ if (get_source() == node) return_val = this; @) *operation* VirtualAdjacency* find(VNode* vnode) *init* (@ NULL @) *traverse* *from* Ring *to-stop* VirtualAdjacency *wrapper* VirtualAdjacency (@ if (get_source() == vnode) return_val = this; @) // return the first virtual node of a physical node *operation* VNode* first_vnode() *wrapper* Node (@ return_val = this->get_vnodes()->car(); @) // return the last virtual node of a physical node *operation* VNode* last_vnode() *wrapper* Node (@ return_val = get_vnodes()->lastexp(); @) // return the virtual adjacency of the next default virtual node // on the ring. *operation* VirtualAdjacency* get_nextdefault(VirtualAdjacency* adj) *init* (@ NULL @) *traverse* *from* Ring *to-stop* VirtualAdjacency *carry* *inout* int pos = (@ 0 @), *inout* int count = (@ 0 @) *along* *from* Ring *to-stop* VirtualAdjacency *wrapper* Ring *suffix* (@ // the next default is the adjacency in position pos+1 pos++; VirtualAdjacency_List* vadj_list = get_start(); if (pos > count) pos = 1; return_val = vadj_list->n_th(pos); @) *wrapper* VirtualAdjacency (@ count++; if (this == adj) { pos = count; } @) // return the virtual adjacency of the previous default virtual node // on the ring. *operation* VirtualAdjacency* get_prevdefault(VirtualAdjacency* adj) *init* (@ NULL @) *traverse* *from* Ring *to* VirtualAdjacency *carry* *inout* VirtualAdjacency* prev_adj = (@ get_start()->lastexp() @) *along* *from* Ring *to* VirtualAdjacency *wrapper* VirtualAdjacency (@ if (this == adj) return_val = prev_adj; else prev_adj = this; @)