| 195 | } |
| 196 | |
| 197 | ContextObj* ContextObj::restoreAndContinue() |
| 198 | { |
| 199 | // Variable to hold next object in list |
| 200 | ContextObj* pContextObjNext; |
| 201 | |
| 202 | // Check the restore pointer. If NULL, this must be the bottom Scope |
| 203 | if(d_pContextObjRestore == NULL) { |
| 204 | // might not be bottom scope, since objects allocated in context |
| 205 | // memory don't get linked to scope 0 |
| 206 | // |
| 207 | // Assert(d_pScope == d_pScope->getContext()->getBottomScope()) << |
| 208 | // "Expected bottom scope"; |
| 209 | |
| 210 | Debug("context") << "NULL restore object! " << this << std::endl; |
| 211 | pContextObjNext = d_pContextObjNext; |
| 212 | |
| 213 | // Nothing else to do |
| 214 | } else { |
| 215 | // Call restore to update the subclass data |
| 216 | restore(d_pContextObjRestore); |
| 217 | |
| 218 | // Remember the next object in the list |
| 219 | pContextObjNext = d_pContextObjNext; |
| 220 | |
| 221 | // Restore the base class data |
| 222 | d_pScope = d_pContextObjRestore->d_pScope; |
| 223 | next() = d_pContextObjRestore->d_pContextObjNext; |
| 224 | prev() = d_pContextObjRestore->d_ppContextObjPrev; |
| 225 | d_pContextObjRestore = d_pContextObjRestore->d_pContextObjRestore; |
| 226 | |
| 227 | // Re-link this ContextObj to the list in this scope |
| 228 | if(next() != NULL) { |
| 229 | next()->prev() = &next(); |
| 230 | } |
| 231 | *prev() = this; |
| 232 | } |
| 233 | |
| 234 | // Return the next object in the list |
| 235 | return pContextObjNext; |
| 236 | } |
| 237 | |
| 238 | void ContextObj::destroy() |
| 239 | { |