Scope guard that temporarily changes the operation mode of one or more RooAbsArg instances.
Each call to change() records the arg's current operMode before flipping it to the requested mode (non-recursively, i.e. value clients are not touched). Destruction (or an explicit clear()) restores every recorded mode in LIFO order.
The class is movable but not copyable, so it can be returned from functions that build up a batch of changes to hand to the caller.
Definition at line 57 of file RooFitImplHelpers.h.
Public Member Functions | |
| ChangeOperModeRAII ()=default | |
| ChangeOperModeRAII (ChangeOperModeRAII &&)=default | |
| ChangeOperModeRAII (ChangeOperModeRAII const &)=delete | |
| ChangeOperModeRAII (RooAbsArg *arg, RooAbsArg::OperMode opMode) | |
| Convenience ctor: behaves like a scope guard for a single arg. | |
| ~ChangeOperModeRAII () | |
| void | change (RooAbsArg *arg, RooAbsArg::OperMode opMode) |
| Record arg's current operMode and flip it to opMode. | |
| void | clear () |
| Restore every recorded change right away, emptying this guard. | |
| bool | empty () const |
| ChangeOperModeRAII & | operator= (ChangeOperModeRAII &&)=default |
| ChangeOperModeRAII & | operator= (ChangeOperModeRAII const &)=delete |
Private Attributes | |
| std::vector< std::pair< RooAbsArg *, RooAbsArg::OperMode > > | _entries |
#include </github/home/ROOT-CI/src/roofit/roofitcore/res/RooFitImplHelpers.h>
|
default |
|
inline |
Convenience ctor: behaves like a scope guard for a single arg.
Definition at line 62 of file RooFitImplHelpers.h.
|
inline |
Definition at line 64 of file RooFitImplHelpers.h.
|
default |
|
delete |
|
inline |
Record arg's current operMode and flip it to opMode.
If the current mode already equals opMode, this is a no-op (nothing to restore).
Definition at line 73 of file RooFitImplHelpers.h.
|
inline |
Restore every recorded change right away, emptying this guard.
Definition at line 82 of file RooFitImplHelpers.h.
|
inline |
Definition at line 90 of file RooFitImplHelpers.h.
|
default |
|
delete |
|
private |
Definition at line 93 of file RooFitImplHelpers.h.