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)
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
14 
51 #ifndef ASSET_META_H
52 #define ASSET_META_H
53 
54 #include "steam/asset.hpp"
56 #include "lib/idi/entry-id.hpp"
57 #include "lib/nocopy.hpp"
58 
59 
60 namespace steam {
61 namespace asset {
62 
63  class Meta;
64  class MetaFactory;
65 
66 
67  template<>
68  class ID<Meta> : public ID<Asset>
69  {
70  public:
71  ID (HashVal id);
72  ID (const Meta&);
73  };
74 
75  namespace meta {
76 
81  class Descriptor
82  {
83  public:
84  virtual ~Descriptor();
85  };
86 
99  template<class MA>
100  struct Builder;
101  }
102 
103 
109  class Meta
110  : public Asset
111  , public meta::Descriptor
112  {
113  public:
115 
117  virtual const ID<Meta>& getID() const
118  {
119  return static_cast<const ID<Meta>& > (Asset::getID());
120  }
121 
122  protected:
123  Meta (Asset::Ident const& idi)
124  : Asset{idi}
125  { }
126 
127  template<typename TY>
128  Meta (lib::idi::EntryID<TY> const& nameID)
129  : Meta{idi::getAssetIdent (nameID, META)}
130  { }
131 
132 // friend class MetaFactory; ///////////////////////////////////TODO still necessary?
133  };
134 
135 
136  // definition of ID<Meta> ctors is possible now,
137  // after providing full definition of class Meta
138 
139  inline ID<Meta>::ID(HashVal id) : ID<Asset> (id) {};
140  inline ID<Meta>::ID(const Meta& meta) : ID<Asset> (meta.getID()) {};
141 
142  typedef lib::P<Meta> PMeta;
143 
144 
145 
151  {
152  public:
153  typedef lib::P<asset::Meta> PType;
154 
155  template<class MA>
156  meta::Builder<MA> operator() (lib::idi::EntryID<MA> elementIdentity);
157 
158  template<class MA>
159  meta::Builder<MA> operator() (meta::Descriptor const& prototype, lib::idi::EntryID<MA> elementIdentity);
160 
161  };
162 
163 
164 
165 
166 }} // namespace steam::asset
167 #endif
Factory specialised for creating Metadata Asset objects.
Definition: asset/meta.hpp:149
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
key abstraction: metadata, parametrisation, customisation and similar organisational traits...
Definition: asset/meta.hpp:109
typed symbolic and hash ID for asset-like position accounting.
Definition: entry-id.hpp:126
Steam-Layer implementation namespace root.
virtual const ID< Meta > & getID() const
Definition: asset/meta.hpp:117
static MetaFactory create
storage for the static MetaFactory instance
Definition: asset/meta.hpp:114
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:149
Superinterface describing especially bookkeeping properties.
Definition: asset.hpp:139
Steam-Layer Interface: Assets.
size_t HashVal
a STL compatible hash value
Definition: hash-value.h:52
Bare symbolic and hash ID used for accounting of asset like entries.
Building and configuring a meta asset.
Definition: asset/meta.hpp:100
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:71
Interface: the unspecific, reflective base of meta assets.
Definition: asset/meta.hpp:81
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:35
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:99