2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * $XConsortium: dl_list_cell.cc /main/4 1996/06/11 17:24:22 cde-hal $
26 * Copyright (c) 1993 HAL Computer Systems International, Ltd.
27 * All rights reserved. Unpublished -- rights reserved under
28 * the Copyright Laws of the United States. USE OF A COPYRIGHT
29 * NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
32 * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
33 * SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD. USE,
34 * DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
35 * PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
38 * RESTRICTED RIGHTS LEGEND
39 * Use, duplication, or disclosure by the Government is subject
40 * to the restrictions as set forth in subparagraph (c)(l)(ii)
41 * of the Rights in Technical Data and Computer Software clause
42 * at DFARS 252.227-7013.
44 * HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
51 #include "object/dl_list_cell.h"
53 dl_list_cell::dl_list_cell(c_code_t c_id) : composite(c_id)
55 v_forward_ptr.become(ground);
56 v_backward_ptr.become(ground);
59 dl_list_cell::dl_list_cell(const dl_list_cell& x) :
61 v_backward_ptr(x.v_backward_ptr),
62 v_forward_ptr(x.v_forward_ptr)
66 dl_list_cell::~dl_list_cell()
70 void dl_list_cell::set_backward_ptr(const oid_t& x)
72 v_backward_ptr.become(x);
73 set_mode(UPDATE, true);
76 void dl_list_cell::set_forward_ptr(const oid_t& x)
78 v_forward_ptr.become(x);
79 set_mode(UPDATE, true);
82 oid_t& dl_list_cell::get_backward_ptr()
84 return v_backward_ptr;
87 oid_t& dl_list_cell::get_forward_ptr()
94 boolean dl_list_cell::value_LS(root& x, boolean safe) const
97 ( f_oid.ccode() != DL_LIST_CELL_CODE ||
98 x.my_oid().ccode() != DL_LIST_CELL_CODE
103 dl_list_cell &y = *(dl_list_cell*)&x;
104 if ( v_backward_ptr.ls(y.v_backward_ptr) == true ||
105 ( v_backward_ptr.eq(y.v_backward_ptr) == true &&
106 v_forward_ptr.ls(y.v_forward_ptr) == true
114 boolean dl_list_cell::value_EQ(root& x, boolean safe) const
117 ( f_oid.ccode() != DL_LIST_CELL_CODE ||
118 x.my_oid().ccode() != DL_LIST_CELL_CODE
123 dl_list_cell &y = *(dl_list_cell*)&x;
124 if ( v_backward_ptr.eq(y.v_backward_ptr) == true )
131 io_status dl_list_cell::asciiOut(ostream& out)
134 my_oid().asciiOut(out);
137 v_backward_ptr.asciiOut(out);
139 v_forward_ptr.asciiOut(out);
143 io_status dl_list_cell::asciiIn(istream& in)
145 v_backward_ptr.asciiIn(in);
146 v_forward_ptr.asciiIn(in);
147 set_mode(UPDATE, true);
152 int dl_list_cell::cdr_sizeof()
154 return composite::cdr_sizeof() + v_backward_ptr.cdr_sizeof() +
155 v_forward_ptr.cdr_sizeof();
158 io_status dl_list_cell::cdrOut(buffer& buf)
160 composite::cdrOut(buf);
161 v_backward_ptr.cdrOut(buf);
162 v_forward_ptr.cdrOut(buf);
166 io_status dl_list_cell::cdrIn(buffer& buf)
168 composite::cdrIn(buf);
169 v_backward_ptr.cdrIn(buf);
170 v_forward_ptr.cdrIn(buf);
174 MMDB_BODIES(dl_list_cell)
175 HANDLER_BODIES(dl_list_cell)