mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.2 KiB
62 lines
1.2 KiB
// TreeChecker.h
|
|
|
|
#ifndef __TREE_CHECKER_H
|
|
#define __TREE_CHECKER_H
|
|
|
|
#ifdef CHECK_TREES
|
|
|
|
class CEvalTree;
|
|
class CEvalNode;
|
|
|
|
#include <map>
|
|
#include <sync.h>
|
|
|
|
typedef std::map< CEvalTree*,
|
|
BOOL,
|
|
std::less<CEvalTree*>,
|
|
wbem_allocator< BOOL > > CTreeMap;
|
|
typedef CTreeMap::iterator CTreeMapItor;
|
|
|
|
typedef std::map< CEvalNode*,
|
|
BOOL,
|
|
std::less< CEvalNode* >,
|
|
wbem_allocator< BOOL > > CNodeMap;
|
|
typedef CNodeMap::iterator CNodeMapItor;
|
|
|
|
class CTreeChecker
|
|
{
|
|
public:
|
|
CCritSec m_cs;
|
|
|
|
// Called by the tree ctor.
|
|
void AddTree(CEvalTree *pTree);
|
|
|
|
// Called by the tree dtor.
|
|
void RemoveTree(CEvalTree *pTree);
|
|
|
|
// Called by the node ctor.
|
|
void AddNode(CEvalNode *pNode);
|
|
|
|
// Called by the node dtor.
|
|
void RemoveNode(CEvalNode *pNode);
|
|
|
|
// Called by nodes during a CheckTrees() call to indicate
|
|
// a node is accounted for.
|
|
void CheckoffNode(CEvalNode *pNode);
|
|
|
|
// Used to check the validity of all trees.
|
|
BOOL CheckTreeNodes();
|
|
|
|
protected:
|
|
CTreeMap m_mapTrees;
|
|
CNodeMap m_mapNodes,
|
|
*m_pmapNodesTemp;
|
|
};
|
|
|
|
extern CTreeChecker g_treeChecker;
|
|
|
|
#define CheckTrees() g_treeChecker.CheckTreeNodes();
|
|
|
|
#endif
|
|
|
|
#endif
|