"Fossies" - the Fresh Open Source Software Archive

Member "OpenSP-1.5.2/lib/LpdEntityRef.h" (21 Jul 2005, 1021 Bytes) of package /linux/misc/old/OpenSP-1.5.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "LpdEntityRef.h" see the Fossies "Dox" file reference documentation.

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