sswf::ActionStoreRegister Class Reference

Store the top stack value in a register. More...

#include <libsswf.h>

Inheritance diagram for sswf::ActionStoreRegister:

sswf::Action sswf::MemoryManager sswf::ItemBase sswf::MemBuffer List of all members.

Public Member Functions

 ActionStoreRegister (TagBase *tag)
 Initialize the ActionStoreRegister.
void SetRegister (unsigned char reg)
 Defines which register will hold the stack content.

Private Member Functions

virtual ActionDuplicate (void) const
 Create a clone of this action.
virtual int GetMaxRegister (void) const
 Get the maximum register number in use.
virtual ErrorManager::error_code_t SaveData (Data &data, Data &nested_data)
 Save the extraneous data for this action.

Private Attributes

unsigned char f_reg

Detailed Description

This action is used to save the current content of the stack in a register. Later, you can read the register with an sswf::ActionPushData action.

See also:
SWF Alexis' Reference—Store Register


Constructor & Destructor Documentation

ActionStoreRegister::ActionStoreRegister ( TagBase tag  ) 

Initialize the ActionStoreRegister by setting the register number to zero. Use the SetRegister() function to change the default.

Parameters:
[in] tag The tag in which this action is being added


Member Function Documentation

Action * ActionStoreRegister::Duplicate ( void   )  const [private, virtual]

This function allocates a new ActionStoreRegister object, it copies the register number and returns the pointer of the new action.

Returns:
The action clone pointer

Reimplemented from sswf::Action.

int ActionStoreRegister::GetMaxRegister ( void   )  const [private, virtual]

This function gets the larger register number in use by this action. This is actually equal to the register you defined with SetRegister() or zero.

Returns:
The largest register number in use by this action

Reimplemented from sswf::Action.

ErrorManager::error_code_t ActionStoreRegister::SaveData ( Data data,
Data nested_data 
) [private, virtual]

This means saving one byte with the register number.

Parameters:
[in] data The Data buffer where the register number is to be saved
[in] nested_data The ActionStoreRegister does not support nested data

Reimplemented from sswf::Action.

void ActionStoreRegister::SetRegister ( unsigned char  reg  ) 

This function can be used to define the register number to hold the current stack content.

Outside a function, only registers 0 to 3 are acceptable.

Inside a function (DeclareFunction2--Version 7 of SWF), all registers from 0 to 254 are acceptable. (from my testing it seems that register 255 does not work.)

Parameters:
[in] reg The new register to assign to this action


Member Data Documentation

unsigned char sswf::ActionStoreRegister::f_reg [private]


The documentation for this class was generated from the following files:
Generated on Sun May 13 23:29:39 2007 for libsswf by  doxygen 1.4.7