Claw
1.7.3
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
impl
binary_node.tpp
Go to the documentation of this file.
1
/*
2
CLAW - a C++ Library Absolutely Wonderful
3
4
CLAW is a free library without any particular aim but being useful to
5
anyone.
6
7
Copyright (C) 2005-2011 Julien Jorge
8
9
This library is free software; you can redistribute it and/or
10
modify it under the terms of the GNU Lesser General Public
11
License as published by the Free Software Foundation; either
12
version 2.1 of the License, or (at your option) any later version.
13
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Lesser General Public License for more details.
18
19
You should have received a copy of the GNU Lesser General Public
20
License along with this library; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
23
contact: julien.jorge@gamned.org
24
*/
31
#include <cstddef>
32
33
/*---------------------------------------------------------------------------*/
38
template
<
class
U >
39
claw::binary_node<U>::binary_node
()
40
: left(NULL), right(NULL)
41
{
42
43
}
//binary_node()
44
45
/*---------------------------------------------------------------------------*/
50
template
<
class
U >
51
claw::binary_node<U>::binary_node
(
const
binary_node
& that )
52
{
53
if
(that.
left
)
54
left =
new
U( * that.
left
);
55
else
56
left = NULL;
57
58
if
( that.
right
)
59
right =
new
U( * that.
right
);
60
else
61
right = NULL;
62
}
// binary_node() [copy constructor]
63
64
/*---------------------------------------------------------------------------*/
69
template
<
class
U >
70
void
claw::binary_node<U>::clear
()
71
{
72
left = NULL;
73
right = NULL;
74
}
// clear()
75
76
/*---------------------------------------------------------------------------*/
81
template
<
class
U >
82
claw::binary_node<U>::~binary_node
()
83
{
84
if
(left)
85
delete
left;
86
87
if
(right)
88
delete
right;
89
}
// ~binary_node() [destructor]
Generated on Thu Mar 14 2013 22:09:24 for Claw by
1.8.1.2