Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 17, 2006, 7:55:59 PM (18 years ago)
Author:
bensch
Message:

orxonox/script_engine: namespace OrxScript introduced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/script_engine/src/lib/script_engine/RestoreStack.h

    r7645 r7653  
    44#include "luaincl.h"
    55
    6 //! Class to restore the stack to the way we found it.
    7 class LuaRestoreStack
     6namespace OrxScript
    87{
    9 public:
    10   /**
    11    * @brief Stores the stack and the index to the top element
    12    *
    13    * @param virtualMachine the virtual machine to save
    14    */
    15    LuaRestoreStack (LuaVirtualMachine& virtualMachine) : savedState (NULL)
    16    {
     8
     9  //! Class to restore the stack to the way we found it.
     10  class LuaRestoreStack
     11  {
     12  public:
     13    /**
     14     * @brief Stores the stack and the index to the top element
     15     *
     16     * @param virtualMachine the virtual machine to save
     17     */
     18    LuaRestoreStack (LuaVirtualMachine& virtualMachine) : savedState (NULL)
     19    {
    1720      savedState = (lua_State *) virtualMachine;
    1821      if (virtualMachine.isOk ())
    1922      {
    20          savedTopIndex = lua_gettop (savedState);
     23        savedTopIndex = lua_gettop (savedState);
    2124      }
    22    }
    23    /**
    24     * @brief Restores the virtual machine
    25     *
    26     *
    27     */
    28    virtual ~LuaRestoreStack (void)
    29    {
     25    }
     26    /**
     27     * @brief Restores the virtual machine
     28     *
     29     *
     30     */
     31    virtual ~LuaRestoreStack (void)
     32    {
    3033      lua_settop (savedState, savedTopIndex);
    31    }
     34    }
    3235
    33 protected:
    34    lua_State* savedState;
    35    int savedTopIndex;
    36 };
     36  protected:
     37    lua_State* savedState;
     38    int savedTopIndex;
     39  };
    3740
     41}
    3842
    3943#endif // __RESTORE_STACK_H__
Note: See TracChangeset for help on using the changeset viewer.