μHAL (v2.6.5)
Part of the IPbus software repository
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fixtures.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  Andrew Rose, Imperial College, London
24  email: awr01 <AT> imperial.ac.uk
25 
26  Tom Williams, Rutherford Appleton Laboratory, Oxfordshire
27  email: tom.williams <AT> cern.ch
28 
29 ---------------------------------------------------------------------------
30 */
31 
32 #ifndef _uhal_tests_fixtures_hpp_
33 #define _uhal_tests_fixtures_hpp_
34 
35 
36 #include <stdint.h>
37 #include <string>
38 
39 
41 #include "uhal/HwInterface.hpp"
43 #include "uhal/tests/tools.hpp"
44 
45 
46 namespace uhal {
47 namespace tests {
48 
50 protected:
52  virtual ~AbstractFixture() {}
53 
54 public:
55  static std::string connectionFileURI;
56 };
57 
58 
59 
60 template <DeviceType type> struct MinimalFixture;
61 
62 
63 template <DeviceType type>
64 struct MinimalFixture : public AbstractFixture {
66  virtual ~MinimalFixture();
67 
68  uhal::HwInterface getHwInterface() const;
69 
70  static const DeviceType deviceType;
71 
72 protected:
73  uint16_t devicePort;
74  std::string deviceId;
75 };
76 
77 
78 template <>
80  MinimalFixture();
81  ~MinimalFixture();
82 
83  uhal::HwInterface getHwInterface() const;
84 
85  static const DeviceType deviceType;
86  std::string hardwareToClientFile;
87  std::string clientToHardwareFile;
88  std::string deviceId;
89 };
90 
91 template <DeviceType type>
93 
94 template <>
96 
97 template <>
99 
100 template <>
102 
103 template <>
105 
106 template <>
108 
109 template <>
111 
112 
113 template <DeviceType type>
115 {
116 }
117 
118 template <DeviceType type>
120 {
122  return manager.getDevice(deviceId);
123 }
124 
125 
126 
127 
128 template <DeviceType type>
129 struct DummyHardwareFixture : public MinimalFixture<type> {
132 
134 };
135 
136 
137 template <>
139 
140 template <>
142 
143 template <>
145 
146 template <>
148 
149 template <>
151 
152 template <>
154 
155 template <>
157 
158 
159 } // end ns tests
160 } // end ns uhal
161 
162 
163 #endif
A class which bundles a node tree and an IPbus client interface together providing everything you nee...
Definition: HwInterface.hpp:59
DummyHardwareRunner hwRunner
Definition: fixtures.hpp:133
HwInterface getDevice(const std::string &aId)
Retrieves protocol, host, and port from the connection file to create an IPbus Client Retrieves the a...
static std::string connectionFileURI
Definition: fixtures.hpp:55
uhal::HwInterface getHwInterface() const
Definition: fixtures.hpp:119
A class to open and manage XML connection files and wrap up the interfaces to the NodeTreeBuilder and...
static const DeviceType deviceType
Definition: fixtures.hpp:70