Gnash  0.8.10
BoundValues.h
Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
00003 //   Free Software Foundation, Inc.
00004 // 
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or
00008 // (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019 #ifndef GNASH_AS_BOUND_VALUES_H
00020 #define GNASH_AS_BOUND_VALUES_H
00021 
00022 namespace gnash {
00023 namespace abc {
00024 
00025 class BoundValue;
00026 
00027 class BoundAccessor
00028 {
00029 public:
00030         bool setGetter(Method *p) { mGetter = p; return true; }
00031         bool setSetter(Method *p) { _setter = p; return true; }
00032         bool setValue(BoundValue *p) { mValue = p; return true; }
00033 
00034         BoundValue* getValue() { return mValue; }
00035         Method *getGetter() { return mGetter; }
00036         Method *getSetter() { return _setter; }
00037 
00038 private:
00039         Method *mGetter;
00040         Method *_setter;
00041         BoundValue *mValue;
00042 };
00043 
00044 class BoundValue 
00045 {
00046 public:
00047         BoundValue() : mConst(false), mValue()
00048         { mValue.set_undefined(); }
00049         void setValue(as_value &v) { mValue = v; }
00050         as_value getCurrentValue() { return mValue; }
00051 
00052         void setType(Class *t) { mType = t; }
00053         Class *getType() { return mType; }
00054 
00055 private:
00056         bool mConst;
00057         Class *mType;
00058         as_value mValue;
00059 };
00060 
00061 } // namespace abc
00062 } // namespace gnash
00063 
00064 #endif