|
μHAL (v2.7.9)
Part of the IPbus software repository
|
Go to the documentation of this file.
40 #ifndef _uhal_Node_hpp_
41 #define _uhal_Node_hpp_
49 #include "boost/unordered_map.hpp"
60 class NodeTreeBuilder;
61 class DerivedNodeFactory;
66 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." )
68 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." )
70 UHAL_DEFINE_EXCEPTION_CLASS ( NoBranchFoundWithGivenUID , "Exception class to handle the case where a child ID was requested which does not exist." )
72 UHAL_DEFINE_EXCEPTION_CLASS ( BulkTransferOnSingleRegister , "Exception class to handle the case where a bulk read or
write was performed on a single register." )
76 UHAL_DEFINE_EXCEPTION_CLASS ( BulkTransferOffsetRequestedForFifo , "Exception class to handle the case where an offset was requested into a FIFO." )
78 UHAL_DEFINE_EXCEPTION_CLASS ( BulkTransferOffsetRequestedForSingleRegister , "Exception class to handle the case where an offset was requested into a Single Register." )
93 class const_iterator :
public std::iterator< std::forward_iterator_tag , Node , ptrdiff_t, const Node* , const Node& >
96 typedef std::deque< std::vector< Node* >::const_iterator >
stack;
105 const Node& value()
const;
106 const Node& operator*()
const;
107 const Node* operator->()
const;
139 virtual Node& operator= (
const Node& aNode );
145 virtual Node* clone()
const;
160 bool operator == (
const Node& aNode )
const;
167 const Node&
getNode (
const std::string& aId )
const;
174 template<
typename T>
175 const T&
getNode (
const std::string& aId )
const;
181 std::vector<std::string> getNodes()
const;
188 std::vector<std::string> getNodes (
const std::string& aRegex )
const;
194 const std::string& getId()
const;
200 std::string getPath()
const;
206 const uint32_t& getAddress()
const;
212 const uint32_t& getMask()
const;
224 const uint32_t& getSize()
const;
236 const std::string& getTags()
const;
242 const std::string& getDescription()
const;
248 const std::string& getModule()
const;
254 const boost::unordered_map< std::string, std::string >& getParameters()
const;
260 const boost::unordered_map< std::string, std::string >& getFirmwareInfo()
const;
267 void stream ( std::ostream& aStr , std::size_t aIndent = 0 )
const;
289 ValHeader writeBlockOffset (
const std::vector< uint32_t >& aValues ,
const uint32_t& aOffset )
const;
319 std::vector<const Node*> getLineage(
const Node& aAncestor)
const;
322 bool isChildOf(
const Node& aParent)
const;
326 std::string getRelativePath(
const Node& aAncestor)
const;
329 void getAncestors ( std::deque< const Node* >& aPath )
const;
A class which bundles a node tree and an IPbus client interface together providing everything you nee...
std::string mTags
Optional string which the user can specify.
std::ostream & operator<<(std::ostream &aStr, const uhal::HttpResponseType &aHttpResponse)
#define UHAL_DEFINE_EXCEPTION_CLASS(ClassName, ClassDescription)
std::deque< std::vector< Node * >::const_iterator > stack
std::string mModule
The name of the module in which the current node resides.
NodePermission
define Read and Write permissions of a uhal Node
uint32_t mAddr
The register address with which this node is associated.
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)
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.
std::string mDescription
Optional string which the user can specify.
Node * mParent
The parent of the current node.
A singleton class to register derived nodes, and create instances of them later NOTE!...
uint32_t mPartialAddr
The register address with which this node is associated.
std::vector< Node * > mChildren
The direct children of the node.
A class to build a node tree from an Address table file NOTE! This is a factory method and must be Mu...
defs::BlockReadWriteMode mMode
Whether the node represents a single register, a block of registers or a block-read/write port.
A heirarchical node for navigating heirarchical firmwares.
BlockReadWriteMode
define whether transactions target a single register, a block of registers, a block-read/write port o...
std::string mClassName
Class name used to construct the derived node type.
hw getNode("REG").write(x)
uint32_t mSize
The maximum size available to a block read/write.
defs::NodePermission mPermission
The read/write access permissions of this node.
boost::unordered_map< std::string, Node * > mChildrenMap
Helper to assist look-up of a particular child node, given a name.
uint32_t mMask
The mask to be applied if this node is a sub-field, rather than an entire register.
boost::unordered_map< std::string, std::string > mParameters
Additional parameters of the node.