40 #ifndef _uhal_Node_hpp_ 41 #define _uhal_Node_hpp_ 48 #include "boost/unordered_map.hpp" 58 class NodeTreeBuilder;
59 class DerivedNodeFactory;
64 UHAL_DEFINE_EXCEPTION_CLASS ( WriteAccessDenied ,
"Exception class to handle the case where a write was performed on a register which does not allow write access." )
66 UHAL_DEFINE_EXCEPTION_CLASS ( ReadAccessDenied , "Exception class to handle the case where a read was performed on a register which does not allow read access." )
68 UHAL_DEFINE_EXCEPTION_CLASS ( NoBranchFoundWithGivenUID , "Exception class to handle the case where a child ID was requested which does not exist." )
70 UHAL_DEFINE_EXCEPTION_CLASS ( BulkTransferOnSingleRegister , "Exception class to handle the case where a bulk read or
write was performed on a single register." )
74 UHAL_DEFINE_EXCEPTION_CLASS ( BulkTransferOffsetRequestedForFifo , "Exception class to handle the case where an offset was requested into a FIFO." )
76 UHAL_DEFINE_EXCEPTION_CLASS ( BulkTransferOffsetRequestedForSingleRegister , "Exception class to handle the case where an offset was requested into a Single Register." )
91 class const_iterator :
public std::iterator< std::forward_iterator_tag , Node , ptrdiff_t, const Node* , const Node& >
94 typedef std::deque< std::deque< Node* >::const_iterator >
stack;
103 const Node& value()
const;
104 const Node& operator*()
const;
105 const Node* operator->()
const;
132 Node (
const Node& aNode );
139 virtual Node& operator= (
const Node& aNode );
145 virtual Node* clone()
const;
162 bool operator == (
const Node& aNode )
const;
170 const Node&
getNode (
const std::string& aId )
const;
178 template<
typename T>
179 const T&
getNode (
const std::string& aId )
const;
186 std::vector<std::string> getNodes()
const;
194 std::vector<std::string> getNodes (
const std::string& aRegex )
const;
201 const std::string& getId()
const;
207 std::string getPath()
const;
213 const uint32_t& getAddress()
const;
219 const uint32_t& getMask()
const;
231 const uint32_t& getSize()
const;
243 const std::string& getTags()
const;
249 const std::string& getDescription()
const;
255 const std::string& getModule()
const;
261 const boost::unordered_map< std::string, std::string >& getParameters()
const;
267 const boost::unordered_map< std::string, std::string >& getFirmwareInfo()
const;
274 void stream ( std::ostream& aStr , std::size_t aIndent = 0 )
const;
297 ValHeader writeBlockOffset (
const std::vector< uint32_t >& aValues ,
const uint32_t& aOffset )
const;
332 void getAncestors ( std::deque< const Node* >& aPath )
const;
A class to build a node tree from an Address table file NOTE! This is a factory method and must be Mu...
hw getNode("SUBSYSTEM1.SUBMODULE.REG").write(x)
boost::unordered_map< std::string, std::string > mFirmwareInfo
parameters to infer the VHDL address decoding
HwInterface * mHw
The parent hardware interface of which this node is a child (or rather decendent) ...
std::string mClassName
Class name used to construct the derived node type.
A class which bundles a node tree and an IPbus client interface together providing everything you nee...
std::deque< std::deque< Node *>::const_iterator > stack
defs::NodePermission mPermission
The read/write access permissions of this node.
#define UHAL_DEFINE_EXCEPTION_CLASS(ClassName, ClassDescription)
defs::BlockReadWriteMode mMode
Whether the node represents a single register, a block of registers or a block-read/write port...
std::string mTags
Optional string which the user can specify.
uint32_t mSize
The maximum size available to a block read/write.
std::string mDescription
Optional string which the user can specify.
std::string mModule
The name of the module in which the current node resides.
boost::unordered_map< std::string, std::string > mParameters
Additional parameters of the node.
uint32_t mPartialAddr
The register address with which this node is associated.
uint32_t mMask
The mask to be applied if this node is a sub-field, rather than an entire register.
A heirarchical node for navigating heirarchical firmwares.
std::deque< Node *> mChildren
The direct children of the node.
A singleton class to register derived nodes, and create instances of them later NOTE! This is a facto...
uint32_t mAddr
The register address with which this node is associated.
An abstract base class for defining the interface to the various IPbus clients as well as providing t...
std::string mUid
The Unique ID of this node.
NodePermission
define Read and Write permissions of a uhal Node
Node * mParent
The parent of the current node.
BlockReadWriteMode
define whether transactions target a single register, a block of registers, a block-read/write port o...
boost::unordered_map< std::string, Node *> mChildrenMap
Helper to assist look-up of a particular child node, given a name.
std::ostream & operator<<(std::ostream &aStr, const uhal::HttpResponseType &aHttpResponse)