Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / TAO_IDL / util / utl_exceptlist.cpp
blobb99c8fa420b9f9aad008e78ab0b7572754fe4f33
1 /*
3 COPYRIGHT
5 Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
6 States of America. All Rights Reserved.
8 This product is protected by copyright and distributed under the following
9 license restricting its use.
11 The Interface Definition Language Compiler Front End (CFE) is made
12 available for your use provided that you include this license and copyright
13 notice on all media and documentation and the software program in which
14 this product is incorporated in whole or part. You may copy and extend
15 functionality (but may not remove functionality) of the Interface
16 Definition Language CFE without charge, but you are not authorized to
17 license or distribute it to anyone else except as part of a product or
18 program developed by you or with the express written consent of Sun
19 Microsystems, Inc. ("Sun").
21 The names of Sun Microsystems, Inc. and any of its subsidiaries or
22 affiliates may not be used in advertising or publicity pertaining to
23 distribution of Interface Definition Language CFE as permitted herein.
25 This license is effective until terminated by Sun for failure to comply
26 with this license. Upon termination, you shall destroy or return all code
27 and documentation for the Interface Definition Language CFE.
29 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
30 ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
31 FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
32 DEALING, USAGE OR TRADE PRACTICE.
34 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
35 ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
36 TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
38 SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
39 RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
40 INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
42 IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
43 ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
44 DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
46 Use, duplication, or disclosure by the government is subject to
47 restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
48 Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
49 52.227-19.
51 Sun, Sun Microsystems and the Sun logo are trademarks or registered
52 trademarks of Sun Microsystems, Inc.
54 SunSoft, Inc.
55 2550 Garcia Avenue
56 Mountain View, California 94043
58 NOTE:
60 SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
61 trademarks or registered trademarks of Sun Microsystems, Inc.
65 // utl_exceptlist.cc
67 // Implementation of a list of exceptions
69 // NOTE: This list class only works correctly because we use single public
70 // inheritance, as opposed to multiple inheritance or public virtual.
71 // It relies on a type-unsafe cast from UTL_List to subclasses, which
72 // will cease to operate correctly if you use either multiple or
73 // public virtual inheritance.
75 #include "utl_exceptlist.h"
77 #include "ace/OS_Memory.h"
79 UTL_ExceptList::UTL_ExceptList (AST_Type *s,
80 UTL_ExceptList *cdr)
81 : UTL_List (cdr),
82 pd_car_data (s)
86 // Get list item.
87 AST_Type *
88 UTL_ExceptList::head ()
90 return this->pd_car_data;
93 // The two methods below make direct calls on the
94 // cdr list (we have been made a friend of the base
95 // class UTL_List's private member). This is so we
96 // can avoid copying the contained quantity, an
97 // AST_Exception.
98 void
99 UTL_ExceptList::destroy ()
101 if (this->tail () != nullptr)
103 this->tail ()->destroy ();
106 delete this;
109 UTL_ExceptList *
110 UTL_ExceptList::copy ()
112 UTL_ExceptList *retval = nullptr;
113 ACE_NEW_RETURN (retval,
114 UTL_ExceptList (this->pd_car_data,
115 nullptr),
116 nullptr);
118 if (this->tail () != nullptr)
120 retval->nconc ((UTL_ExceptList *) this->tail ()->copy ());
123 return retval;
126 UTL_ExceptlistActiveIterator::UTL_ExceptlistActiveIterator (UTL_ExceptList *s)
127 : UTL_ListActiveIterator(s)
131 // Get current item.
132 AST_Type *
133 UTL_ExceptlistActiveIterator::item ()
135 if (source == nullptr)
137 return nullptr;
140 return ((UTL_ExceptList *) source)->head ();