Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/express/hashVal.I

Go to the documentation of this file.
00001 // Filename: hashVal.I
00002 // Created by:  drose (14Nov00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 
00020 ////////////////////////////////////////////////////////////////////
00021 //     Function: HashVal::Constructor
00022 //       Access: Published
00023 //  Description:
00024 ////////////////////////////////////////////////////////////////////
00025 INLINE HashVal::
00026 HashVal() {
00027   hv[0] = hv[1] = hv[2] = hv[3] = 0;
00028 }
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //     Function: HashVal::Copy Constructor
00032 //       Access: Published
00033 //  Description:
00034 ////////////////////////////////////////////////////////////////////
00035 INLINE HashVal::
00036 HashVal(const HashVal &copy) {
00037   hv[0] = copy.hv[0];
00038   hv[1] = copy.hv[1];
00039   hv[2] = copy.hv[2];
00040   hv[3] = copy.hv[3];
00041 }
00042 
00043 ////////////////////////////////////////////////////////////////////
00044 //     Function: HashVal::operator ==
00045 //       Access: Published
00046 //  Description:
00047 ////////////////////////////////////////////////////////////////////
00048 INLINE bool HashVal::
00049 operator == (const HashVal &other) const {
00050   return (hv[0] == other.hv[0] &&
00051           hv[1] == other.hv[1] &&
00052           hv[2] == other.hv[2] &&
00053           hv[3] == other.hv[3]);
00054 }
00055 
00056 ////////////////////////////////////////////////////////////////////
00057 //     Function: HashVal::operator !=
00058 //       Access: Published
00059 //  Description:
00060 ////////////////////////////////////////////////////////////////////
00061 INLINE bool HashVal::
00062 operator != (const HashVal &other) const {
00063   return !operator == (other);
00064 }
00065 
00066 ////////////////////////////////////////////////////////////////////
00067 //     Function: HashVal::get_value
00068 //       Access: Published
00069 //  Description: Returns the integer value of the indicated component.
00070 ////////////////////////////////////////////////////////////////////
00071 INLINE uint HashVal::
00072 get_value(int val) const {
00073   nassertr(val >= 0 && val < 4, 0);
00074   return hv[val];
00075 }
00076 
00077 
00078 ////////////////////////////////////////////////////////////////////
00079 //     Function: HashVal::set_value
00080 //       Access: Published
00081 //  Description: Sets the hash value at index val
00082 ////////////////////////////////////////////////////////////////////
00083 INLINE void HashVal::
00084 set_value(int val, uint hashval) {
00085   nassertv(val >= 0 && val < 4);
00086   hv[val] = hashval;
00087 }
00088 
00089 
00090 ////////////////////////////////////////////////////////////////////
00091 //     Function: HashVal::output
00092 //       Access: Published
00093 //  Description: The output method does not itself output enclosing
00094 //               brackets, but the ostream operator << does.
00095 ////////////////////////////////////////////////////////////////////
00096 INLINE void HashVal::
00097 output(ostream &out) const {
00098   out << hv[0] << " " << hv[1] << " " << hv[2] << " " << hv[3];
00099 }

Generated on Fri May 2 00:38:24 2003 for Panda by doxygen1.3