diff --git a/opencog/atomspace/AtomSpace.cc b/opencog/atomspace/AtomSpace.cc index 0140aa7e45..969fa40389 100644 --- a/opencog/atomspace/AtomSpace.cc +++ b/opencog/atomspace/AtomSpace.cc @@ -61,7 +61,7 @@ using namespace opencog; AtomSpace::AtomSpace(AtomSpace* parent, bool transient) : _atom_table(parent? &parent->_atom_table : nullptr, this, transient), _backing_store(nullptr), - _transient(transient) + _read_only(false) { } @@ -79,6 +79,17 @@ void AtomSpace::clear_transient() _atom_table.clear_transient(); } +// An extremely primitive permissions system. +void AtomSpace::set_read_only(void) +{ + _read_only = true; +} + +void AtomSpace::set_read_write(void) +{ + _read_only = false; +} + bool AtomSpace::compare_atomspaces(const AtomSpace& space_first, const AtomSpace& space_second, bool check_truth_values, diff --git a/opencog/atomspace/AtomSpace.h b/opencog/atomspace/AtomSpace.h index 978be16639..0504ec87bc 100644 --- a/opencog/atomspace/AtomSpace.h +++ b/opencog/atomspace/AtomSpace.h @@ -76,7 +76,7 @@ class AtomSpace AtomTable& get_atomtable(void) { return _atom_table; } - bool _transient; + bool _read_only; protected: /** @@ -92,9 +92,16 @@ class AtomSpace AtomSpace(AtomSpace* parent=nullptr, bool transient=false); ~AtomSpace(); + // Transient atomspaces are lighter-weight, faster, but are missing + // some features. They are used during pattern matching, to hold + // temporary results. void ready_transient(AtomSpace* parent); void clear_transient(); + void set_read_only(void); + void set_read_write(void); + bool get_read_only(void) { return _read_only; } + /// Get the environment that this atomspace was created in. AtomSpace* get_environ() const { AtomTable* env = _atom_table.get_environ();