Use =default for skeleton copy constructor
[ACE_TAO.git] / ACE / tests / RB_Tree_Test.h
blob1ba8030c899576a6ba0e2dcef908e4be864ef479
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
26 // To run the test class on a particular type instantiation of the
27 // RB_Tree, simply instantiate the test class template with the
28 // same type parameters, and invoke the run_test method.
29 public:
30 // = Traits
32 typedef ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>
33 TREE;
34 typedef ACE_RB_Tree_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>
35 ITERATOR;
36 typedef ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>
37 REVERSE_ITERATOR;
39 /// Constructor.
40 ACE_RB_Tree_Test (int entry_count,
41 EXT_ID key_array [],
42 INT_ID item_array [],
43 int order_index []);
45 /// Destructor.
46 ~ACE_RB_Tree_Test ();
48 /// Run the individual interface and iteration tests in order.
49 void run_test ();
51 private:
52 /// Tests stable and deprecated insertion interfaces.
53 void test_tree_insertion ();
55 /// Tests forward and reverse iteration after insertion in both
56 /// trees.
57 void test_post_insertion_iteration ();
59 ///Tests forward and reverse partial iteration
60 void test_partial_iteration();
62 /// Tests stable and deprecated deletion interfaces.
63 void test_tree_deletion ();
65 /// Tests forward and reverse iteration after deletions in both
66 /// trees.
67 void test_post_deletion_iteration ();
69 /// Tree for testing stable interface.
70 TREE stable_tree_;
72 /// Forward iterator for tree for testing stable interface.
73 ITERATOR stable_fwd_iter_;
75 ITERATOR part_fwd_iter_;
77 REVERSE_ITERATOR part_rev_iter_;
79 /// Forward iterator for tree for testing stable interface.
80 REVERSE_ITERATOR stable_rev_iter_;
82 /// Tree for testing deprecated interface.
83 TREE deprecated_tree_;
85 /// Forward iterator for tree for testing deprecated interface.
86 ITERATOR deprecated_fwd_iter_;
88 /// Forward iterator for tree for testing deprecated interface.
89 REVERSE_ITERATOR deprecated_rev_iter_;
91 /// Number of entries in the key, item, and index arrays.
92 int entry_count_;
94 /// Array of EXT_IDs (keys) with which to test.
95 EXT_ID *key_array_;
97 /// Array of INT_IDs (items) with which to test.
98 INT_ID *item_array_;
100 /// Order of indices in the key and item arrays.
101 int *order_index_;