40#ifndef _uhal_NodeTreeBuilder_hpp_
41#define _uhal_NodeTreeBuilder_hpp_
46#include <boost/filesystem/path.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." )
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." )
113 Node* getNodeTree (
const std::string& aFilenameExpr ,
const boost::filesystem::path& aPath );
116 void clearAddressFileCache();
118 Node* build(
const pugi::xml_node& aNode,
const boost::filesystem::path& aAddressFilePath);
128 void CallBack (
const std::string& aProtocol ,
const boost::filesystem::path& aPath , std::vector<uint8_t>& aFile , std::vector< const Node* >& aAddressTable );
135 void calculateHierarchicalAddresses (
Node* aNode ,
const uint32_t& aAddr );
137 void checkForAddressCollisions (
Node* aNode ,
const boost::filesystem::path& aPath );
144 void setUid (
const bool& aRequireId ,
const pugi::xml_node& aXmlNode ,
Node* aNode );
180 std::unordered_map< std::string , const Node* >
mNodes;
183 static const struct permissions_lut : boost::spirit::qi::symbols<char, defs::NodePermission>
191 static const struct mode_lut : boost::spirit::qi::symbols<char, defs::BlockReadWriteMode>
Wrapper to generate a new Python exception type.
\rst Holds a reference to a Python object (no reference counting)
A heirarchical node for navigating heirarchical firmwares.
A class to build a node tree from an address table file.
NodeTreeBuilder & operator=(const NodeTreeBuilder &)=delete
static const std::string mModeAttribute
static const std::string mTagsAttribute
Parser< Node * > mTopLevelNodeParser
grammars::NodeTreeFirmwareinfoAttributeGrammar mNodeTreeFirmwareInfoAttributeGrammar
static const std::string mSizeAttribute
static const std::string mParametersAttribute
static const std::string mModuleAttribute
std::deque< boost::filesystem::path > mFileCallStack
grammars::NodeTreeClassAttributeGrammar mNodeTreeClassAttributeGrammar
static std::shared_ptr< NodeTreeBuilder > mInstance
The single instance of the class.
static const std::string mAddressAttribute
static const std::string mMaskAttribute
Parser< Node * > mNodeParser
static const std::string mFirmwareInfo
static const std::string mClassAttribute
static const std::string mDescriptionAttribute
std::unordered_map< std::string, const Node * > mNodes
Hash map associating a Node tree with a file name so that we do not need to repeatedly parse the xml ...
grammars::NodeTreeParametersGrammar mNodeTreeParametersGrammar
static const std::string mPermissionsAttribute
NodeTreeBuilder(const NodeTreeBuilder &)=delete
static const std::string mIdAttribute
Forward declaration of the Parser so we can declare it friend.
#define UHAL_DEFINE_EXCEPTION_CLASS(ClassName, ClassDescription)
A look-up table that the boost qi parser uses for associating strings ("single","block",...
A look-up table that the boost qi parser uses for associating strings ("r","w","rw",...
A struct wrapping a set of rules as a grammar that can parse a NodeTreeParametersGrammar of the form ...