#include <libsswf.h>
Public Member Functions | |
int | GetMaxRecursionDepth (void) const |
Reads the current recursion depth. | |
int | GetTimeoutSeconds (void) const |
Reads the current time out period. | |
virtual ErrorManager::error_code_t | Save (Data &data) |
Saves the script limits. | |
void | SetMaxRecursionDepth (int depth) |
Defines the maximum recursion depth. | |
void | SetTimeoutSeconds (int timeout) |
Defines the amount of time for completion. | |
TagScriptLimits (TagBase *parent) | |
Initialize a script limit tag. | |
virtual swf_type_t | TypeFlags (void) const |
Get the type of a script limit tag. | |
Private Member Functions | |
virtual ErrorManager::error_code_t | ParseTag (swf_tag_t tag, const Data &data) |
virtual ErrorManager::error_code_t | PreSave (void) |
Ensures the minimum version. | |
Private Attributes | |
int | f_depth |
int | f_timeout |
TagScriptLimits::TagScriptLimits | ( | TagBase * | parent | ) |
int TagScriptLimits::GetMaxRecursionDepth | ( | void | ) | const |
The recursion depth set by SetMaxRecursionDepth() can be retreived with this function.
When set to zero, the player default is used.
References f_depth.
int TagScriptLimits::GetTimeoutSeconds | ( | void | ) | const |
The time out period set by SetTimeOutSeconds() function can be retreived with this function.
When set to zero, the player default is used.
References f_timeout.
virtual ErrorManager::error_code_t sswf::TagScriptLimits::ParseTag | ( | swf_tag_t | tag, | |
const Data & | data | |||
) | [private, virtual] |
Implements sswf::TagBase.
ErrorManager::error_code_t TagScriptLimits::PreSave | ( | void | ) | [private, virtual] |
This function requests that the movie be at least of version 7.
Reimplemented from sswf::TagBase.
References sswf::ErrorManager::ERROR_CODE_NONE, and sswf::TagBase::MinimumVersion().
ErrorManager::error_code_t TagScriptLimits::Save | ( | Data & | data | ) | [virtual] |
This function saves the script limits to the output Data buffer.
If the depth is still zero, 256 is used.
If the timeout value is still zero, 20 is used.
[in,out] | data | The Data buffer where the data is saved |
Implements sswf::TagBase.
References sswf::ErrorManager::ERROR_CODE_NONE, f_depth, f_timeout, sswf::Data::PutShort(), sswf::TagBase::SaveTag(), and sswf::TagBase::SWF_TAG_SCRIPT_LIMITS.
void TagScriptLimits::SetMaxRecursionDepth | ( | int | depth | ) |
This function defines the depth that the Call action can go to. This is called the recursion limit since in general you will hit the limit when a function calls itself this many times. It is very unlikely that this isn't simply used as the number of calls within calls can be done (A calls B, B calls C, C calls D is a depth of 3.)
In general, the default value is enough. You may want to increase this value if you have more level of recursion.
The value is limited between 1 and 65535.
[in] | depth | The depth level of recursion |
References f_depth.
void TagScriptLimits::SetTimeoutSeconds | ( | int | timeout | ) |
This function defines the number of seconds a script can take before to be timed out.
Obviously, for a realtime movie, anything taking more than a few milliseconds is slow. So even 1 second will be considered very long.
Yet, if you use an ActionScript to do some complex mathematical computations, you may want to increase this timeout.
The value is limited between 1 and 65535.
References f_timeout.
TagBase::swf_type_t TagScriptLimits::TypeFlags | ( | void | ) | const [virtual] |
This function determines what the type of a script limit tag is.
Implements sswf::TagBase.
References SWF_TYPE_DEFINE.
int sswf::TagScriptLimits::f_depth [private] |
Referenced by GetMaxRecursionDepth(), Save(), SetMaxRecursionDepth(), and TagScriptLimits().
int sswf::TagScriptLimits::f_timeout [private] |
Referenced by GetTimeoutSeconds(), Save(), SetTimeoutSeconds(), and TagScriptLimits().