Go to the documentation of this file.
19 #ifndef GNASH_FN_CALL_H
20 #define GNASH_FN_CALL_H
38 class movie_definition;
60 typedef typename std::vector<T>::size_type
size_type;
71 _v.push_back(std::move(
t));
76 _v.push_back(std::move(
t));
82 _v.emplace_back(std::forward<U>(
u));
88 _v.emplace_back(std::forward<U>(
u));
101 void swap(std::vector<T>& to) {
204 assert(!_args.empty());
205 _args.erase(_args.begin());
215 for (
size_t i = 0;
i <
nargs; ++
i) {
228 _args.push_back(
arg);
260 template<
typename T = DisplayObject>
265 if (!
o)
return nullptr;
266 return dynamic_cast<T*
>(
o->displayObject());
298 typename T::value_type*
304 typename T::value_type* ret =
T()(obj);
310 std::string msg =
"Function requiring " + target +
" as 'this' "
311 "called from " +
source +
" instance.";
void resetArgs()
Definition: fn_call.h:221
as_object * super
The "super" object in this function call context.
Definition: fn_call.h:175
Check that the 'this' pointer has a particular native type ('Relay').
Definition: fn_call.h:250
VM & getVM() const
Definition: as_environment.h:59
FunctionArgs(const FunctionArgs &other)=default
The copy constructor copies all the arguments.
The base class for all ActionScript objects.
Definition: as_object.h:162
FunctionArgs & operator,(U &&u)
Definition: fn_call.h:81
@ U
Definition: GnashKey.h:133
@ T
Definition: GnashKey.h:132
string_table & getStringTable() const
Get a reference to the string table used by the VM.
Definition: VM.h:117
@ i
Definition: GnashKey.h:155
std::string typeName(const T &inst)
Definition: utility.h:93
FunctionArgs & operator,(T t)
Definition: fn_call.h:75
movie_root & getRoot() const
Get a pointer to this VM's Root movie (stage)
Definition: VM.cpp:143
Provides information about timeline context.
Definition: as_environment.h:51
T::value_type * ensure(const fn_call &fn)
Templated function to check the validity of a function call.
Definition: fn_call.h:299
The AVM1 virtual machine.
Definition: VM.h:72
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
Global_as * getGlobal() const
Get a pointer to this VM's _global Object.
Definition: VM.cpp:149
@ n
Definition: GnashKey.h:160
Global_as & getGlobal(const as_environment &env)
Definition: as_environment.cpp:651
VM & getVM(const as_environment &env)
Definition: as_environment.h:222
void drop_bottom()
Definition: fn_call.h:203
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:96
size_type size() const
Definition: fn_call.h:105
Check that the 'this' pointer is not null.
Definition: fn_call.h:272
void pushArg(const Args::value_type &arg)
Definition: fn_call.h:226
Parameters/environment for builtin or user-defined functions callable from ActionScript.
Definition: fn_call.h:118
@ t
Definition: GnashKey.h:166
FunctionArgs(FunctionArgs &&other)=default
fn_call(as_object *this_in, const as_environment &env_in, Args &args, as_object *sup=nullptr, bool isNew=false)
Construct a fn_call.
Definition: fn_call.h:131
as_object value_type
Definition: fn_call.h:273
FunctionArgs< as_value > Args
Definition: fn_call.h:121
void for_each(C &container, R(T::*pmf)(const A &), const A &arg)
Definition: Renderer_ogl.cpp:690
void dump_args(std::ostream &os) const
Dump arguments to given output stream.
Definition: fn_call.h:214
std::vector< T >::size_type size_type
Definition: fn_call.h:60
An ActionScript type error.
Definition: GnashException.h:161
A class to contain transferable arguments for a fn_call.
Definition: fn_call.h:57
T value_type
Definition: fn_call.h:62
fn_call(const fn_call &fn)
Copy constructor.
Definition: fn_call.h:156
VM & getVM() const
Return the VM this fn_call is running from.
Definition: fn_call.h:184
Args::size_type nargs
Number of arguments to this ActionScript function call.
Definition: fn_call.h:178
int getSWFVersion() const
Get SWF version context for the currently running actions.
Definition: VM.h:106
fn_call(as_object *this_in, const as_environment &env_in)
Definition: fn_call.h:144
const Args::value_type & arg(unsigned int n) const
Access a particular argument.
Definition: fn_call.h:194
movie_root & getRoot(const as_environment &env)
Definition: as_environment.cpp:645
void setReachable() const
Set any object value as reachable (for the GC)
Definition: as_value.cpp:691
void setReachable() const
Mark any reachable resources.
Definition: fn_call.h:96
FunctionArgs & operator+=(U &&u)
Definition: fn_call.h:87
int getSWFVersion(const as_environment &env)
Definition: as_environment.cpp:657
FunctionArgs & operator+=(T t)
Definition: fn_call.h:70
const movie_definition * callerDef
Definition containing caller code. 0 if spontaneous (system event).
Definition: fn_call.h:181
string_table & getStringTable(const as_environment &env)
Definition: as_environment.cpp:639
void swap(std::vector< T > &to)
Definition: fn_call.h:101
T value_type
Definition: fn_call.h:263
value_type * operator()(const as_object *o) const
Definition: fn_call.h:264
T value_type
Definition: fn_call.h:251
Check that the 'this' pointer is a DisplayObject.
Definition: fn_call.h:262
std::vector< T > container_type
Definition: fn_call.h:61
@ source
Definition: klash_part.cpp:329
const Args::container_type & getArgs() const
Definition: fn_call.h:199
value_type * operator()(const as_object *o) const
Definition: fn_call.h:252
as_object * this_ptr
Definition: fn_call.h:170
value_type * operator()(as_object *o) const
Definition: fn_call.h:274
@ o
Definition: GnashKey.h:161
@ u
Definition: GnashKey.h:167
const as_environment & env() const
Definition: fn_call.h:209
bool isInstantiation() const
Return true if this call is an object instantiation.
Definition: fn_call.h:189