Skip to content

Commit 091ac03

Browse files
committed
Make model reference non-constant
1 parent 0d8c693 commit 091ac03

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/api.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
class API {
77
public:
88
static void initialize(State *state) {
9-
Model::get().set_state(state);
9+
model.set_state(state);
1010
Plankton::get().initialize();
1111
}
1212

1313
static void exec_step(State *state) {
14-
Model::get().set_state(state);
14+
model.set_state(state);
1515
Plankton::get().exec_step();
1616
}
1717

1818
static void report(State *state) {
19-
Model::get().set_state(state);
19+
model.set_state(state);
2020
Plankton::get().report();
2121
}
2222

src/model-access.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ VariableHist::~VariableHist() {
6363
}
6464

6565
static VariableHist storage;
66-
const Model &model = Model::get();
66+
Model &model = Model::get();
6767

6868
Model::Model() : state(nullptr), network(nullptr), openflow(nullptr) {}
6969

src/model-access.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,4 @@ class Model {
121121
ReachCounts *set_reach_counts(ReachCounts &&) const;
122122
};
123123

124-
extern const Model &model;
124+
extern Model &model;

src/plankton.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ void Plankton::ec_sig_handler(int sig) {
333333
/***** functions used by the Promela network model *****/
334334

335335
void Plankton::initialize() {
336-
Model::get().init(&_network, &_openflow);
336+
model.init(&_network, &_openflow);
337337

338338
// processes
339339
_forwarding.init(_network);

0 commit comments

Comments
 (0)