home *** CD-ROM | disk | FTP | other *** search
- <code _K_USER_TDE_>
- --
- -- This file contains code sections for customizing the
- -- key type class.
- --
-
- <code K_CUSTOMIZATION>
- ------------------------------------------------------
- -- Application specific functions and data.
- -- These will be in addition to the required methods.
- ------------------------------------------------------
- public:
- //------------------------------------------------------------------------
- // Constructor to initialize private class members
- //------------------------------------------------------------------------
- $KEY_CLASS$(int count) :
- iCount(count) {}
-
- //------------------------------------------------------------------------
- // Overload the output operator to print out the contents of the
- // collection. The following is an example of printing out the
- // count member function of the $KEY_CLASS$.
- //------------------------------------------------------------------------
- friend
- ostream& operator<< (ostream& os, $KEY_CLASS$ const& a$KEY_CLASS$)
- {
- return os << a$KEY_CLASS$.iCount;
- }
-
- //------------------------------------------------------------------------
- // Define access method to the private members of the key class
- //------------------------------------------------------------------------
- int const& count() const
- {
- return iCount;
- }
-
- private:
- //------------------------------------------------------------------------
- // Private members of $KEY_CLASS$.
- //------------------------------------------------------------------------
- int iCount;
- </code K_CUSTOMIZATION>
-
-
- <code K_DEF_CONSTR_BODY>
- -------------------------------------------------------
- -- Default constructor implementation for key type
- -------------------------------------------------------
- -- $KEY_CLASS$()
- {
- }
- </code K_DEF_CONSTR_BODY>
-
-
- <code K_EQUAL_BODY>
- ----------------------------------------------------------------
- -- Equality operator implementation for key type
- ----------------------------------------------------------------
- -- IBoolean operator== ($KEY_CLASS$ const& a$KEY_CLASS$) const
- {
- return (iCount == a$KEY_CLASS$.iCount);
- }
- </code K_EQUAL_BODY>
-
-
- <code K_ORDER_BODY>
- ----------------------------------------------------------------
- -- Ordering operator implementation for key type
- ----------------------------------------------------------------
- -- IBoolean operator< ($KEY_CLASS$ const& a$KEY_CLASS$) const
- {
- return (iCount < a$KEY_CLASS$.iCount);
- }
- </code K_ORDER_BODY>
-
- <code K_HASH_BODY>
- ----------------------------------------------------------------
- -- Hash function implementation
- ----------------------------------------------------------------
- -- inline unsigned long hash($KEY_TYPE$ const& a$KEY_CLASS$, unsigned long hashInput)
- {
- <if ($KEY_PTR$)>
- return hash(a$KEY_CLASS$->count(), hashInput);
- <else>
- return hash(a$KEY_CLASS$.count(), hashInput);
- </if>
- }
- </code K_HASH_BODY>
-
-
- </code _K_USER_TDE_>