1 | /*
|
---|
2 | * Copyright 1999-2002,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * $Log: RefVectorOf.c,v $
|
---|
19 | * Revision 1.12 2004/09/08 13:56:23 peiyongz
|
---|
20 | * Apache License Version 2.0
|
---|
21 | *
|
---|
22 | * Revision 1.11 2003/09/10 14:56:31 neilg
|
---|
23 | * fix compiler warnings on ISeries; add Apache copyright notice
|
---|
24 | *
|
---|
25 | * Revision 1.10 2003/05/30 16:11:45 gareth
|
---|
26 | * Fixes so we compile under VC7.1. Patch by Alberto Massari.
|
---|
27 | *
|
---|
28 | * Revision 1.9 2003/05/16 06:01:52 knoaman
|
---|
29 | * Partial implementation of the configurable memory manager.
|
---|
30 | *
|
---|
31 | * Revision 1.8 2003/05/15 19:07:45 knoaman
|
---|
32 | * Partial implementation of the configurable memory manager.
|
---|
33 | *
|
---|
34 | * Revision 1.7 2003/02/06 16:11:30 peiyongz
|
---|
35 | * Bug#16826: RefVectorOf.c has errors in strict ANSI mode, patch from
|
---|
36 | * David Bertoni (David_N_Bertoni@lotus.com )
|
---|
37 | *
|
---|
38 | * Revision 1.6 2002/12/17 21:06:02 gareth
|
---|
39 | * Removed defaulting from parameters in c files as windows and gcc 3.2 say this is wrong.
|
---|
40 | *
|
---|
41 | * Revision 1.5 2002/12/17 17:17:58 gareth
|
---|
42 | * added abstract base class BaseRefVectorOf from which both RefVectorOf and RefArrayVectorOf inherit
|
---|
43 | * the new RefArrayVectorOf has proper destructor for array deletion
|
---|
44 | *
|
---|
45 | * Revision 1.4 2002/11/04 15:22:04 tng
|
---|
46 | * C++ Namespace Support.
|
---|
47 | *
|
---|
48 | * Revision 1.3 2002/02/05 15:38:14 tng
|
---|
49 | * [Bug 6114] Memory leaks on iDOM getElementsByTagName().
|
---|
50 | *
|
---|
51 | * Revision 1.2 2002/02/05 13:11:06 tng
|
---|
52 | * [Bug 6114] Memory leaks on iDOM getElementsByTagName().
|
---|
53 | *
|
---|
54 | * Revision 1.1.1.1 2002/02/01 22:22:12 peiyongz
|
---|
55 | * sane_include
|
---|
56 | *
|
---|
57 | * Revision 1.5 2001/06/25 13:01:49 knoaman
|
---|
58 | * Add constraint checking on elements in complex types to prevent same
|
---|
59 | * element names from having different definitions - use substitueGroups.
|
---|
60 | *
|
---|
61 | * Revision 1.4 2000/07/31 19:18:25 jpolast
|
---|
62 | * bug fix in removeAll() to zero out all the pointers.
|
---|
63 | *
|
---|
64 | * Revision 1.3 2000/03/02 19:54:45 roddey
|
---|
65 | * This checkin includes many changes done while waiting for the
|
---|
66 | * 1.1.0 code to be finished. I can't list them all here, but a list is
|
---|
67 | * available elsewhere.
|
---|
68 | *
|
---|
69 | * Revision 1.2 2000/02/06 07:48:03 rahulj
|
---|
70 | * Year 2K copyright swat.
|
---|
71 | *
|
---|
72 | * Revision 1.1.1.1 1999/11/09 01:05:04 twl
|
---|
73 | * Initial checkin
|
---|
74 | *
|
---|
75 | * Revision 1.2 1999/11/08 20:45:13 rahul
|
---|
76 | * Swat for adding in Product name and CVS comment log variable.
|
---|
77 | *
|
---|
78 | */
|
---|
79 |
|
---|
80 |
|
---|
81 | // ---------------------------------------------------------------------------
|
---|
82 | // Includes
|
---|
83 | // ---------------------------------------------------------------------------
|
---|
84 | #if defined(XERCES_TMPLSINC)
|
---|
85 | #include <xercesc/util/RefVectorOf.hpp>
|
---|
86 | #endif
|
---|
87 |
|
---|
88 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
89 |
|
---|
90 | // ---------------------------------------------------------------------------
|
---|
91 | // RefVectorOf: Constructors and Destructor
|
---|
92 | // ---------------------------------------------------------------------------
|
---|
93 | template <class TElem>
|
---|
94 | RefVectorOf<TElem>::RefVectorOf(const unsigned int maxElems,
|
---|
95 | const bool adoptElems,
|
---|
96 | MemoryManager* const manager)
|
---|
97 | : BaseRefVectorOf<TElem>(maxElems, adoptElems, manager)
|
---|
98 | {
|
---|
99 | }
|
---|
100 |
|
---|
101 | template <class TElem> RefVectorOf<TElem>::~RefVectorOf()
|
---|
102 | {
|
---|
103 | if (this->fAdoptedElems)
|
---|
104 | {
|
---|
105 | for (unsigned int index = 0; index < this->fCurCount; index++)
|
---|
106 | delete this->fElemList[index];
|
---|
107 | }
|
---|
108 | this->fMemoryManager->deallocate(this->fElemList);//delete [] this->fElemList;
|
---|
109 | }
|
---|
110 |
|
---|
111 |
|
---|
112 | XERCES_CPP_NAMESPACE_END
|
---|