diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-06-03 07:15:37 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-06-03 07:15:37 (GMT) |
commit | bfaec62d795ffe17ef82640efa06be6b056475cc (patch) | |
tree | 91905e4bc986a8b220dc38bd9b40eeb8ad37477d /src/FbTk/ObjectRegistry.hh | |
parent | b7e693c42518a2558d9a18b9eab6a55122ce1f43 (diff) | |
download | fluxbox-bfaec62d795ffe17ef82640efa06be6b056475cc.zip fluxbox-bfaec62d795ffe17ef82640efa06be6b056475cc.tar.bz2 |
remove some unnecessary architecture
Diffstat (limited to 'src/FbTk/ObjectRegistry.hh')
-rw-r--r-- | src/FbTk/ObjectRegistry.hh | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/FbTk/ObjectRegistry.hh b/src/FbTk/ObjectRegistry.hh deleted file mode 100644 index 4f47b77..0000000 --- a/src/FbTk/ObjectRegistry.hh +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | // ObjectRegistry.hh for FbTk | ||
2 | // Copyright (c) 2007 Fluxbox Team (fluxgen at fluxbox dot org) | ||
3 | // | ||
4 | // Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | // copy of this software and associated documentation files (the "Software"), | ||
6 | // to deal in the Software without restriction, including without limitation | ||
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | // and/or sell copies of the Software, and to permit persons to whom the | ||
9 | // Software is furnished to do so, subject to the following conditions: | ||
10 | // | ||
11 | // The above copyright notice and this permission notice shall be included in | ||
12 | // all copies or substantial portions of the Software. | ||
13 | // | ||
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | // DEALINGS IN THE SOFTWARE. | ||
21 | |||
22 | #ifndef OBJECTREGISTRY_HH | ||
23 | #define OBJECTREGISTRY_HH | ||
24 | |||
25 | #include <map> | ||
26 | #include <string> | ||
27 | |||
28 | namespace FbTk { | ||
29 | |||
30 | template <typename Creator> | ||
31 | class ObjectRegistry { | ||
32 | public: | ||
33 | typedef std::map<std::string, Creator> CreatorMap; | ||
34 | |||
35 | static ObjectRegistry<Creator> &instance() { | ||
36 | static ObjectRegistry<Creator> s_instance; | ||
37 | return s_instance; | ||
38 | } | ||
39 | |||
40 | Creator lookup(const std::string &name) { | ||
41 | typename CreatorMap::const_iterator it = m_creators.find(name); | ||
42 | if (it == m_creators.end()) | ||
43 | return 0; | ||
44 | return it->second; | ||
45 | } | ||
46 | |||
47 | bool registerObject(const std::string &name, Creator creator) { | ||
48 | m_creators[name] = creator; | ||
49 | return true; | ||
50 | } | ||
51 | |||
52 | const CreatorMap creatorMap() const { return m_creators; } | ||
53 | |||
54 | private: | ||
55 | ObjectRegistry() {} | ||
56 | ~ObjectRegistry() {} | ||
57 | |||
58 | CreatorMap m_creators; | ||
59 | }; | ||
60 | |||
61 | } // end namespace FbTk | ||
62 | |||
63 | #endif // OBJECTREGISTRY_HH | ||