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
as_value getCurrentValue()
Definition: BoundValues.h:50
ActionScript value type.
Definition: as_value.h:94
BoundValue()
Definition: BoundValues.h:47
Method * getSetter()
Definition: BoundValues.h:36
v
Definition: test.py:11
void setValue(as_value &v)
Definition: BoundValues.h:49
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
BoundValue * getValue()
Definition: BoundValues.h:34
bool setGetter(Method *p)
Definition: BoundValues.h:30
Definition: GnashKey.h:166
Definition: BoundValues.h:27
A class to represent AS3 Classes.
Definition: Class.h:75
Class * getType()
Definition: BoundValues.h:53
bool setSetter(Method *p)
Definition: BoundValues.h:31
Definition: GnashKey.h:162
bool setValue(BoundValue *p)
Definition: BoundValues.h:32
Definition: Method.h:53
Definition: BoundValues.h:44
Method * getGetter()
Definition: BoundValues.h:35
void setType(Class *t)
Definition: BoundValues.h:52