Lumiera  0.pre.03
»edit your freedom«
asset/meta.hpp
Go to the documentation of this file.
1 /*
2  META.hpp - key abstraction: metadata and organisational asset
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
60 #ifndef ASSET_META_H
61 #define ASSET_META_H
62 
63 #include "steam/asset.hpp"
65 #include "lib/idi/entry-id.hpp"
66 #include "lib/nocopy.hpp"
67 
68 
69 namespace steam {
70 namespace asset {
71 
72  class Meta;
73  class MetaFactory;
74 
75 
76  template<>
77  class ID<Meta> : public ID<Asset>
78  {
79  public:
80  ID (HashVal id);
81  ID (const Meta&);
82  };
83 
84  namespace meta {
85 
90  class Descriptor
91  {
92  public:
93  virtual ~Descriptor();
94  };
95 
108  template<class MA>
109  struct Builder;
110  }
111 
112 
118  class Meta
119  : public Asset
120  , public meta::Descriptor
121  {
122  public:
124 
126  virtual const ID<Meta>& getID() const
127  {
128  return static_cast<const ID<Meta>& > (Asset::getID());
129  }
130 
131  protected:
132  Meta (Asset::Ident const& idi)
133  : Asset{idi}
134  { }
135 
136  template<typename TY>
137  Meta (lib::idi::EntryID<TY> const& nameID)
138  : Meta{idi::getAssetIdent (nameID, META)}
139  { }
140 
141 // friend class MetaFactory; ///////////////////////////////////TODO still necessary?
142  };
143 
144 
145  // definition of ID<Meta> ctors is possible now,
146  // after providing full definition of class Meta
147 
148  inline ID<Meta>::ID(HashVal id) : ID<Asset> (id) {};
149  inline ID<Meta>::ID(const Meta& meta) : ID<Asset> (meta.getID()) {};
150 
151  typedef lib::P<Meta> PMeta;
152 
153 
154 
160  {
161  public:
162  typedef lib::P<asset::Meta> PType;
163 
164  template<class MA>
165  meta::Builder<MA> operator() (lib::idi::EntryID<MA> elementIdentity);
166 
167  template<class MA>
168  meta::Builder<MA> operator() (meta::Descriptor const& prototype, lib::idi::EntryID<MA> elementIdentity);
169 
170  };
171 
172 
173 
174 
175 }} // namespace steam::asset
176 #endif
Factory specialised for creating Metadata Asset objects.
Definition: asset/meta.hpp:158
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
key abstraction: metadata, parametrisation, customisation and similar organisational traits...
Definition: asset/meta.hpp:118
typed symbolic and hash ID for asset-like position accounting.
Definition: entry-id.hpp:135
Steam-Layer implementation namespace root.
virtual const ID< Meta > & getID() const
Definition: asset/meta.hpp:126
static MetaFactory create
storage for the static MetaFactory instance
Definition: asset/meta.hpp:123
Mix-Ins to allow or prohibit various degrees of copying and cloning.
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:158
Superinterface describing especially bookkeeping properties.
Definition: asset.hpp:148
Steam-Layer Interface: Assets.
size_t HashVal
a STL compatible hash value
Definition: hash-value.h:56
Bare symbolic and hash ID used for accounting of asset like entries.
Building and configuring a meta asset.
Definition: asset/meta.hpp:109
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:80
Interface: the unspecific, reflective base of meta assets.
Definition: asset/meta.hpp:90
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:44
Naming and labelling scheme for structural assets.
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Definition: asset.hpp:108