From 4080de9f5b8aa0c4dd87e9b28570c96e2146362e Mon Sep 17 00:00:00 2001 From: tchernobog Date: Fri, 15 Sep 2006 09:48:58 +0000 Subject: [PATCH] - Make set_notify_enabled() methods of Simulation and History private to enforce encapsulation further (so that derived classes don't fall in temptation...) git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1171 3ecf2c5c-341e-0410-92b4-d18e462d057c --- src/backend/sgpemv2/history.hh | 8 +++++--- src/backend/sgpemv2/simulation.hh | 12 +++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/backend/sgpemv2/history.hh b/src/backend/sgpemv2/history.hh index 100bd93..6148d17 100644 --- a/src/backend/sgpemv2/history.hh +++ b/src/backend/sgpemv2/history.hh @@ -146,6 +146,9 @@ namespace sgpem void notify_change(); + position _front; + + private: /** \brief Enable/disable notifications to registered observers * * This is quite useful to disable momentarily notification while you @@ -156,9 +159,6 @@ namespace sgpem */ bool set_notify_enabled(bool enabled = true); - position _front; - - private: bool _notify; }; //~ class History @@ -169,6 +169,8 @@ namespace sgpem * History that would reset it / notify its observers. For example, when loading * from a file. In this case, create an object of this type on the stack. * The destructor will take care of re-enabling notifications. + * + * Locks can be taken recursively without fear. */ class SG_DLLEXPORT History::LockNotify { diff --git a/src/backend/sgpemv2/simulation.hh b/src/backend/sgpemv2/simulation.hh index 69275b0..b895c2c 100644 --- a/src/backend/sgpemv2/simulation.hh +++ b/src/backend/sgpemv2/simulation.hh @@ -177,6 +177,11 @@ namespace sgpem typedef std::vector RegisteredObservers; RegisteredObservers _observers; + Simulation(); // Constructor + + void notify_change(); + + private: /** \brief Enable/disable notifications to registered observers * * This is quite useful to disable momentarily notification while you @@ -187,11 +192,6 @@ namespace sgpem */ bool set_notify_enabled(bool enabled = true); - Simulation(); // Constructor - - void notify_change(); - - private: bool _notify; }; //~ class Simulation @@ -201,6 +201,8 @@ namespace sgpem * Simulation that would reset it / notify its observers. For example, when loading * from a file. In this case, create an object of this type on the stack. * The destructor will take care of re-enabling notifications. + * + * Locks can be taken recursively without fear. */ class SG_DLLEXPORT Simulation::LockNotify {