40#ifndef _uhal_Node_hpp_
41#define _uhal_Node_hpp_
47#include <unordered_map>
59 class NodeTreeBuilder;
60 class DerivedNodeFactory;
65 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." )
67 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." )
71 UHAL_DEFINE_EXCEPTION_CLASS ( BulkTransferOnSingleRegister , "Exception class to
handle the case where a bulk read or write was performed on a single register." )
77 UHAL_DEFINE_EXCEPTION_CLASS ( BulkTransferOffsetRequestedForSingleRegister , "Exception class to
handle the case where an offset was requested into a Single Register." )
92 class const_iterator :
public std::iterator< std::forward_iterator_tag , Node , ptrdiff_t, const Node* , const Node& >
95 typedef std::deque< std::vector< Node* >::const_iterator >
stack;
104 const Node& value()
const;
105 const Node& operator*()
const;
106 const Node* operator->()
const;
138 virtual Node& operator= (
const Node& aNode );
144 virtual Node* clone()
const;
161 bool hasNode (
const std::string& aId )
const;
168 const Node& getNode (
const std::string& aId )
const;
175 template<
typename T>
176 const T& getNode (
const std::string& aId )
const;
182 std::vector<std::string> getNodes()
const;
189 std::vector<std::string> getNodes (
const std::string& aRegex )
const;
195 const std::string& getId()
const;
201 std::string getPath()
const;
207 const uint32_t& getAddress()
const;
213 const uint32_t& getMask()
const;
225 const uint32_t& getSize()
const;
237 const std::string& getTags()
const;
243 const std::string& getDescription()
const;
249 const std::string& getModule()
const;
255 const std::unordered_map< std::string, std::string >& getParameters()
const;
261 const std::unordered_map< std::string, std::string >& getFirmwareInfo()
const;
268 void stream ( std::ostream& aStr , std::size_t aIndent = 0 )
const;
275 ValHeader write (
const uint32_t& aValue )
const;
282 ValHeader writeBlock (
const std::vector< uint32_t >& aValues )
const;
290 ValHeader writeBlockOffset (
const std::vector< uint32_t >& aValues ,
const uint32_t& aOffset )
const;
320 std::vector<const Node*> getLineage(
const Node& aAncestor)
const;
323 bool isChildOf(
const Node& aParent)
const;
327 std::string getRelativePath(
const Node& aAncestor)
const;
330 void getAncestors ( std::deque< const Node* >& aPath )
const;
Wrapper to generate a new Python exception type.
\rst Holds a reference to a Python object (no reference counting)
An abstract base class for defining the interface to the various IPbus clients as well as providing t...
A singleton class to register derived nodes, and create instances of them later NOTE!...
A class which bundles a node tree and an IPbus client interface together providing everything you nee...
std::deque< std::vector< Node * >::const_iterator > stack
A heirarchical node for navigating heirarchical firmwares.
std::unordered_map< std::string, std::string > mFirmwareInfo
parameters to infer the VHDL address decoding
std::vector< Node * > mChildren
The direct children of the node.
uint32_t mAddr
The register address with which this node is associated.
defs::BlockReadWriteMode mMode
Whether the node represents a single register, a block of registers or a block-read/write port.
uint32_t mMask
The mask to be applied if this node is a sub-field, rather than an entire register.
std::unordered_map< std::string, Node * > mChildrenMap
Helper to assist look-up of a particular child node, given a name.
std::string mUid
The Unique ID of this node.
std::string mClassName
Class name used to construct the derived node type.
std::string mDescription
Optional string which the user can specify.
std::unordered_map< std::string, std::string > mParameters
Additional parameters of the node.
defs::NodePermission mPermission
The read/write access permissions of this node.
std::string mModule
The name of the module in which the current node resides.
uint32_t mPartialAddr
The register address with which this node is associated.
uint32_t mSize
The maximum size available to a block read/write.
std::string mTags
Optional string which the user can specify.
HwInterface * mHw
The parent hardware interface of which this node is a child (or rather decendent)
Node * mParent
The parent of the current node.
A class to build a node tree from an address table file.
#define UHAL_DEFINE_EXCEPTION_CLASS(ClassName, ClassDescription)
BlockReadWriteMode
define whether transactions target a single register, a block of registers, a block-read/write port o...
NodePermission
define Read and Write permissions of a uhal Node
std::ostream & operator<<(std::ostream &aStr, const uhal::HttpResponseType &aHttpResponse)
T cast(const handle &handle)
bool operator==(const HashMe &lhs, const HashMe &rhs)