Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

rel_eqclass.h

Go to the documentation of this file.
00001 /* ===========================================================================
00002  *        Filename:  rel_eqclass.h
00003  *     Description:  Relation equality class
00004  * 
00005  *         Version:  $Rev: 11 $
00006  *         Changed:  $Date: 2005-08-04 17:58:36 -0400 (Do, 04 Aug 2005) $
00007  *         Licence:  GPL (read COPYING file for details)
00008  * 
00009  *          Author:  Erich Schubert (eS), erich@debian.org
00010  *                   Institut für Informatik, LMU München
00011  * ======================================================================== */
00012 #ifndef  SSD_REL_EQCLASS_H
00013 #define  SSD_REL_EQCLASS_H
00014 #include "config.h"
00015 #include "ustring.h"
00016 
00017 namespace SSD {
00018 
00019 class Node;
00020 class NodeEqClass;
00021 
00024 class RelEqClass {
00026         ustring fl;
00028         ustring fc;
00030         ustring sl;
00032         ustring sc;
00033 public:
00037         RelEqClass(const Node& n1, const Node& n2);
00041         RelEqClass(const Node* n1, const Node* n2);
00045         RelEqClass(const Node& n1, const NodeEqClass& n2);
00049         RelEqClass(const NodeEqClass& n1, const Node& n2);
00050 
00053         bool operator<(const RelEqClass r2) const {
00054                 if (fl != r2.fl) return fl < r2.fl;
00055                 if (fc != r2.fc) return fc < r2.fc;
00056                 if (sl != r2.sl) return sl < r2.sl;
00057                                  return sc < r2.sc;
00058         }
00061         bool operator==(const RelEqClass r2) const {
00062                 return (fl == r2.fl) && (fc == r2.fc) && (sl == r2.sl) && (sc == r2.sc);
00063         }
00064 
00066         size_t hashfun() const {
00067                 size_t h2 = fc.hashfun();
00068                 size_t h3 = sl.hashfun();
00069                 size_t h4 = sc.hashfun();
00070                 return fl.hashfun() ^ (h2 << 16) ^ (h2 >> 16) ^ (h3 << 8) ^ (h3 >> 24) ^ (h4 << 24) ^ (h4 >> 8); }
00071 
00075         friend std::ostream &operator<<(std::ostream &out, const SSD::RelEqClass& cp);
00076 };
00077 
00079 struct hash_releqc {
00081         size_t operator()(const RelEqClass req) const { return req.hashfun(); };
00082 };
00083 }
00084 #endif

Generated on Thu Aug 4 17:57:12 2005 for SSDDiff by  doxygen 1.4.3-20050530