Doxygen changes
[ACE_TAO.git] / ACE / tests / RB_Tree_Test.h
blob1b9d52fa91ca73d3059bf8ddd96a803f91733cdc
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file RB_Tree_Test.h
7 * Header file for a test to verify and illustrate the use of the
8 * ACE_RB_Tree ACE_RB_Tree_Iterator, and
9 * ACE_RB_Tree_Reverse_Iterator classes.
10 * iterator over each.
12 * @author Chris Gill <cdgill@cs.wustl.edu>
14 //=============================================================================
17 /**
18 * @class ACE_RB_Tree_Test
20 * @brief Implements a templatized test class for the RB_Tree ADT and its
21 * iterators.
23 template <class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
24 class ACE_RB_Tree_Test
27 // To run the test class on a particular type instantiation of the
28 // RB_Tree, simply instantiate the test class template with the
29 // same type parameters, and invoke the run_test method.
30 public:
31 // = Traits
33 typedef ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>
34 TREE;
35 typedef ACE_RB_Tree_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>
36 ITERATOR;
37 typedef ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>
38 REVERSE_ITERATOR;
40 /// Constructor.
41 ACE_RB_Tree_Test (int entry_count,
42 EXT_ID key_array [],
43 INT_ID item_array [],
44 int order_index []);
46 /// Destructor.
47 ~ACE_RB_Tree_Test (void);
49 /// Run the individual interface and iteration tests in order.
50 void run_test (void);
52 private:
54 /// Tests stable and deprecated insertion interfaces.
55 void test_tree_insertion (void);
57 /// Tests forward and reverse iteration after insertion in both
58 /// trees.
59 void test_post_insertion_iteration (void);
61 ///Tests forward and reverse partial iteration
62 void test_partial_iteration(void);
64 /// Tests stable and deprecated deletion interfaces.
65 void test_tree_deletion (void);
67 /// Tests forward and reverse iteration after deletions in both
68 /// trees.
69 void test_post_deletion_iteration (void);
71 /// Tree for testing stable interface.
72 TREE stable_tree_;
74 /// Forward iterator for tree for testing stable interface.
75 ITERATOR stable_fwd_iter_;
77 ITERATOR part_fwd_iter_;
79 REVERSE_ITERATOR part_rev_iter_;
81 /// Forward iterator for tree for testing stable interface.
82 REVERSE_ITERATOR stable_rev_iter_;
84 /// Tree for testing deprecated interface.
85 TREE deprecated_tree_;
87 /// Forward iterator for tree for testing deprecated interface.
88 ITERATOR deprecated_fwd_iter_;
90 /// Forward iterator for tree for testing deprecated interface.
91 REVERSE_ITERATOR deprecated_rev_iter_;
93 /// Number of entries in the key, item, and index arrays.
94 int entry_count_;
96 /// Array of EXT_IDs (keys) with which to test.
97 EXT_ID *key_array_;
99 /// Array of INT_IDs (items) with which to test.
100 INT_ID *item_array_;
102 /// Order of indices in the key and item arrays.
103 int *order_index_;