00001 // $Header: /nfs/slac/g/glast/ground/cvs/xmlUtil/xmlUtil/id/IdConversion.h,v 1.9 2002/04/05 18:28:44 jrb Exp $ 00002 00003 #ifndef XMLUTIL_IDCONVERSION_H 00004 #define XMLUTIL_IDCONVERSION_H 00005 00006 #include <dom/DOM_Element.hpp> 00007 #include "xmlUtil/id/NamedId.h" 00008 #include <functional> 00009 #include <iostream> 00010 00011 namespace xmlUtil { 00012 class IdOperation; 00013 class IdConversion; 00014 std::ostream& operator<<(std::ostream& s, const IdConversion& convers); 00015 00023 class IdConversion { 00024 public: 00027 IdConversion(); 00028 00029 00031 IdConversion(const DOM_Element); 00032 00033 ~IdConversion(); 00034 00035 friend std::ostream& operator<<(std::ostream& s, 00036 const IdConversion& convers); 00037 00039 bool inDomain(const NamedId& inputId); 00040 00042 NamedId * convert(const NamedId& inputId); 00043 // {return new NamedId(*inputId);}; 00044 00045 00047 bool subpathOf(const IdConversion& other) const; 00048 00049 friend class IdConverterLessThan; 00050 private: 00051 00052 // Returns true if inputId satisfies condition 00053 bool satisfies(const NamedId& inputId); 00054 00057 NamedId * internalConvert(const NamedId& inputId); 00058 00060 void makePath(const DOM_Element& pathElt); 00061 00064 void buildOp(const DOM_Element& optElt); 00065 00068 typedef std::string Condition; // may want more complicated 00069 //definition for Condition later 00070 00072 NameSeq *m_path; 00073 00075 Condition *m_condition; 00076 00078 IdOperation *m_op; 00079 }; // end of class IdConversion 00080 } // end of namespace 00081 #endif
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001