NLAISCRIPT::CMethodContextDebug Class Reference

#include <opcode_call_method.h>

Inheritance diagram for NLAISCRIPT::CMethodContextDebug:

NLAISCRIPT::IMethodContext

Public Member Functions

const IMethodContextclone () const
virtual void loadContext (CCodeContext &context)
virtual void saveContext (CCodeContext &context)

Member Function Documentation

const IMethodContext * NLAISCRIPT::CMethodContextDebug::clone  )  const [virtual]
 

Server method need this, in particular on the copy constructor where it is easy to clone param to init attribut.

Implements NLAISCRIPT::IMethodContext.

Definition at line 75 of file opcode_call_method.cpp.

00076         {
00077                 return new CMethodContextDebug();
00078         }

void NLAISCRIPT::CMethodContextDebug::loadContext CCodeContext context  )  [virtual]
 

Allow to reload old context before the return of method.

Implements NLAISCRIPT::IMethodContext.

Definition at line 103 of file opcode_call_method.cpp.

References NLAISCRIPT::CCodeContext::ContextDebug, NLAISCRIPT::CCodeContext::Heap, NLAISCRIPT::CContextDebug::HeapDebug, NLAISCRIPT::CCodeContext::Param, NLAIC::IPointerGestion::release(), NLAISCRIPT::CStackPointer::restoreShift(), and NLAISCRIPT::CStackPointer::restoreStack().

00104         {
00105                 context.Heap.restoreShift();
00106                 context.Heap.restoreStack();
00107                 context.ContextDebug.HeapDebug.restoreShift();
00108                 NLAIAGENT::IObjectIA *obj = context.Param.back();
00109                 obj->release();
00110                 context.Param.pop_back();               
00111         }

void NLAISCRIPT::CMethodContextDebug::saveContext CCodeContext context  )  [virtual]
 

Allow to save the register, ip pointer .... before method call.

Implements NLAISCRIPT::IMethodContext.

Definition at line 80 of file opcode_call_method.cpp.

References NLAISCRIPT::CStackPointer::addStack(), NLAISCRIPT::CCodeContext::ContextDebug, NLAISCRIPT::CCodeContext::Heap, NLAISCRIPT::CContextDebug::HeapDebug, NLAIC::IPointerGestion::incRef(), NLAIAGENT::CConstIteratorContener::isInEnd(), NLAISCRIPT::CCodeContext::Param, param, NLAISCRIPT::CStackPointer::setShift(), and NLAISCRIPT::CCodeContext::Stack.

00081         {
00082                 NLAIAGENT::IBaseGroupType *param = (NLAIAGENT::IBaseGroupType *)context.Stack[(int)context.Stack];              
00083                 NLAIAGENT::CIteratorContener It = param->getIterator();
00084                 
00085                 while(!It.isInEnd())
00086                 {                       
00087                         NLAIAGENT::IObjectIA *o = (NLAIAGENT::IObjectIA *)It++;
00088                         o->incRef();
00089                         context.Heap[(int)context.Heap] = o;
00090                         context.Heap ++;
00091                 }                               
00092                 int bp = (int)context.Heap;
00093                 CVarPStackParam::_Shift += bp;
00094                 context.Heap.addStack(param->size());
00095                 int sh = (int)context.Heap;
00096                 context.Heap.setShift(sh);
00097                 context.ContextDebug.HeapDebug.setShift(sh);
00098                 context.Param.push_back(param);
00099                 param->incRef();
00100                 context.Stack --;
00101         }


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 12:04:17 2004 for NeL by doxygen 1.3.6