source: NonGTP/Xerces/xerces-c_2_8_0/include/xercesc/dom/deprecated/DomMemDebug.hpp @ 2674

Revision 2674, 2.2 KB checked in by mattausch, 16 years ago (diff)
Line 
1#ifndef DomMemDebug_HEADER_GUARD_
2#define DomMemDebug_HEADER_GUARD_
3
4/*
5 * Licensed to the Apache Software Foundation (ASF) under one or more
6 * contributor license agreements.  See the NOTICE file distributed with
7 * this work for additional information regarding copyright ownership.
8 * The ASF licenses this file to You under the Apache License, Version 2.0
9 * (the "License"); you may not use this file except in compliance with
10 * the License.  You may obtain a copy of the License at
11 *
12 *      http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21/*
22 * $Id: DomMemDebug.hpp 568078 2007-08-21 11:43:25Z amassari $
23 */
24
25#include <xercesc/util/XercesDefs.hpp>
26
27XERCES_CPP_NAMESPACE_BEGIN
28
29
30//
31// This class aids in debugging memory management problems with the
32//  reference counted DOM classes - DOMStrings, Nodes (including subclasses),
33//  and NamedNodeMaps.
34//
35// Usage Example:
36//      DomMemDebug  initialState;   // Captures allocation totals
37//          ...                     //    Test code performs DOM
38//          ...                     //    operations here.
39//
40//      DomMemDebug  exitState;     //   Captures post-test state.
41//      ExitState.printDifference(initialState);  // Display leaks.
42//
43class DEPRECATED_DOM_EXPORT DomMemDebug
44{
45public:
46    int         liveStringHandles;
47    int         totalStringHandles;
48    int         liveStringBuffers;
49    int         totalStringBuffers;
50    int         liveNodeImpls;
51    int         totalNodeImpls;
52    int         liveNamedNodeMaps;
53    int         totalNamedNodeMaps;
54
55public:
56    DomMemDebug();
57    ~DomMemDebug();
58
59    void        print();
60    void        printDifference(const DomMemDebug &other);
61    bool        operator == (const DomMemDebug &other);
62    bool        operator != (const DomMemDebug &other);
63    void        operator =  (const DomMemDebug &other);
64};
65
66
67XERCES_CPP_NAMESPACE_END
68
69#endif
Note: See TracBrowser for help on using the repository browser.