Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
DBMemento.h
Go to the documentation of this file.
1#ifndef DBMEMENTO_H
2#define DBMEMENTO_H
3
4#include <stack>
5#include <memory>
6
7#include "IDBMemento.h"
8#include "BlockAccessor.h"
9
39class DBMemento : public IDBMemento {
40public:
49 void takeSnapshot(std::shared_ptr<BlockAccessor> blocks);
50
59 void restore(size_t n_steps = 1);
60
69 void print_snapshot_content(size_t n = 0);
70
76 size_t stack_size();
77
78private:
88 static void Overwrite(std::shared_ptr<BlockAccessor>& receiver, std::shared_ptr<BlockAccessor> source);
89
91 std::stack<std::shared_ptr<BlockAccessor>> snapshots;
92};
93
94
95#endif // DBMEMENTO_H
Alias-aware façade for accessing and manipulating multiple parameter blocks.
Interface for snapshotting and restoring BlockAccessor states.
Stack-based implementation of IDBMemento for BlockAccessor.
Definition DBMemento.h:39
size_t stack_size()
Returns the number of snapshots currently stored.
Definition DBMemento.cpp:39
void print_snapshot_content(size_t n=0)
Prints the content of a stored snapshot.
Definition DBMemento.cpp:20
void takeSnapshot(std::shared_ptr< BlockAccessor > blocks)
Takes a snapshot of the given BlockAccessor.
Definition DBMemento.cpp:3
void restore(size_t n_steps=1)
Restores the state n_steps snapshots back.
Definition DBMemento.cpp:7
Abstract interface for memento-like management of BlockAccessor states.
Definition IDBMemento.h:36