home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbdatabs / tnode.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-03-17  |  2.8 KB  |  85 lines

  1. // ------------------------------- //
  2. // -------- Start of File -------- //
  3. // ------------------------------- //
  4. // ----------------------------------------------------------- //
  5. // C++ Header File Name: tnode.h 
  6. // Compiler Used: MSVC40, DJGPP 2.7.2.1, GCC 2.7.2.1, HP CPP 10.24
  7. // Produced By: Doug Gaer   
  8. // File Creation Date: 02/07/1997  
  9. // Date Last Modified: 03/17/1999
  10. // Copyright (c) 1997 Douglas M. Gaer
  11. // ----------------------------------------------------------- // 
  12. // ---------- Include File Description and Details  ---------- // 
  13. // ----------------------------------------------------------- // 
  14. /*
  15. The VBD C++ classes are copyright (c) 1997, by Douglas M. Gaer.
  16. All those who put this code or its derivatives in a commercial
  17. product MUST mention this copyright in their documentation for
  18. users of the products in which this code or its derivative
  19. classes are used. Otherwise, you have the freedom to redistribute
  20. verbatim copies of this source code, adapt it to your specific
  21. needs, or improve the code and release your improvements to the
  22. public provided that the modified files carry prominent notices
  23. stating that you changed the files and the date of any change.
  24.  
  25. THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
  26. THE ENTIRE RISK OF THE QUALITY AND PERFORMANCE OF THIS SOFTWARE
  27. IS WITH YOU. SHOULD ANY ELEMENT OF THIS SOFTWARE PROVE DEFECTIVE,
  28. YOU WILL ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
  29. CORRECTION.
  30.  
  31. The TNode class is used to create Disk-based binary search 
  32. nodes of specific data type.
  33. */
  34. // ----------------------------------------------------------- //   
  35. #ifndef __TNODE_HPP
  36. #define __TNODE_HPP
  37.  
  38. #include "fkey.h"
  39.  
  40. // NOTE: To avoid portablity problems with template classes, enable
  41. // the __NOT_USING_TEMPLATE_CLASS__ macro and directly code the
  42. // Bucket class, Cache class, and the CachePtr class for the data
  43. // type that will be used.
  44.  
  45. // Default to using template class
  46. #ifndef __NOT_USING_TEMPLATE_CLASS__
  47. #define __USING_TEMPLATE_CLASS__
  48. #endif
  49.  
  50. #ifdef __NOT_USING_TEMPLATE_CLASS__
  51. #include "vbdfile.h"
  52. #endif
  53.  
  54. #ifdef __USING_TEMPLATE_CLASS__
  55. #include "cacheptr.h"
  56. #endif
  57.  
  58. // General definition of the Disk-based Tree (D)ata (T)ype
  59. #ifndef DTYPE
  60. typedef FKey DTYPE;
  61. #endif
  62.  
  63. // (T)ree (N)ode class (Disk-based binary search nodes)
  64. class TNode 
  65. public:
  66.   TNode() { Left = 0; Right = 0; }
  67.   TNode(const DTYPE &X);
  68.  
  69. public:
  70.   DTYPE Data; 
  71.   FAU Left;   
  72.   FAU Right;
  73. };
  74.  
  75. #ifdef __USING_TEMPLATE_CLASS__
  76. typedef CachePtr<TNode> CachePointer; // Pointer to cache
  77. #endif
  78.  
  79. #endif  // __TNode_HPP //
  80. // ----------------------------------------------------------- // 
  81. // ------------------------------- //
  82. // --------- End of File --------- //
  83. // ------------------------------- //
  84.