Gnash  0.8.11dev
TagLoadersTable.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_SWF_TAGLOADERSTABLE_H
20 #define GNASH_SWF_TAGLOADERSTABLE_H
21 
22 #include "SWF.h"
23 
24 #include <map>
25 #include <boost/noncopyable.hpp>
26 
27 // Forward declarations
28 namespace gnash {
29  class SWFStream;
30  class movie_definition;
31  class RunResources;
32 }
33 
34 namespace gnash {
35 namespace SWF {
36 
38 class TagLoadersTable : boost::noncopyable
39 {
40 public:
41 
43  //
48  typedef void (*TagLoader)(SWFStream& input, TagType type,
49  movie_definition& m, const RunResources& r);
50 
51  typedef std::map<SWF::TagType, TagLoader> Loaders;
52 
55 
57  TagLoadersTable(const Loaders& loaders)
58  :
59  _loaders(loaders)
60  {}
61 
63 
65  //
68  bool get(TagType t, TagLoader& lf) const;
69 
71  //
78 
79 private:
80 
81  Loaders _loaders;
82 
83 };
84 
85 } // namespace gnash::SWF
86 } // namespace gnash
87 
88 #endif // GNASH_SWF_TAGLOADERSTABLE_H