Generic hardware access library
/home/cschwick/hal/generic/include/hal/DOMToVMEMapConverter.hh
Go to the documentation of this file.
00001 #ifndef __DOMToVMEMapConverter
00002 #define __DOMToVMEMapConverter
00003 
00004 #include <strings.h>
00005 #include <list>
00006 
00007 #include <xercesc/util/PlatformUtils.hpp>
00008 #include <xercesc/sax/SAXException.hpp>
00009 #include <xercesc/sax/SAXParseException.hpp>
00010 #include <xercesc/parsers/XercesDOMParser.hpp>
00011 #include <xercesc/dom/DOMDocument.hpp>
00012 #include <xercesc/dom/DOMException.hpp>
00013 #include <xercesc/dom/DOMNamedNodeMap.hpp>
00014 #include <xercesc/dom/DOMNodeList.hpp>
00015 #include "hal/AddressTableItem.hh"
00016 #include "hal/XMLProcessingException.hh"
00017 #include "hal/VMEHardwareAddress.hh"
00018 #include "hal/VME64xHardwareAddress.hh"
00019 
00020 namespace HAL {
00021 
00038 class DOMToVMEMapConverter {
00039 public:
00046   static void convert( XERCES_CPP_NAMESPACE::DOMDocument* doc, 
00047                        std::list<AddressTableItem*>& itemPointerList )
00048     throw( XMLProcessingException );
00049 
00050 private:
00051   static void processNode(XERCES_CPP_NAMESPACE::DOMNode* item, 
00052                           std::list<AddressTableItem*>& itemPointerList)
00053     throw( XMLProcessingException );
00054 
00055   static void getString( const XERCES_CPP_NAMESPACE::DOMNode* node, std::string& text);
00056 
00057   static void getUnsignedLong( const XERCES_CPP_NAMESPACE::DOMNode* node, uint32_t& number);
00058 
00059   static bool findNamedChild( const XERCES_CPP_NAMESPACE::DOMNode* node, std::string nodeName, uint32_t& value);
00060 
00061   static bool findNamedChild( const XERCES_CPP_NAMESPACE::DOMNode* node, std::string nodeName, std::string& value);
00062 };
00063 
00064 } /* namespace HAL */
00065 
00066 #endif /* __DOMToVMEMapConverter */