Go to the documentation of this file.
19 #ifndef GNASH_PROPERTYLIST_H
20 #define GNASH_PROPERTYLIST_H
27 #include <boost/multi_index_container.hpp>
28 #include <boost/multi_index/ordered_index.hpp>
29 #include <boost/multi_index/sequenced_index.hpp>
30 #include <boost/multi_index/key_extractors.hpp>
31 #include <boost/noncopyable.hpp>
92 typedef boost::multi_index::sequenced<
107 typedef boost::multi_index::ordered_unique<
108 boost::multi_index::tag<Case>,
116 typedef boost::multi_index::ordered_non_unique<
117 boost::multi_index::tag<NoCase>,
122 typedef boost::multi_index_container<
124 boost::multi_index::indexed_by<SequencedIndex, CaseIndex, NoCaseIndex>
150 template <
class U,
class V>
153 for (
const auto& prop : _props) {
155 if (!cmp(prop))
continue;
156 as_value val = prop.getValue(_owner);
157 if (!visitor.accept(prop.uri(), val))
return;
282 return _props.size();
311 #endif // GNASH_PROPERTYLIST_H
DSOTEXPORT Property * getProperty(const ObjectURI &uri) const
Get a property if it exists.
Definition: PropertyList.cpp:139
@ l
Definition: GnashKey.h:158
boost::multi_index_container< value_type, boost::multi_index::indexed_by< SequencedIndex, CaseIndex, NoCaseIndex > > container
The container of the Properties.
Definition: PropertyList.h:125
DSOTEXPORT PropertyList(as_object &obj)
Construct the PropertyList.
Definition: PropertyList.cpp:75
void visitValues(V &visitor, U cmp=U()) const
Visit properties.
Definition: PropertyList.h:151
An abstract property visitor.
Definition: PropertyList.h:49
The base class for all ActionScript objects.
Definition: as_object.h:162
void visitKeys(KeyVisitor &v, PropertyTracker &donelist) const
Enumerate all non-hidden properties to the given container.
Definition: PropertyList.cpp:172
@ U
Definition: GnashKey.h:133
void setFlagsAll(int setTrue, int setFalse)
Set the flags of all properties.
Definition: PropertyList.cpp:129
A general use string table.
Definition: string_table.h:42
const std::string & value(key to_find) const
Find a string by its key.
Definition: string_table.h:102
void log_debug(StringType msg, Args... args)
Definition: log.h:301
boost::multi_index::ordered_unique< boost::multi_index::tag< Case >, KeyExtractor, ObjectURI::LessThan > CaseIndex
The case-sensitive index.
Definition: PropertyList.h:110
#define _(String)
Definition: log.h:44
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
@ dontEnum
Protect from enumeration.
Definition: PropFlags.h:36
@ dontDelete
Protect from deletion.
Definition: PropFlags.h:39
VM & getVM(const as_environment &env)
Definition: as_environment.h:222
void log_error(StringType msg, Args... args)
Definition: log.h:283
Identifier for the case-sensitive index.
Definition: PropertyList.h:104
boost::multi_index::ordered_non_unique< boost::multi_index::tag< NoCase >, KeyExtractor, ObjectURI::CaseLessThan > NoCaseIndex
The case-insensitive index.
Definition: PropertyList.h:119
virtual ~KeyVisitor()
Definition: PropertyList.h:63
Identifier for the case-insensitive index.
Definition: PropertyList.h:113
An abstract key visitor.
Definition: PropertyList.h:58
Property value_type
Definition: PropertyList.h:86
virtual bool accept(const ObjectURI &uri, const as_value &val)=0
This function should return false if no further visits are needed.
void for_each(C &container, R(T::*pmf)(const A &), const A &arg)
Definition: Renderer_ogl.cpp:690
@ a
Definition: GnashKey.h:147
Flags defining the level of protection of a member.
Definition: PropFlags.h:29
void setReachable() const
Mark this property as being reachable (for the GC)
Definition: Property.h:390
An abstract property.
Definition: Property.h:277
virtual void operator()(const ObjectURI &uri)=0
This function should return false if no further visits are needed.
@ p
Definition: GnashKey.h:162
void dump()
Dump all members (using log_debug)
Definition: PropertyList.cpp:189
DSOTEXPORT std::pair< bool, bool > delProperty(const ObjectURI &uri)
Delete a Property, if existing and not protected from deletion.
Definition: PropertyList.cpp:154
Definition: ObjectURI.h:130
void clear()
Remove all entries in the container.
Definition: PropertyList.cpp:311
void setReachable() const
Mark all properties reachable.
Definition: PropertyList.h:295
ActionScript value type.
Definition: as_value.h:95
as_value(* as_c_function_ptr)(const fn_call &fn)
Definition: Property.h:34
Definition: ObjectURI.h:164
void check(string_table::key k)
Definition: Stats.h:61
DSOTEXPORT void setFlags(const ObjectURI &uri, int setTrue, int setFalse)
Set the flags of a property.
Definition: PropertyList.cpp:118
container::const_iterator const_iterator
Definition: PropertyList.h:128
@ V
Definition: GnashKey.h:134
@ f
Definition: GnashKey.h:152
DSOTEXPORT bool setValue(const ObjectURI &uri, const as_value &value, const PropFlags &flagsIfMissing=0)
Set the value of a property, creating a new one if it doesn't exist.
Definition: PropertyList.cpp:94
#define DSOTEXPORT
Definition: dsodefs.h:63
uri
Definition: test.py:12
string_table & getStringTable(const as_environment &env)
Definition: as_environment.cpp:639
Definition: ObjectURI.h:122
@ PROP_uuPROTOuu
Definition: namedStrings.h:118
bool addDestructiveGetter(const ObjectURI &uri, as_function &getter, const PropFlags &flagsIfMissing=0)
Add a destructive getter property, if not already existant.
Definition: PropertyList.cpp:265
bool addGetterSetter(const ObjectURI &uri, as_function &getter, as_function *setter, const as_value &cacheVal, const PropFlags &flagsIfMissing=0)
Add a getter/setter property, if not already existing.
Definition: PropertyList.cpp:198
container::iterator iterator
Definition: PropertyList.h:127
bool caseless(const as_object &o)
Return whether property matching is caseless.
Definition: as_object.h:924
std::set< ObjectURI, ObjectURI::LessThan > PropertyTracker
Definition: PropertyList.h:85
A URI for describing as_objects.
Definition: ObjectURI.h:45
Set of properties associated with an ActionScript object.
Definition: PropertyList.h:82
size_t size() const
Return number of properties in this list.
Definition: PropertyList.h:281
bool setValue(as_object &this_ptr, const as_value &value) const
Set value of this property.
Definition: Property.cpp:133
ActionScript Function, either builtin or SWF-defined.
Definition: as_function.h:63
virtual ~PropertyVisitor()
Definition: PropertyList.h:54
boost::multi_index::sequenced< boost::multi_index::tag< CreationOrder > > SequencedIndex
The sequenced index in creation order.
Definition: PropertyList.h:93
Identifier for the sequenced index.
Definition: PropertyList.h:89