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 boost::shared_ptr< ClientInterface > &aClientInterface, const boost::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... | |
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 | |
boost::shared_ptr< ClientInterface > | mClientInterface |
A shared pointer to the IPbus client through which the transactions will be sent. More... | |
boost::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 60 of file HwInterface.hpp.
uhal::HwInterface::HwInterface | ( | const boost::shared_ptr< ClientInterface > & | aClientInterface, |
const boost::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 49 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 58 of file HwInterface.cpp.
References claimNode(), mClientInterface, and mNode.
|
virtual |
Destructor.
Definition at line 67 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 72 of file HwInterface.cpp.
References uhal::Node::mChildren, and uhal::Node::mHw.
Referenced by HwInterface().
void uhal::HwInterface::dispatch | ( | ) |
Make the IPbus client issue a dispatch.
Definition at line 106 of file HwInterface.cpp.
References mClientInterface.
Referenced by uhal::tests::DummyHardwareFixture< type >::DummyHardwareFixture(), uhal::tests::for(), uhal::tests::job_multiple(), and uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
ClientInterface & uhal::HwInterface::getClient | ( | ) |
Get the underlying IPbus client.
Definition at line 83 of file HwInterface.cpp.
References mClientInterface.
Referenced by uhal::tests::DummyHardwareFixture< type >::DummyHardwareFixture(), uhal::Node::getClient(), 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 135 of file HwInterface.cpp.
References mNode.
Referenced by uhal::tests::for(), uhal::tests::job_multiple(), 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 141 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 147 of file HwInterface.cpp.
References mNode.
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 153 of file HwInterface.cpp.
References mNode.
uint32_t uhal::HwInterface::getTimeoutPeriod | ( | ) |
A method to retrieve the timeout period currently being used.
Definition at line 130 of file HwInterface.cpp.
References mClientInterface.
const std::string & uhal::HwInterface::id | ( | ) | const |
Return the identifier of the target for this client.
Definition at line 112 of file HwInterface.cpp.
References mClientInterface.
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 124 of file HwInterface.cpp.
References mClientInterface.
Referenced by uhal::tests::MinimalFixture< type >::getHwInterface(), uhal::tests::MinimalFixture< IPBUS_2_0_PCIE >::getHwInterface(), and uhal::tests::job_multiple().
const std::string & uhal::HwInterface::uri | ( | ) | const |
Return the url of the target for this client.
Definition at line 118 of file HwInterface.cpp.
References mClientInterface.
Referenced by 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 162 of file HwInterface.hpp.
Referenced by dispatch(), getClient(), getTimeoutPeriod(), HwInterface(), id(), setTimeoutPeriod(), and uri().
|
private |
A node tree.
Definition at line 165 of file HwInterface.hpp.
Referenced by getNode(), getNodes(), and HwInterface().