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