Personal tools
You are here: Home Projects C++ Cfront releases Release 3.0.3 source libSC Set Set_of_p1.c
Document Actions

Set_of_p1.c

by Michael L Powell last modified 2007-01-26 03:24

Click here to get the file

Size 2.2 kB - File type text/plain

File contents

/*ident	"@(#)Set:Set_of_p1.c	3.1" */
/******************************************************************************
*
* C++ Standard Components, Release 3.0.
*
* Copyright (c) 1991, 1992 AT&T and Unix System Laboratories, Inc.
* Copyright (c) 1988, 1989, 1990 AT&T.  All Rights Reserved.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T and Unix System
* Laboratories, Inc.  The copyright notice above does not evidence
* any actual or intended publication of such source code.
*
******************************************************************************/

#include "Set.h"
#include <assert.h>

pst_iter_old_ATTLC::pst_iter_old_ATTLC(const pst_ATTLC& ps)
	: my_pst((pst_ATTLC*)(&ps)), next_it(ps.iter_head)
{
	((pst_ATTLC*)&ps)->iter_head = this;
}

pst_iter_old_ATTLC::pst_iter_old_ATTLC(const pst_iter_old_ATTLC& pi)
	: my_pst(pi.my_pst), next_it(my_pst->iter_head)
{
	my_pst->iter_head = this;
}

pst_iter_old_ATTLC::~pst_iter_old_ATTLC()
{
	if (my_pst == 0) return;
	if (this == my_pst->iter_head)
		my_pst->iter_head = next_it;
	else {
		register pst_iter_old_ATTLC*	x;
		register pst_iter_old_ATTLC* an_it;
		for (an_it = my_pst->iter_head;
					(x = an_it->next_it) != this;
					an_it = x) ;
		an_it->next_it = next_it;
	}
}

pst_iter_old_ATTLC&
pst_iter_old_ATTLC::operator=(const pst_iter_old_ATTLC& pi)
{
	if (this == my_pst->iter_head) {
		my_pst->iter_head = next_it;
	} else {
		pst_iter_old_ATTLC* p = my_pst->iter_head;
		while (p->next_it != this) {
		    p = p->next_it;
		}
		p->next_it = next_it;
	}
	my_pst = pi.my_pst;
	next_it = my_pst->iter_head;
	my_pst->iter_head = this;
	return *this;
}

pst_ATTLC::pst_ATTLC(const pst_ATTLC& a, const pst_ATTLC& b, Set_of_p_union_ATTLC*) :
			sze(0), iter_head(0)
{
	contents.make_null();
	make_union(a, b);
}

pst_ATTLC::pst_ATTLC(const pst_ATTLC& a, const pst_ATTLC& b, Set_of_p_inter_ATTLC*) :
			sze(0), iter_head(0)
{
	contents.make_null();
	make_intersection(a, b);
}

pst_ATTLC::pst_ATTLC(const pst_ATTLC& a, const pst_ATTLC& b, Set_of_p_diff_ATTLC*) :
			sze(0), iter_head(0)
{
	contents.make_null();
	make_difference(a, b);
}

pst_ATTLC::pst_ATTLC(const pst_ATTLC& a, const pst_ATTLC& b, Set_of_p_xor_ATTLC*) :
			sze(0), iter_head(0)
{
	contents.make_null();
	make_xor(a, b);
}

« April 2024 »
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: