Add mutable bool active member to PyAction

This commit is contained in:
Joakim Hove
2020-03-22 19:31:12 +01:00
parent 4b687e3368
commit 4c25ce69c1
2 changed files with 6 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ public:
const std::string& name() const;
bool operator==(const PyAction& other) const;
PyAction::RunCount run_count() const;
bool active() const;
~PyAction();
/*
@@ -75,6 +76,7 @@ private:
RunCount m_run_count;
std::string input_code;
void * m_storage = nullptr;
mutable bool m_active = true;
};
}

View File

@@ -93,6 +93,10 @@ PyAction::RunCount PyAction::run_count() const {
return this->m_run_count;
}
bool PyAction::active() const {
return this->m_active;
}
/*
The python variables are reference counted and when the Python dictionary
stored in this->m_storage is destroyed the Python runtime system is involved.