00001 /*00002 * Licensed to the Apache Software Foundation (ASF) under one or more00003 * contributor license agreements. See the NOTICE file distributed with00004 * this work for additional information regarding copyright ownership.00005 * The ASF licenses this file to You under the Apache License, Version 2.000006 * (the "License"); you may not use this file except in compliance with00007 * the License. You may obtain a copy of the License at00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.000010 * 00011 * Unless required by applicable law or agreed to in writing, software00012 * distributed under the License is distributed on an "AS IS" BASIS,00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.00014 * See the License for the specific language governing permissions and00015 * limitations under the License.00016 */00017
00018 /*00019 * $Id: XMLDeleterFor.hpp 568078 2007-08-21 11:43:25Z amassari $00020 */00021
00022
00023 #if !defined(XMLDELETERFOR_HPP)00024#define XMLDELETERFOR_HPP00025
00026 #include <xercesc/util/XercesDefs.hpp>00027 #include <xercesc/util/PlatformUtils.hpp>00028
00029 XERCES_CPP_NAMESPACE_BEGIN00030
00031 //00032 // For internal use only.00033 //00034 // This class is used by the platform utilities class to support cleanup00035 // of global/static data which is lazily created. Since that data is00036 // widely spread out, and in higher level DLLs, the platform utilities00037 // class cannot know about them directly. So, the code that creates such00038 // objects creates an registers a deleter for the object. The platform00039 // termination call will iterate the list and delete the objects.00040 //00041template <class T> class XMLDeleterFor : publicXMLDeleter00042 {
00043 public :
00044 // -----------------------------------------------------------------------00045 // Constructors and Destructor00046 // -----------------------------------------------------------------------00047 XMLDeleterFor(T* const toDelete);
00048 ~XMLDeleterFor();
00049
00050
00051 private :
00052 // -----------------------------------------------------------------------00053 // Unimplemented constructors and operators00054 // -----------------------------------------------------------------------00055 XMLDeleterFor();
00056 XMLDeleterFor(constXMLDeleterFor<T>&);
00057 XMLDeleterFor<T>& operator=(constXMLDeleterFor<T>&);
00058
00059
00060 // -----------------------------------------------------------------------00061 // Private data members00062 //00063 // fToDelete00064 // This is a pointer to the data to destroy00065 // -----------------------------------------------------------------------00066 T* fToDelete;
00067 };
00068
00069 XERCES_CPP_NAMESPACE_END00070
00071 #if !defined(XERCES_TMPLSINC)00072 #include <xercesc/util/XMLDeleterFor.c>00073 #endif00074
00075 #endif