From: <mk...@us...> - 2003-01-23 19:46:59
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv753/Include/SimData Modified Files: Tag: simdata HashUtility.h InterfaceRegistry.h ns-simdata.h Log Message: fix for hasht_hash Index: HashUtility.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/HashUtility.h,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** HashUtility.h 23 Jan 2003 18:52:12 -0000 1.1.2.7 --- HashUtility.h 23 Jan 2003 19:46:55 -0000 1.1.2.8 *************** *** 60,63 **** --- 60,69 ---- NAMESPACE_SIMDATA + struct HashT; + + extern u4 newhash4_cstring(const char*); + extern HashT newhasht_cstring(const char*); + //extern u8 newhash8_cstring(const char*); + //typedef u8 hasht; struct HashT { *************** *** 75,78 **** --- 81,87 ---- a = x.a; b = x.b; } + HashT(std::string const &x) { + *this = newhasht_cstring(x.c_str()); + } bool operator ==(guint32 x) const { return (b == 0 && a == x); *************** *** 87,95 **** return (b != x.b || a != x.a); } ! void operator =(guint32 x) { a = x; b = 0; } ! void operator =(HashT const &x) { a = x.a; b = x.b; } std::string str() const; --- 96,110 ---- return (b != x.b || a != x.a); } ! HashT & operator =(std::string &x) { ! *this = newhasht_cstring(x.c_str()); ! return *this; ! } ! HashT & operator =(guint32 x) { a = x; b = 0; + return *this; } ! HashT & operator =(HashT const &x) { a = x.a; b = x.b; + return *this; } std::string str() const; *************** *** 99,107 **** - extern u4 newhash4_cstring(const char*); - extern hasht newhasht_cstring(const char*); - //extern u8 newhash8_cstring(const char*); - - struct eqstr { bool operator()(const char* s1, const char* s2) const { --- 114,117 ---- *************** *** 130,135 **** struct hasht_hash { ! bool operator()(hasht i1) const { ! return (i1.a != 0); } }; --- 140,145 ---- struct hasht_hash { ! guint32 operator()(hasht i1) const { ! return i1.a; } }; *************** *** 149,157 **** */ - typedef HASH_MAP<hasht, int, hasht_hash, hasht_eq> hasht_map; class Object; class ObjectProxyBase; typedef HASH_MAP<hasht, Object*, hasht_hash, hasht_eq> cache_map; typedef HASH_MAP<hasht, ObjectProxyBase*, hasht_hash, hasht_eq> proxy_map; --- 159,172 ---- */ class Object; class ObjectProxyBase; + template <class T> + struct HASHT_MAP { + typedef HASH_MAP<hasht, T, hasht_hash, hasht_eq> Type; + }; + + typedef HASH_MAP<hasht, int, hasht_hash, hasht_eq> hasht_map; typedef HASH_MAP<hasht, Object*, hasht_hash, hasht_eq> cache_map; typedef HASH_MAP<hasht, ObjectProxyBase*, hasht_hash, hasht_eq> proxy_map; Index: InterfaceRegistry.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/InterfaceRegistry.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** InterfaceRegistry.h 23 Jan 2003 18:51:00 -0000 1.1.2.3 --- InterfaceRegistry.h 23 Jan 2003 19:46:55 -0000 1.1.2.4 *************** *** 156,161 **** std::vector<InterfaceProxy *> const &getInterfaces() const; - //SWIG_PROTECTED: - public: void addInterface(const char *name, hasht id, InterfaceProxy *proxy) throw(InterfaceError); --- 156,159 ---- Index: ns-simdata.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/ns-simdata.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** ns-simdata.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- ns-simdata.h 23 Jan 2003 19:46:55 -0000 1.1.2.2 *************** *** 48,63 **** #endif - // Use SWIG_PROTECTED and SWIG_PRIVATE for protected and private - // members that should be exported to the Python proxy class (as - // public members) by SWIG. Ordinarily, SWIG only wraps public - // members. - #if defined(SWIG) || defined(SWIGPYTHON) - #define SWIG_PROTECTED public - #define SWIG_PRIVATE public - #else - #define SWIG_PROTECTED protected - #define SWIG_PRIVATE private - #endif - #endif //__NS_SIMDATA_H__ --- 48,51 ---- |