μHAL (v2.6.5)
Part of the IPbus software repository
HwInterface.hpp
Go to the documentation of this file.
1 /*
2 ---------------------------------------------------------------------------
3 
4  This file is part of uHAL.
5 
6  uHAL is a hardware access library and programming framework
7  originally developed for upgrades of the Level-1 trigger of the CMS
8  experiment at CERN.
9 
10  uHAL is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  uHAL is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with uHAL. If not, see <http://www.gnu.org/licenses/>.
22 
23 
24  Andrew Rose, Imperial College, London
25  email: awr01 <AT> imperial.ac.uk
26 
27  Marc Magrans de Abril, CERN
28  email: marc.magrans.de.abril <AT> cern.ch
29 
30 ---------------------------------------------------------------------------
31 */
32 
39 #ifndef _uhal_HwInterface_hpp_
40 #define _uhal_HwInterface_hpp_
41 
42 #include <stdint.h>
43 #include <string>
44 #include <vector>
45 
46 #include <boost/shared_ptr.hpp>
47 
48 #include "uhal/ClientInterface.hpp" // IWYU pragma: keep
49 #include "uhal/Node.hpp" // IWYU pragma: keep
50 
51 
52 namespace boost {
53  template <class Y> class shared_ptr;
54 }
55 
56 namespace uhal
57 {
60  {
61  public:
67  HwInterface ( const boost::shared_ptr<ClientInterface>& aClientInterface , const boost::shared_ptr< Node >& aNode );
68 
75  HwInterface ( const HwInterface& hwInterface );
76 
80  virtual ~HwInterface();
81 
86  ClientInterface& getClient();
87 
92  std::string uri() const;
93 
98  const std::string& id() const;
99 
100 
104  void dispatch ();
105 
110  void setTimeoutPeriod ( const uint32_t& aTimeoutPeriod );
111 
116  uint32_t getTimeoutPeriod();
117 
118  // /**
119  // Ping the target for this client
120  // */
121  // void ping();
122 
127  const Node& getNode () const;
128 
134  const Node& getNode ( const std::string& aId ) const;
135 
141  template< typename T>
142  const T& getNode ( const std::string& aId ) const;
143 
144 
149  std::vector<std::string> getNodes() const;
150 
156  std::vector<std::string> getNodes ( const std::string& aRegex ) const;
157 
158  // /**
159  // Get the target device's reserved address information
160  // @return a Validated Memory which wraps the location to which the reserved address information will be written
161  // */
162  // ValVector< uint32_t > readReservedAddressInfo ();
163 
164  private:
169  void claimNode ( Node& aNode );
170 
173 
176 
177  };
178 
179 }
180 
182 
183 #endif
hw getNode("SUBSYSTEM1.SUBMODULE.REG").write(x)
A class which bundles a node tree and an IPbus client interface together providing everything you nee...
Definition: HwInterface.hpp:59
A heirarchical node for navigating heirarchical firmwares.
Definition: Node.hpp:83
An abstract base class for defining the interface to the various IPbus clients as well as providing t...
std::string uri
Definition: test_single.cpp:89
boost::shared_ptr< ClientInterface > mClientInterface
A shared pointer to the IPbus client through which the transactions will be sent. ...
boost::shared_ptr< Node > mNode
A node tree.