Gnash  0.8.11dev
Relay.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005, 2006, 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_RELAY_H
20 #define GNASH_RELAY_H
21 
22 #include <boost/noncopyable.hpp>
23 
24 namespace gnash {
25  class as_object;
26 }
27 
28 namespace gnash {
29 
31 //
35 //
38 //
43 //
46 //
49 class Relay : boost::noncopyable
50 {
51 public:
52  virtual ~Relay() = 0;
53 
55  virtual void setReachable() {}
56 
58  //
61  virtual void clean() {}
62 };
63 
64 inline Relay::~Relay()
65 {
66 }
67 
69 //
72 //
76 //
79 class ActiveRelay : public Relay
80 {
81 public:
82 
83  explicit ActiveRelay(as_object* owner)
84  :
85  _owner(owner)
86  {}
87 
89  virtual ~ActiveRelay();
90 
92  //
95  virtual void update() = 0;
96 
98  //
100  virtual void setReachable();
101 
103  //
105  virtual void clean();
106 
108  as_object& owner() const {
109  return *_owner;
110  }
111 
112 protected:
113 
115  //
118  virtual void markReachableResources() const {}
119 
120 private:
121 
123  //
126  as_object* _owner;
127 
128 };
129 
130 } // namespace gnash
131 
132 #endif
virtual void markReachableResources() const
Mark any reachable resources other than the owner.
Definition: Relay.h:118
ActiveRelay(as_object *owner)
Definition: Relay.h:83
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
virtual ~Relay()=0
Definition: Relay.h:64
The base class for all ActionScript objects.
Definition: as_object.h:161
virtual void clean()
Handle any cleanup necessary before the Relay is destroyed.
Definition: Relay.h:61
as_object & owner() const
Return the as_object that this Relay is attached to.
Definition: Relay.h:108
This is the base class for type-specific object data.
Definition: Relay.h:49
A native type that requires periodic updates from the core (movie_root).
Definition: Relay.h:79
virtual void setReachable()
A Relay itself is not a GC object, but may point to GC resources.
Definition: Relay.h:55