CVC3
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CVC3::Scope Class Reference

#include <context.h>

Collaboration diagram for CVC3::Scope:
Collaboration graph

Public Member Functions

 Scope (Context *context, ContextMemoryManager *cmm, Scope *prevScope=NULL)
 Constructor.
 
 ~Scope ()
 Destructor.
 
ScopeprevScope () const
 Access functions.
 
int level (void) const
 
bool isCurrent (void) const
 
ScopetopScope () const
 
ContextgetContext () const
 
ContextMemoryManagergetCMM () const
 
void * operator new (size_t size, MemoryManager *mm)
 
void operator delete (void *pMem, MemoryManager *mm)
 
void operator delete (void *)
 
void restore (void)
 Restore all the values.
 
void finalize (void)
 Called by ~ContextManager.
 
void check (void)
 Check for memory leaks.
 
unsigned long getMemory (int verbosity)
 Compute memory used.
 

Private Member Functions

void addToChain (ContextObjChain *obj)
 Called by ContextObj when created.
 

Private Attributes

Contextd_context
 Context that created this scope.
 
ContextMemoryManagerd_cmm
 Memory manager for this scope.
 
Scoped_prevScope
 Previous scope in this context.
 
int d_level
 Scope level.
 
ContextObjChaind_restoreChain
 Linked list of objects which are "current" in this scope, and thus need to be restored when the scope is deleted.
 

Friends

class ContextObj
 
class ContextObjChain
 
class CDFlags
 

Detailed Description

Author: Clark Barrett

Created: Thu Feb 13 00:19:15 2003

A scope encapsulates the portion of a context which has changed since the last call to push(). Thus, when pop() is called, everything in this scope is restored to its previous state.

Definition at line 60 of file context.h.

Constructor & Destructor Documentation

CVC3::Scope::Scope ( Context context,
ContextMemoryManager cmm,
Scope prevScope = NULL 
)
inline

Constructor.

Definition at line 85 of file context.h.

References d_level, level(), and prevScope().

CVC3::Scope::~Scope ( )
inline

Destructor.

Definition at line 91 of file context.h.

Member Function Documentation

Scope* CVC3::Scope::prevScope ( ) const
inline

Access functions.

Definition at line 94 of file context.h.

References d_prevScope.

Referenced by CVC3::Context::pop(), Scope(), CVC3::CDFlags::update(), and CVC3::Context::~Context().

int CVC3::Scope::level ( void  ) const
inline

Definition at line 95 of file context.h.

References d_level.

Referenced by CVC3::Context::popto(), Scope(), and CVC3::CDFlags::update().

Context* CVC3::Scope::getContext ( ) const
inline

Definition at line 98 of file context.h.

References d_context.

ContextMemoryManager* CVC3::Scope::getCMM ( ) const
inline

Definition at line 99 of file context.h.

References d_cmm.

Referenced by CVC3::Context::pop(), CVC3::CDFlags::update(), and CVC3::Context::~Context().

void* CVC3::Scope::operator new ( size_t  size,
MemoryManager mm 
)
inline

Definition at line 101 of file context.h.

References CVC3::ContextMemoryManager::newData().

void CVC3::Scope::operator delete ( void *  pMem,
MemoryManager mm 
)
inline

Definition at line 103 of file context.h.

void CVC3::Scope::operator delete ( void *  )
inline

Definition at line 106 of file context.h.

void Scope::finalize ( void  )
void Scope::check ( void  )

Check for memory leaks.

Definition at line 55 of file context.cpp.

References CVC3::ContextObjChain::d_restoreChainNext, std::endl(), and IF_DEBUG.

Referenced by CVC3::Context::pop().

unsigned long Scope::getMemory ( int  verbosity)

Compute memory used.

Definition at line 82 of file context.cpp.

References std::endl().

Referenced by CVC3::Context::getMemory().

Friends And Related Function Documentation

friend class ContextObj
friend

Definition at line 61 of file context.h.

friend class ContextObjChain
friend

Definition at line 62 of file context.h.

friend class CDFlags
friend

Definition at line 63 of file context.h.

Member Data Documentation

Context* CVC3::Scope::d_context
private

Context that created this scope.

Definition at line 65 of file context.h.

Referenced by getContext().

ContextMemoryManager* CVC3::Scope::d_cmm
private

Memory manager for this scope.

Definition at line 68 of file context.h.

Referenced by getCMM().

Scope* CVC3::Scope::d_prevScope
private

Previous scope in this context.

Definition at line 71 of file context.h.

Referenced by prevScope().

int CVC3::Scope::d_level
private

Scope level.

Definition at line 74 of file context.h.

Referenced by level(), and Scope().

ContextObjChain* CVC3::Scope::d_restoreChain
private

Linked list of objects which are "current" in this scope, and thus need to be restored when the scope is deleted.

Definition at line 78 of file context.h.


The documentation for this class was generated from the following files: