A class which bundles a node tree and an IPbus client interface together providing everything you need to navigate and perform hardware access. More...
#include <uhal/HwInterface.hpp>
Public Member Functions | |
| HwInterface (const std::shared_ptr< ClientInterface > &aClientInterface, const std::shared_ptr< Node > &aNode) | |
| Constructor. More... | |
| HwInterface (const HwInterface &) | |
| Copy Constructor Calls the copy constructor on the ClientInterface Calls the clone method on the Node Tree. More... | |
| virtual | ~HwInterface () |
| Destructor. More... | |
| ClientInterface & | getClient () |
| Get the underlying IPbus client. More... | |
| const std::string & | uri () const |
| Return the url of the target for this client. More... | |
| const std::string & | id () const |
| Return the identifier of the target for this client. More... | |
| void | dispatch () |
| Make the IPbus client issue a dispatch. More... | |
| void | setTimeoutPeriod (const uint32_t &aTimeoutPeriod) |
| A method to modify the timeout period for any pending or future transactions. More... | |
| uint32_t | getTimeoutPeriod () |
| A method to retrieve the timeout period currently being used. More... | |
| const Node & | getNode () const |
| Retrieve the top-level node. More... | |
| bool | hasNode (const std::string &aId) const |
| const Node & | getNode (const std::string &aId) const |
| Retrieve the Node given by a full-stop delimeted name path relative, to the top-level node. More... | |
| template<typename T > | |
| const T & | getNode (const std::string &aId) const |
| Retrieve the Node given by a full-stop delimeted name path relative, to the current node and cast it to a particular node type. More... | |
| std::vector< std::string > | getNodes () const |
| Return all node IDs known to this HwInterface. More... | |
| std::vector< std::string > | getNodes (const std::string &aRegex) const |
| Return all node IDs known to this connection manager which match a (boost) regular expression. More... | |
Private Member Functions | |
| void | claimNode (Node &aNode) |
| A function which sets the HwInterface pointer in the Node to point to this HwInterface. More... | |
Private Attributes | |
| std::shared_ptr< ClientInterface > | mClientInterface |
| A shared pointer to the IPbus client through which the transactions will be sent. More... | |
| std::shared_ptr< Node > | mNode |
| A node tree. More... | |
A class which bundles a node tree and an IPbus client interface together providing everything you need to navigate and perform hardware access.
Definition at line 55 of file HwInterface.hpp.
| uhal::HwInterface::HwInterface | ( | const std::shared_ptr< ClientInterface > & | aClientInterface, |
| const std::shared_ptr< Node > & | aNode | ||
| ) |
Constructor.
| aClientInterface | a shared pointer to a client interface which performs the transport |
| aNode | a shared pointer to a >>freshly cloned<< node representing the >>full<< endpoint structure |
Definition at line 46 of file HwInterface.cpp.
References claimNode(), mClientInterface, and mNode.
| uhal::HwInterface::HwInterface | ( | const HwInterface & | otherHw | ) |
Copy Constructor Calls the copy constructor on the ClientInterface Calls the clone method on the Node Tree.
| hwInterface | a Hardware Interface instance to copy |
Definition at line 55 of file HwInterface.cpp.
References claimNode(), mClientInterface, and mNode.
|
virtual |
Destructor.
Definition at line 64 of file HwInterface.cpp.
|
private |
A function which sets the HwInterface pointer in the Node to point to this HwInterface.
| aNode | a Node that is to be claimed |
Definition at line 69 of file HwInterface.cpp.
References claimNode(), uhal::Node::mChildren, and uhal::Node::mHw.
Referenced by claimNode(), and HwInterface().
| void uhal::HwInterface::dispatch | ( | ) |
Make the IPbus client issue a dispatch.
Definition at line 101 of file HwInterface.cpp.
References mClientInterface.
Referenced by uhal::tests::DummyHardwareFixture< type >::DummyHardwareFixture(), uhal::tests::for(), uhal::tests::job_multiple(), PYBIND11_MODULE(), and uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
| ClientInterface & uhal::HwInterface::getClient | ( | ) |
Get the underlying IPbus client.
Definition at line 78 of file HwInterface.cpp.
References mClientInterface.
Referenced by uhal::tests::DummyHardwareFixture< type >::DummyHardwareFixture(), uhal::Node::getClient(), PYBIND11_MODULE(), uhal::Node::read(), uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(), and uhal::Node::write().
| const Node & uhal::HwInterface::getNode | ( | ) | const |
Retrieve the top-level node.
Definition at line 131 of file HwInterface.cpp.
References mNode.
Referenced by uhal::tests::for(), uhal::tests::job_multiple(), PYBIND11_MODULE(), and uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
| const Node & uhal::HwInterface::getNode | ( | const std::string & | aId | ) | const |
Retrieve the Node given by a full-stop delimeted name path relative, to the top-level node.
| aId | a full-stop delimeted name path to a node, relative to the top-level node |
Definition at line 137 of file HwInterface.cpp.
References mNode.
| const T & uhal::HwInterface::getNode | ( | const std::string & | aId | ) | const |
Retrieve the Node given by a full-stop delimeted name path relative, to the current node and cast it to a particular node type.
| aId | a full-stop delimeted name path to a node, relative to the current node |
Definition at line 39 of file HwInterface.hxx.
References mNode.
| std::vector< std::string > uhal::HwInterface::getNodes | ( | ) | const |
Return all node IDs known to this HwInterface.
Definition at line 149 of file HwInterface.cpp.
References mNode.
Referenced by PYBIND11_MODULE().
| std::vector< std::string > uhal::HwInterface::getNodes | ( | const std::string & | aRegex | ) | const |
Return all node IDs known to this connection manager which match a (boost) regular expression.
| aRegex | a string expression which is converted to a (boost) regular expression against which the node IDs are tested |
Definition at line 155 of file HwInterface.cpp.
References mNode.
| uint32_t uhal::HwInterface::getTimeoutPeriod | ( | ) |
A method to retrieve the timeout period currently being used.
Definition at line 125 of file HwInterface.cpp.
References mClientInterface.
Referenced by PYBIND11_MODULE().
| bool uhal::HwInterface::hasNode | ( | const std::string & | aId | ) | const |
| const std::string & uhal::HwInterface::id | ( | ) | const |
Return the identifier of the target for this client.
Definition at line 107 of file HwInterface.cpp.
References mClientInterface.
Referenced by PYBIND11_MODULE().
| void uhal::HwInterface::setTimeoutPeriod | ( | const uint32_t & | aTimeoutPeriod | ) |
A method to modify the timeout period for any pending or future transactions.
| aTimeoutPeriod | the desired timeout period in milliseconds |
Definition at line 119 of file HwInterface.cpp.
References mClientInterface.
Referenced by uhal::tests::MinimalFixture< type >::getHwInterface(), uhal::tests::MinimalFixture< IPBUS_2_0_PCIE >::getHwInterface(), uhal::tests::job_multiple(), and PYBIND11_MODULE().
| const std::string & uhal::HwInterface::uri | ( | ) | const |
Return the url of the target for this client.
Definition at line 113 of file HwInterface.cpp.
References mClientInterface.
Referenced by PYBIND11_MODULE(), and uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
|
private |
A shared pointer to the IPbus client through which the transactions will be sent.
Definition at line 159 of file HwInterface.hpp.
Referenced by dispatch(), getClient(), getTimeoutPeriod(), HwInterface(), id(), setTimeoutPeriod(), and uri().
|
private |
A node tree.
Definition at line 162 of file HwInterface.hpp.
Referenced by getNode(), getNodes(), hasNode(), and HwInterface().