Gnash  0.8.11dev
BoundValues.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
3 // Free Software Foundation, Inc.
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 #ifndef GNASH_AS_BOUND_VALUES_H
20 #define GNASH_AS_BOUND_VALUES_H
21 
22 namespace gnash {
23 namespace abc {
24 
25 class BoundValue;
26 
28 {
29 public:
30  bool setGetter(Method *p) { mGetter = p; return true; }
31  bool setSetter(Method *p) { _setter = p; return true; }
32  bool setValue(BoundValue *p) { mValue = p; return true; }
33 
34  BoundValue* getValue() { return mValue; }
35  Method *getGetter() { return mGetter; }
36  Method *getSetter() { return _setter; }
37 
38 private:
39  Method *mGetter;
40  Method *_setter;
41  BoundValue *mValue;
42 };
43 
44 class BoundValue
45 {
46 public:
47  BoundValue() : mConst(false), mValue()
48  { mValue.set_undefined(); }
49  void setValue(as_value &v) { mValue = v; }
50  as_value getCurrentValue() { return mValue; }
51 
52  void setType(Class *t) { mType = t; }
53  Class *getType() { return mType; }
54 
55 private:
56  bool mConst;
57  Class *mType;
58  as_value mValue;
59 };
60 
61 } // namespace abc
62 } // namespace gnash
63 
64 #endif
gnash::abc::Method
Definition: Method.h:54
gnash::abc::BoundValue
Definition: BoundValues.h:45
gnash::abc::BoundAccessor::getSetter
Method * getSetter()
Definition: BoundValues.h:36
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::abc::BoundAccessor::getValue
BoundValue * getValue()
Definition: BoundValues.h:34
gnash::abc::BoundValue::getType
Class * getType()
Definition: BoundValues.h:53
gnash::key::t
@ t
Definition: GnashKey.h:166
gnash::abc::BoundAccessor::setGetter
bool setGetter(Method *p)
Definition: BoundValues.h:30
gnash::as_value::set_undefined
void set_undefined()
Set to undefined.
Definition: as_value.cpp:519
gnash::key::p
@ p
Definition: GnashKey.h:162
gnash::abc::BoundValue::getCurrentValue
as_value getCurrentValue()
Definition: BoundValues.h:50
gnash::abc::Class
A class to represent AS3 Classes.
Definition: Class.h:76
gnash::as_value
ActionScript value type.
Definition: as_value.h:95
gnash::abc::BoundValue::setValue
void setValue(as_value &v)
Definition: BoundValues.h:49
gnash::abc::BoundValue::setType
void setType(Class *t)
Definition: BoundValues.h:52
gnash::abc::BoundAccessor::setSetter
bool setSetter(Method *p)
Definition: BoundValues.h:31
gnash::abc::BoundValue::BoundValue
BoundValue()
Definition: BoundValues.h:47
gnash::abc::BoundAccessor::getGetter
Method * getGetter()
Definition: BoundValues.h:35
gnash::abc::BoundAccessor::setValue
bool setValue(BoundValue *p)
Definition: BoundValues.h:32
gnash::abc::BoundAccessor
Definition: BoundValues.h:28
test.v
v
Definition: test.py:11