diff options
author | Morgan Deters <mdeters@gmail.com> | 2010-07-08 04:33:10 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2010-07-08 04:33:10 +0000 |
commit | 8a0dcb9cb4bbf83f03b31343eaa6437ae829f1c9 (patch) | |
tree | bd25ae92f252eaaea317f543e515ccdbbfc57f05 /src/context/context.h | |
parent | 586c8f2d51d790942fd82598a2bf532f2b5ebc9a (diff) |
context work to support cdmaps with elements allocated in context memory
Diffstat (limited to 'src/context/context.h')
-rw-r--r-- | src/context/context.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/context/context.h b/src/context/context.h index 1aa5fe44d..20e84d7e5 100644 --- a/src/context/context.h +++ b/src/context/context.h @@ -380,6 +380,15 @@ protected: inline void makeCurrent() throw(AssertionException); /** + * Just calls update(), but given a different name for the derived + * class-facing interface. This is a "forced" makeCurrent(), useful + * for ContextObjs allocated in CMM that need a special "bottom" + * case when they disappear out of existence (kind of a destructor). + * See CDOmap (in cdmap.h) for an example. + */ + inline void makeSaveRestorePoint() throw(AssertionException); + + /** * Should be called from sub-class destructor: calls restore until restored * to initial version (version at context level 0). Also removes object from * all Scope lists. Note that this doesn't actually free the memory @@ -438,6 +447,8 @@ protected: return d_pScope->isCurrent(); } +public: + /** * operator new using ContextMemoryManager (common case used by * subclasses during save()). No delete is required for memory @@ -459,8 +470,6 @@ protected: */ static void operator delete(void* pMem, ContextMemoryManager* pCMM) {} -public: - /** * Create a new ContextObj. The initial scope is set to the bottom * scope of the Context. Note that in the common case, the copy @@ -592,6 +601,10 @@ inline void ContextObj::makeCurrent() throw(AssertionException) { } } +inline void ContextObj::makeSaveRestorePoint() throw(AssertionException) { + update(); +} + inline Scope::~Scope() throw(AssertionException) { // Call restore() method on each ContextObj object in the list. // Note that it is the responsibility of restore() to return the |