pflib v3.9.5-27-gb09aabf
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
TempParameters.h
1#pragma once
2#ifndef PFLIB_TEMPPARAMETERS_H
3#define PFLIB_TEMPPARAMETERS_H
4
5namespace pflib {
6
25template <class Chip>
27 public:
30 Chip& chip,
32 : chip_{chip} {
33 previous_registers_ = chip_.applyParameters(parameters);
34 }
39 TempParameters& operator=(const TempParameters&) = delete;
41 class Builder {
43 Chip& chip_;
44
45 public:
46 Builder(Chip& chip) : parameters_{}, chip_{chip} {}
47 Builder& add(const std::string& page, const std::string& param,
48 const uint64_t& val) {
49 parameters_[page][param] = val;
50 return *this;
51 }
52 [[nodiscard]] TempParameters apply() {
53 return TempParameters(chip_, parameters_);
54 }
55 };
56
57 private:
59 Chip& chip_;
62};
63
64} // namespace pflib
65
66#endif
Build a TempParameters class parameter by parameters.
Definition TempParameters.h:41
temporarily apply parameters to a chip and then unset them
Definition TempParameters.h:26
Chip & chip_
handle to a Chip that has setRegisters
Definition TempParameters.h:59
~TempParameters()
applies the previous registers back onto the chip
Definition TempParameters.h:36
std::map< int, std::map< int, uint8_t > > previous_registers_
values for previous registers that were touched upon construction
Definition TempParameters.h:61
TempParameters(const TempParameters &)=delete
cannot copy or assign this lock
TempParameters(Chip &chip, const std::map< std::string, std::map< std::string, uint64_t > > &parameters)
applies the new parameters and holds the previous registers
Definition TempParameters.h:29
This version of the fast control code interfaces with the CMS Fast control library which can be contr...
Definition Backend.cxx:3