22 #ifndef _cvc3__include__context_h_
23 #define _cvc3__include__context_h_
44 class ContextNotifyObj;
46 class ContextObjChain;
104 mm->deleteData(pMem);
106 void operator delete(
void*) { }
169 return mm->newData(size);
172 mm->deleteData(pMem);
175 void operator delete(
void*) { }
179 void*
operator new(
size_t size,
bool b) {
182 void operator delete(
void* pMem,
bool b) {
216 void update(
int scope = -1);
223 DebugAssert(co.d_active,
"ContextObj["+co.name()+
"] copy constructor");
230 DebugAssert(
false,
"ContextObj::operator=(): shouldn't be called");
241 "ContextObj::restoreData(): call in the base abstract class");
249 virtual void setNull(
void) = 0;
252 IF_DEBUG(
virtual std::string name()
const {
return d_name; })
269 int level()
const {
return (d_scope==NULL)? 0 : d_scope->level(); }
271 if(scope >= 0)
return d_scope->level() == scope;
272 else return d_scope->isCurrent();
274 void makeCurrent(
int scope = -1) {
if (!isCurrent(scope)) update(scope); }
275 IF_DEBUG(
void setName(
const std::string& name) { d_name=name; })
286 void*
operator new(
size_t size,
bool b) {
289 void operator delete(
void* pMem,
bool b) {
293 void operator delete(
void*) { }
332 const std::string&
name()
const {
return d_name; }
333 int id()
const {
return d_id; }
336 int level()
const {
return d_topScope->level(); }
340 void popto(
int toLevel);
343 unsigned long getMemory(
int verbosity);
348 {
return this == d_context->topScope(); }
351 if(d_restoreChain != NULL)
355 d_restoreChain = obj;
362 while (d_restoreChain != NULL) d_restoreChain = d_restoreChain->restore();
375 DebugAssert(context != NULL,
"NULL context pointer");
376 d_scope = context->bottomScope();
401 void push() { d_curContext->push(); }
402 void pop() { d_curContext->pop(); }
403 void popto(
int toLevel) { d_curContext->popto(toLevel); }
405 Context* createContext(
const std::string& name=
"");
408 unsigned long getMemory(
int verbosity);
434 if(d_context!=NULL) d_context->deleteNotifyObj(
this);