tcldoc_40802.zip
TCL.chm
tcldoc_4_07_01.zip
TCL.chm
tcl_3_55.zip
associative_tree.inl
basic_tree.inl
child_iterator.inl
descendant_iterator.inl
multitree.inl
ordered_iterator.inl
sequential_tree.inl
tree.inl
unique_tree.inl
tcl_4_07.zip
associative_tree.inl
basic_tree.inl
descendant_iterator.inl
descendant_node_iterator.inl
multitree.inl
sequential_tree.inl
tree.inl
unique_tree.inl
tcl_4_08.zip
associative_tree.inl
basic_tree.inl
descendant_iterator.inl
descendant_node_iterator.inl
multitree.inl
sequential_tree.inl
TCL.chm
tree.inl
unique_tree.inl
tcl_test_suite_081606.zip
associative_tree_tester.inl
basic_tree_tester.inl
child_iterator_tester.inl
child_sequential_iterator_tester.inl
descendant_iterator_tester.inl
modifying_algorithm_tester.inl
nonmodifying_algorithm_tester.inl
ordered_iterator_checker.inl
sequential_tree_tester.inl
stl_algorithm_tester.inl
unique_tree_tester.inl
tree_container_library_demo.zip
generic_example_diagram.jpg
generic_example_explanation.rtf
generic_example_results.jpg
polymorphic_example_diagram.jpg
polymorphic_example_explanation.rtf
polymorphic_example_results.jpg
sequential_tree_example_diagram.jpg
sequential_tree_example_explanation.rtf
sequential_tree_example_results.jpg
unique_tree_example_diagram.jpg
unique_tree_example_explation.rtf
unique_tree_example_results.jpg
tree_container_library_demos.zip
generic_example_diagram.jpg
generic_example_results.jpg
polymorphic_example_diagram.jpg
polymorphic_example_results.jpg
sequential_tree_example_diagram.jpg
sequential_tree_example_results.jpg
unique_tree_example_diagram.jpg
unique_tree_example_results.jpg
tree_container_library_src.zip
basic_tree.inl
multitree.inl
Tree.inl
unique_tree.inl
tree_container_lib_src.zip
associative_tree.inl
basic_tree.inl
multitree.inl
sequential_tree.inl
Tree.inl
unique_tree.inl
|
/*******************************************************************************
Tree Container Library: Generic container library to store data in tree-like structures.
Copyright (c) 2006 Mitchel Haas
This software is provided 'as-is', without any express or implied warranty.
In no event will the author be held liable for any damages arising from
the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented;
you must not claim that you wrote the original software.
If you use this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such,
and must not be misrepresented as being the original software.
3. The above copyright notice and this permission notice may not be removed
or altered from any source distribution.
Email questions, comments or suggestions to mhaas@datasoftsolutions.net
*******************************************************************************/
#pragma once
#include "basic_tree.h"
// stored_type: type stored in container
// tree_type: one of three tree types derived from this base
// container_type: type of contain to hold children (can be set or multiset)
template< typename stored_type, typename tree_type, typename container_type >
class associative_tree : public basic_tree<stored_type, tree_type, container_type>
{
protected:
typedef basic_tree<stored_type, tree_type, container_type > basic_tree_type;
associative_tree() : basic_tree_type(stored_type()) {}
associative_tree( const stored_type& stored_obj ) : basic_tree_type(stored_obj) {}
~associative_tree() {}
// public interface
public:
typename basic_tree_type::iterator find(const stored_type& stored_obj);
typename basic_tree_type::const_iterator find(const stored_type& stored_obj) const;
bool erase(const stored_type& stored_obj);
void erase(typename basic_tree_type::iterator it) { basic_tree_type::erase(it); }
};
#include "associative_tree.inl"
|
By viewing downloads associated with this article you agree to the Terms of use 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.
I'm a c++ programmer in the midwest, now using VC7 at work and at home. I enjoy creating generic libraries, and template based programming.
I also enjoy web development (xhtml, css, javascript, php).