40 #ifndef _uhal_NodeTreeBuilder_hpp_
41 #define _uhal_NodeTreeBuilder_hpp_
44 #include <boost/filesystem/path.hpp>
45 #include <boost/noncopyable.hpp>
46 #include <boost/shared_ptr.hpp>
47 #include <boost/spirit/include/qi.hpp>
65 UHAL_DEFINE_EXCEPTION_CLASS ( NodeMustHaveUID ,
"Exception class to handle the case where creation of a node was attempted without it having a UID." )
67 UHAL_DEFINE_EXCEPTION_CLASS ( IncorrectAddressTableFileCount , "Exception class to handle the case where too many or two few address files are specified." )
69 UHAL_DEFINE_EXCEPTION_CLASS ( FailedToOpenAddressTableFile , "Exception class to handle the case where the address file failed to open." )
71 UHAL_DEFINE_EXCEPTION_CLASS ( IncrementalNodeRequiresSizeAttribute , "Exception class to handle the case where an incremental node is specified without a size attribute." )
73 UHAL_DEFINE_EXCEPTION_CLASS ( ArraySizeExceedsRegisterBound , "Exception class to handle the case where a memory block has a size which would exceed the available register space." )
76 UHAL_DEFINE_EXCEPTION_CLASS ( BlockAccessNodeCannotHaveChild , "Exception class to handle the case when someone tries to give a block access node a child." )
79 UHAL_DEFINE_EXCEPTION_CLASS ( MaskedNodeCannotHaveChild , "Exception class to handle the case when someone tries to give a bit-masked node a child." )
112 Node* getNodeTree (
const std::string& aFilenameExpr ,
const boost::filesystem::path& aPath );
115 void clearAddressFileCache();
117 Node* build(
const pugi::xml_node& aNode,
const boost::filesystem::path& aAddressFilePath);
127 void CallBack (
const std::string& aProtocol ,
const boost::filesystem::path& aPath , std::vector<uint8_t>& aFile , std::vector< const Node* >& aAddressTable );
134 void calculateHierarchicalAddresses (
Node* aNode ,
const uint32_t& aAddr );
136 void checkForAddressCollisions (
Node* aNode ,
const boost::filesystem::path& aPath );
143 void setUid (
const bool& aRequireId ,
const pugi::xml_node& aXmlNode ,
Node* aNode );
179 boost::unordered_map< std::string , const Node* >
mNodes;
182 static const struct permissions_lut : boost::spirit::qi::symbols<char, defs::NodePermission>
190 static const struct mode_lut : boost::spirit::qi::symbols<char, defs::BlockReadWriteMode>