1 // Copyright (c) 1994 James Clark 2 // See the file COPYING for copying permission. 3 #pragma ident "%Z%%M% %I% %E% SMI" 4 5 #ifndef LpdEntityRef_INCLUDED 6 #define LpdEntityRef_INCLUDED 1 7 8 #include "Entity.h" 9 #include "Boolean.h" 10 #include "Ptr.h" 11 12 // Information about a reference to an entity that 13 // used a definition in an LPD. 14 15 #ifdef SP_NAMESPACE 16 namespace SP_NAMESPACE { 17 #endif 18 19 struct LpdEntityRef { 20 ConstPtr<Entity> entity; 21 PackedBoolean lookedAtDefault; 22 PackedBoolean foundInPass1Dtd; keyLpdEntityRef23 static inline const LpdEntityRef &key(const LpdEntityRef &r) { return r; } hashLpdEntityRef24 static inline unsigned long hash(const LpdEntityRef &r) { 25 return Hash::hash(r.entity->name()); 26 } 27 }; 28 29 inline 30 Boolean operator==(const LpdEntityRef &r1, const LpdEntityRef &r2) 31 { 32 return (r1.entity == r2.entity 33 && r1.foundInPass1Dtd == r2.foundInPass1Dtd 34 && r1.lookedAtDefault == r2.lookedAtDefault); 35 } 36 37 inline 38 Boolean operator!=(const LpdEntityRef &r1, const LpdEntityRef &r2) 39 { 40 return !(r1 == r2); 41 } 42 43 #ifdef SP_NAMESPACE 44 } 45 #endif 46 47 #endif /* not LpdEntityRef_INCLUDED */ 48