1 #ifndef __KKC_NTREENODE__
2 #define __KKC_NTREENODE__
11 #include OV_STD_INCLUDE(iostream)
18 template<
int degree,
class Data>
30 for (
int i=0; i<degree; i++) leaves[i] = node_.leaves[i];
36 inline int add(Data &data_);
37 inline int add(
int d, Data &data_);
38 inline int add(
int d);
39 inline int del(
int nDel);
51 inline const Data &
getData()
const {
return data; }
65 template<
int degree,
class Data>
85 template<
int degree,
class Data>
111 template<
int degree,
class Data>
138 template<
int degree,
class Data>
161 template<
int degree,
class Data>
177 AssertException<InvalidNode> (isValid == 1);
183 for (
int d=0; d<degree; d++)
184 if (leaves[d]!=
NULL) del(d);
194 template<
int degree,
class Data>
212 while(d<degree && leaves[d]!=
NULL)
220 AssertException<TreeDegreeViolation> (d<degree && d>=0);
221 AssertException<NodeFullError> (leaves[d]==
NULL);
231 template<
int degree,
class Data>
255 AssertException<TreeDegreeViolation> (d<degree && d>=0);
256 AssertException<NodeFullError> (leaves[d]==
NULL);
264 template<
int degree,
class Data>
288 AssertException<TreeDegreeViolation> (d<degree && d>=0);
289 AssertException<NodeFullError> (leaves[d]==
NULL);
297 template<
int degree,
class Data>
318 AssertException<TreeDegreeViolation> (nDel>=0 && nDel<degree);
322 if (leaves[nDel]!=
NULL) {
331 template<
int degree,
class Data>
349 template<
int degree,
class Data>
370 AssertException<TreeDegreeViolation> (d<degree && d>=0);
379 template<
int degree,
class Data>
399 AssertException<TreeDegreeViolation> (d<degree && d>=0);
402 return leaves[d] !=
NULL;
410 template<
int degree,
class Data>
433 template<
int degree,
class Data>
440 for (
int d=0; d<degree; d++)
446 template<
int degree,
class Data>
462 template<
int degree,
class Data>
478 template<
int degree,
class Data>
497 AssertException<TreeDegreeViolation> (d<degree && d>=0);
505 template<
int degree,
class Data>
525 AssertException<TreeDegreeViolation> (d<degree && d>=0);
532 template<
int degree,
class Data>
542 template<
int degree,
class Data>