Lumiera  0.pre.03
»edit your freedom«
testasset.cpp
Go to the documentation of this file.
1 /*
2  TestClip - test clip (stub) for checking Model/Session functionality
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 
20 #include "steam/assetmanager.hpp"
21 
22 using std::static_pointer_cast;
23 
24 
25 namespace steam {
26 namespace asset{
27 namespace test {
28 
29  namespace
30  {
31  uint counter (0);
32 
38  {
39  return Asset::Ident ( string(_Fmt("TestAsset.%i") % counter)
40  , Category (META)
41  , "test"
42  , counter++
43  );
44  }
46  make_new_ident (PAsset& ref)
47  {
48  return Asset::Ident ( string(_Fmt("%s-TestAsset.%i") % ref->ident.name
49  % counter)
50  , ref->ident.category
51  , "test"
52  , counter++
53  );
54  }
55  }
56 
57 
58  template<class A>
60  : A(make_new_ident ())
61  { };
62 
63 
64  template<class A>
66  : A(make_new_ident (pRef))
67  {
68  this->defineDependency(pRef);
69  };
70 
71 
76  template<class A>
79  {
80  return static_pointer_cast<TestAsset<A>,Asset>
81  (AssetManager::instance().getAsset (this->id));
82  };
83 
84 
85 
86 }}} // namespace steam::asset::test
87 
88 
89 
90 
91 
92  /*********************************************************/
93  /* explicit template instantiations for some Asset Kinds */
94  /*********************************************************/
95 
96 #include "steam/asset/unknown.hpp"
97 
98 
99 namespace steam {
100 namespace asset{
101 namespace test {
102 
103  template TestAsset<Asset>::TestAsset ();
104  template TestAsset<Unknown>::TestAsset ();
105 
106  template TestAsset<Asset>::TestAsset (PAsset& pRef);
107  template TestAsset<Unknown>::TestAsset (PAsset& pRef);
108 
111 
112 
113 
114 }}} // namespace steam::asset::test
Steam-Layer Interface: Asset Lookup and Organisation.
Tree like classification of Assets.
Definition: category.hpp:66
Definition: run.hpp:40
Steam-Layer implementation namespace root.
A front-end for using printf-style formatting.
static lib::Depend< AssetManager > instance
get at the system-wide asset manager instance.
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
Marker Asset to indicate an unknown media source.
A mock asset to support unit testing.
Test(mock) asset subclass usable for hijacking a given asset class (template parameter) and subsequen...
Definition: testasset.hpp:43
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:71
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:35