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 
84  :
85  _owner(owner)
86  {}
87 
89  virtual ~ActiveRelay();
90 
92  virtual void update() = 0;
93 
95  //
97  virtual void setReachable();
98 
100  //
102  virtual void clean();
103 
105  as_object& owner() const {
106  return *_owner;
107  }
108 
109 protected:
110 
112  //
115  virtual void markReachableResources() const {}
116 
117 private:
118 
120  //
123  as_object* _owner;
124 
125 };
126 
127 } // namespace gnash
128 
129 #endif