Click here to Skip to main content
15,886,095 members
Articles / Desktop Programming / MFC

Tree Container Library

Rate me:
Please Sign up or sign in to vote.
4.85/5 (29 votes)
22 Aug 2007Zlib10 min read 228.4K   7.2K   111  
A generic template class library for storing data in a tree-like structure.
#pragma once
#include "Alpha.h"


template<typename treetype>
class basic_tree_tester
{
public:
	basic_tree_tester();
	~basic_tree_tester();

	// interface
	void run();

	// implementation
protected:
	std::string get_treetype_name();
	void test_default_constructor();
	void test_stored_type_constructor(treetype& test_tree);
	void test_range_constructor();
	void populate_tree(treetype& test_tree);
	void populate_wide_tree(treetype& test_tree);
	void test_copy_constructor_and_get_operation(treetype& test_tree);
	void test_is_root(const treetype& test_tree);
	void test_size_and_empty(const treetype& test_tree);
	void test_parent(const treetype& test_tree);
	void test_swap(treetype& test_tree);
	void test_erase(treetype& test_tree);
	void test_erase_range(treetype& test_tree);
	void test_clear(treetype& test_tree);
	void test_iterator_retreival(treetype& test_tree);
	void test_const_tree_iterator_retreival(const treetype& test_tree);
	void test_tree_overloaded_operators(treetype& test_tree);
	void test_insert_tree(treetype& test_tree);
};





void test_basic_tree();

#include "basic_tree_tester.inl"

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The zlib/libpng License



Comments and Discussions