1/*
2* @file sample_node_updator.hpp
3* Contains a samle node update functor.
4*
5* Copyright Ami Tavory, IBM-HRL, 2004.
6*
7* Permission to use, copy, modify, sell, and distribute this software
8*	is hereby granted without fee, provided that the above copyright notice
9*	appears in all copies, and that both that copyright notice and this
10*	permission notice appear in supporting documentation.
11*
12* None of the above authors, nor IBM Haifa Research Laboratories, make any
13*	representation about the suitability of this software for any
14*	purpose. It is provided "as is" without express or implied warranty.
15**/
16
17
18#ifndef SAMPLE_NODE_UPDATOR_HPP
19#define SAMPLE_NODE_UPDATOR_HPP
20
21
22/**
23* <class
24*	description = "A sample node updator."
25*  comment = "This class serves to show the interface a node update functor
26*	needs to support.">
27**/
28class sample_node_updator
29{
30/**
31*******************************************************************************
32*******************************************************************************
33* <public_methods_group>
34**/
35public:
36
37	/**
38	***************************************************************************
39	***************************************************************************
40	** <group description = "Conclassors, declassor, and related.">
41	**/
42
43	/*
44	* <fn description = "Default constructor."
45	*	comment = "Must be default constructible.">
46	**/
47		sample_node_updator
48		();
49	/** </fn> **/
50
51	/*
52	* <fn description = "Copy constructor."
53	*	comment = "Must be copy constructible.">
54	**/
55		sample_node_updator
56		(const sample_node_updator &r_other);
57	/** </fn> **/
58
59	/*
60	* <fn description = "Swaps content."
61	*	comment = "Must be swappable (if there is such a word).">
62	**/
63	inline void
64		swap
65		(sample_node_updator &r_other);
66	/** </fn> **/
67
68	/*
69	***************************************************************************
70	***************************************************************************
71	* </group>
72	**/
73
74
75	/**
76	***************************************************************************
77	***************************************************************************
78	** <group description = "Operators.">
79	**/
80
81	/**
82	* <fn description = "This method is called by the superclass container
83	*	object to update the key of a node whose invariants have been
84	*	violated. p_key is a pointer to the key being updated;
85	*	p_l_child_key is a pointer to the key of the left-child node of
86	*	the node being updated (and is NULL if there is no such child node);
87	*	p_r_child_key is a pointer to the key of the right-child node of
88	*	the node being updated (and is NULL if there is no such child node)."
89	*	comment = "@@sample_node_updator_const_key_pointer_comment">
90	**/
91	void
92		operator()
93		(const_key_pointer p_key,
94			const_key_pointer p_l_child_key,
95			const_key_pointer p_r_child_key);
96	/** </fn> **/
97
98	/*
99	***************************************************************************
100	***************************************************************************
101	* </group>
102	**/
103
104
105/**
106*******************************************************************************
107*******************************************************************************
108* </public_methods_group>
109**/
110};
111/**
112* </class>
113**/
114
115
116#endif // #ifndef SAMPLE_NODE_UPDATOR_HPP
117