1 // Copyright (c) 1997 James Clark 2 // See the file COPYING for copying permission. 3 4 #ifndef SdNode_INCLUDED 5 #define SdNode_INCLUDED 1 6 7 #include "Boolean.h" 8 #include "Node.h" 9 #include "Sd.h" 10 #include "Syntax.h" 11 #include "GroveBuilder.h" 12 13 #ifdef SP_NAMESPACE 14 namespace SP_NAMESPACE { 15 #endif 16 17 #ifdef GROVE_NAMESPACE 18 #define GROVE_NAMESPACE_SCOPE GROVE_NAMESPACE:: 19 #else 20 #define GROVE_NAMESPACE_SCOPE 21 #endif 22 23 class SPGROVE_API SdNode { 24 public: 25 virtual GROVE_NAMESPACE_SCOPE AccessResult 26 getSd(ConstPtr<Sd> &sd, 27 ConstPtr<Syntax> &prologSyntax, 28 ConstPtr<Syntax> &instanceSyntax) const = 0; 29 static const GROVE_NAMESPACE_SCOPE Node::IID iid; convert(const GROVE_NAMESPACE_SCOPE NodePtr & nd)30 static const SdNode *convert(const GROVE_NAMESPACE_SCOPE NodePtr &nd) { 31 const void *p; 32 if (nd && nd->queryInterface(iid, p)) 33 return (const SdNode *)p; 34 else 35 return 0; 36 } 37 }; 38 39 #undef GROVE_NAMESPACE_SCOPE 40 41 #ifdef SP_NAMESPACE 42 } 43 #endif 44 45 #endif /* not SdNode_INCLUDED */ 46