pflib v3.9.5-27-gb09aabf
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
pflib::TempParameters< Chip > Class Template Reference

temporarily apply parameters to a chip and then unset them More...

#include <TempParameters.h>

Collaboration diagram for pflib::TempParameters< Chip >:
[legend]

Classes

class  Builder
 Build a TempParameters class parameter by parameters. More...
 

Public Member Functions

 TempParameters (Chip &chip, const std::map< std::string, std::map< std::string, uint64_t > > &parameters)
 applies the new parameters and holds the previous registers
 
 ~TempParameters ()
 applies the previous registers back onto the chip
 
 TempParameters (const TempParameters &)=delete
 cannot copy or assign this lock
 
TempParametersoperator= (const TempParameters &)=delete
 

Private Attributes

Chip & chip_
 handle to a Chip that has setRegisters
 
std::map< int, std::map< int, uint8_t > > previous_registers_
 values for previous registers that were touched upon construction
 

Detailed Description

template<class Chip>
class pflib::TempParameters< Chip >

temporarily apply parameters to a chip and then unset them

We apply the parameters to the chip in the constructor and then unset them in the destructor. For example

// before, PAGE.PARAM = 1
{
TempParameters<ROC> temp_param_lock{roc, {"PAGE", {"PARAM", 3}}};
// here, PAGE.PARAM = 3
}
// after temp_param_lock is destructed, PAGE.PARAM = 1 again
temporarily apply parameters to a chip and then unset them
Definition TempParameters.h:26
static void roc(const std::string &cmd, Target *pft)
ROC menu commands.
Definition roc.cxx:122

This class also has a Builder sub-class which can be helpful for constructing a set of parameters.


The documentation for this class was generated from the following file: