19 #ifndef GNASH_PROPERTYLIST_H
20 #define GNASH_PROPERTYLIST_H
26 #include <boost/cstdint.hpp>
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>
32 #include <boost/bind.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_iterator it = _props.begin(), ie = _props.end();
156 if (!cmp(*it))
continue;
157 as_value val = it->getValue(_owner);
158 if (!visitor.accept(it->uri(), val))
return;
283 return _props.size();
312 #endif // GNASH_PROPERTYLIST_H
DSOTEXPORT PropertyList(as_object &obj)
Construct the PropertyList.
Definition: PropertyList.cpp:75
virtual void operator()(const ObjectURI &uri)=0
This function should return false if no further visits are needed.
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
DSOTEXPORT std::pair< bool, bool > delProperty(const ObjectURI &uri)
Delete a Property, if existing and not protected from deletion.
Definition: PropertyList.cpp:154
void for_each(C &container, R(T::*pmf)(const A &), const A &arg)
Definition: Renderer_ogl.cpp:692
DSOTEXPORT Property * getProperty(const ObjectURI &uri) const
Get a property if it exists.
Definition: PropertyList.cpp:139
virtual ~KeyVisitor()
Definition: PropertyList.h:63
ActionScript value type.
Definition: as_value.h:95
as_value(* as_c_function_ptr)(const fn_call &fn)
Definition: Property.h:34
An abstract property.
Definition: Property.h:275
virtual ~PropertyVisitor()
Definition: PropertyList.h:54
DSOTEXPORT void setFlags(const ObjectURI &uri, int setTrue, int setFalse)
Set the flags of a property.
Definition: PropertyList.cpp:118
Flags defining the level of protection of a member.
Definition: PropFlags.h:28
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
The base class for all ActionScript objects.
Definition: as_object.h:161
size_t size() const
Return number of properties in this list.
Definition: PropertyList.h:282
void setFlagsAll(int setTrue, int setFalse)
Set the flags of all properties.
Definition: PropertyList.cpp:129
A URI for describing as_objects.
Definition: ObjectURI.h:44
container::const_iterator const_iterator
Definition: PropertyList.h:128
boost::multi_index::ordered_unique< boost::multi_index::tag< Case >, KeyExtractor, ObjectURI::LessThan > CaseIndex
The case-sensitive index.
Definition: PropertyList.h:110
boost::multi_index::sequenced< boost::multi_index::tag< CreationOrder > > SequencedIndex
The sequenced index in creation order.
Definition: PropertyList.h:93
An abstract property visitor.
Definition: PropertyList.h:49
void setReachable() const
Mark this property as being reachable (for the GC)
Definition: Property.h:398
boost::multi_index_container< value_type, boost::multi_index::indexed_by< SequencedIndex, CaseIndex, NoCaseIndex > > container
The container of the Properties.
Definition: PropertyList.h:125
Identifier for the case-insensitive index.
Definition: PropertyList.h:113
Property value_type
Definition: PropertyList.h:86
Definition: GnashKey.h:134
tuple v
Definition: test.py:11
void dump()
Dump all members (using log_debug)
Definition: PropertyList.cpp:190
virtual bool accept(const ObjectURI &uri, const as_value &val)=0
This function should return false if no further visits are needed.
void visitKeys(KeyVisitor &v, PropertyTracker &donelist) const
Enumerate all non-hidden properties to the given container.
Definition: PropertyList.cpp:172
boost::multi_index::ordered_non_unique< boost::multi_index::tag< NoCase >, KeyExtractor, ObjectURI::CaseLessThan > NoCaseIndex
The case-insensitive index.
Definition: PropertyList.h:119
Definition: GnashKey.h:133
Definition: ObjectURI.h:129
Identifier for the case-sensitive index.
Definition: PropertyList.h:104
void clear()
Remove all entries in the container.
Definition: PropertyList.cpp:313
void setReachable() const
Mark all properties reachable.
Definition: PropertyList.h:296
bool addDestructiveGetter(const ObjectURI &uri, as_function &getter, const PropFlags &flagsIfMissing=0)
Add a destructive getter property, if not already existant.
Definition: PropertyList.cpp:267
Definition: GnashKey.h:162
std::set< ObjectURI, ObjectURI::LessThan > PropertyTracker
Definition: PropertyList.h:85
Set of properties associated with an ActionScript object.
Definition: PropertyList.h:81
container::iterator iterator
Definition: PropertyList.h:127
const ObjectURI & uri() const
The name-namespace pair (ObjectURI) of this Property.
Definition: Property.h:393
#define DSOTEXPORT
Definition: dsodefs.h:63
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:200
An abstract key visitor.
Definition: PropertyList.h:58
void visitValues(V &visitor, U cmp=U()) const
Visit properties.
Definition: PropertyList.h:151
ActionScript Function, either builtin or SWF-defined.
Definition: as_function.h:62
Identifier for the sequenced index.
Definition: PropertyList.h:89
Definition: ObjectURI.h:121