source: NonGTP/Xerces/xerces/include/xercesc/util/XMLDeleterFor.hpp @ 358

Revision 358, 3.2 KB checked in by bittner, 19 years ago (diff)

xerces added

Line 
1/*
2 * Copyright 1999-2000,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: XMLDeleterFor.hpp,v $
19 * Revision 1.5  2004/09/08 13:56:24  peiyongz
20 * Apache License Version 2.0
21 *
22 * Revision 1.4  2004/01/29 11:48:47  cargilld
23 * Code cleanup changes to get rid of various compiler diagnostic messages.
24 *
25 * Revision 1.3  2003/03/07 18:11:55  tng
26 * Return a reference instead of void for operator=
27 *
28 * Revision 1.2  2002/11/04 15:22:05  tng
29 * C++ Namespace Support.
30 *
31 * Revision 1.1.1.1  2002/02/01 22:22:14  peiyongz
32 * sane_include
33 *
34 * Revision 1.2  2000/03/09 22:38:08  abagchi
35 * Changed copy constructor to make it work on SunOS 5.7
36 *
37 * Revision 1.1  2000/03/02 19:54:48  roddey
38 * This checkin includes many changes done while waiting for the
39 * 1.1.0 code to be finished. I can't list them all here, but a list is
40 * available elsewhere.
41 *
42 */
43
44
45#if !defined(XMLDELETERFOR_HPP)
46#define XMLDELETERFOR_HPP
47
48#include <xercesc/util/XercesDefs.hpp>
49#include <xercesc/util/PlatformUtils.hpp>
50
51XERCES_CPP_NAMESPACE_BEGIN
52
53//
54//  For internal use only.
55//
56//  This class is used by the platform utilities class to support cleanup
57//  of global/static data which is lazily created. Since that data is
58//  widely spread out, and in higher level DLLs, the platform utilities
59//  class cannot know about them directly. So, the code that creates such
60//  objects creates an registers a deleter for the object. The platform
61//  termination call will iterate the list and delete the objects.
62//
63template <class T> class XMLDeleterFor : public XMLDeleter
64{
65public :
66    // -----------------------------------------------------------------------
67    //  Constructors and Destructor
68    // -----------------------------------------------------------------------
69    XMLDeleterFor(T* const toDelete);
70    ~XMLDeleterFor();
71
72
73private :
74    // -----------------------------------------------------------------------
75    //  Unimplemented constructors and operators
76    // -----------------------------------------------------------------------
77    XMLDeleterFor();
78    XMLDeleterFor(const XMLDeleterFor<T>&);
79    XMLDeleterFor<T>& operator=(const XMLDeleterFor<T>&);
80
81
82    // -----------------------------------------------------------------------
83    //  Private data members
84    //
85    //  fToDelete
86    //      This is a pointer to the data to destroy
87    // -----------------------------------------------------------------------
88    T*  fToDelete;
89};
90
91XERCES_CPP_NAMESPACE_END
92
93#if !defined(XERCES_TMPLSINC)
94#include <xercesc/util/XMLDeleterFor.c>
95#endif
96
97#endif
Note: See TracBrowser for help on using the repository browser.