4 * $XConsortium: Node.C /main/4 1996/04/21 19:42:41 drk $
6 * RESTRICTED CONFIDENTIAL INFORMATION:
8 * The information in this document is subject to special
9 * restrictions in a confidential disclosure agreement between
10 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
11 * document outside HP, IBM, Sun, USL, SCO, or Univel without
12 * Sun's specific written approval. This document and all copies
13 * and derivative works thereof must be returned or destroyed at
16 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
25 // In the design, we had abstracted out the DOMF related activities
26 // (insertion in lookup table, creation of the objref corresponding to
27 // servant...) into <>Impl classes.
28 // The <>Servant classes derive from the <>Impl classes.
29 // Note how, in the constructor of the NodeServant class, we call the
30 // constructor of the parent NodeImpl class passing in "this".
31 // The NodeImpl constructor uses "this" to insert into the lookup table...
37 my_message_handle = NULL;
38 my_message_header = NULL;
41 deleted_p = DTM_FALSE;
42 my_previous_node = NULL;
47 DtMailMessageHandle msg_num,
51 my_message_handle = msg_num;
52 my_message_header = hdr;
55 deleted_p = DTM_FALSE;
56 my_previous_node = NULL;
76 // Starting with the current node "this", traverse nodes until
77 // home node is reached.
84 unsigned char is_home_p;
89 is_home_p = a_node->is_home();
103 Node::set_message_handle(
104 DtMailMessageHandle a_hndl
107 my_message_handle = a_hndl;
112 Node::get_message_handle()
114 return(my_message_handle);
118 Node::set_message_header(
122 my_message_header = hdr;
126 Node::get_message_header()
128 return(my_message_header);
136 return(my_next_node);
140 // Don't attempt duplicating a nil objref!
147 return(my_previous_node);
151 // Don't attempt duplicating a nil objref!
154 Node::set_previous_node(
158 my_previous_node = a_node;
162 // Don't attempt duplicating a nil objref!
169 my_next_node = a_node;
172 // append anyNode to self
184 if (anyNode == NULL) {
185 printf("Cannot append NIL node!");
195 tmpNext = my_next_node;
196 my_next_node = inNode;
197 inNode->set_previous_node(tmpSelf);
198 inNode->set_next_node(my_next_node);
199 tmpNext->set_previous_node(inNode);
203 my_next_node = inNode;
204 my_previous_node = inNode;
205 inNode->set_previous_node(tmpSelf);
206 inNode->set_next_node(tmpSelf);
210 // prepend anyNode to self
222 if (anyNode == NULL) {
223 printf("Cannot prepend NIL node!");
230 if (my_previous_node)
232 tmpPrev = my_previous_node;
233 my_previous_node = inNode;
234 inNode->set_next_node(tmpSelf);
235 inNode->set_previous_node(tmpPrev);
236 tmpPrev->set_next_node(inNode);
240 my_next_node = inNode;
241 my_previous_node = inNode;
242 inNode->set_previous_node(tmpSelf);
243 inNode->set_next_node(tmpSelf);
248 // Good etiquette requires that clients remove() a node
249 // before destroy()-ing it.
256 my_previous_node->set_next_node(my_next_node);
258 my_next_node->set_previous_node(my_previous_node);
264 Node::set_number(int i)
273 return(bogus_number);