Lumiera  0.pre.03
»edit your freedom«
struct-scheme.hpp
Go to the documentation of this file.
1 /*
2  STRUCT-SCHEME.hpp - naming and designation scheme for structural assets
3 
4  Copyright (C)
5  2010, 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 
26 #ifndef ASSET_STRUCT_SCHEME_H
27 #define ASSET_STRUCT_SCHEME_H
28 
29 
30 #include "lib/symbol.hpp"
31 #include "steam/asset.hpp"
32 #include "lib/idi/entry-id.hpp"
33 #include "lib/meta/util.hpp"
34 #include "lib/format-string.hpp"
35 
36 #include <cstdlib>
37 
38 
39 
40 namespace steam {
41  struct StreamType;
42 
43 namespace mobject {
44 namespace session {
45 
46  class Fork;
47  class Clip;
48 
49 }}
50 
51 namespace asset{
52 
53  class Pipe;
54  class ProcPatt;
55  class Timeline;
56  class Sequence;
57 
58  namespace meta {
59  class TimeGrid;
60  }
61 
62 
63  namespace idi {
64 
65  using lib::Symbol;
66 
67 
68 
69  /* ==== structural asset ID scheme ==== */
70 
71  template<class STRU>
72  struct StructTraits
73  {
74  static Symbol namePrefix();
75  static Symbol catFolder();
76  static Symbol idSymbol();
77  };
78 
79 
80  template<> struct StructTraits<mobject::session::Fork>
81  {
82  static Symbol namePrefix() { return "fork"; }
83  static Symbol catFolder() { return "forks";}
84  static Symbol idSymbol() { return "fork"; }
85  };
86  template<> struct StructTraits<mobject::session::Clip>
87  {
88  static Symbol namePrefix() { return "clip"; }
89  static Symbol catFolder() { return "clips";}
90  static Symbol idSymbol() { return "clip"; }
91  };
92  template<> struct StructTraits<Pipe>
93  {
94  static Symbol namePrefix() { return "pipe"; }
95  static Symbol catFolder() { return "pipes";}
96  static Symbol idSymbol() { return "pipe"; }
97  };
98  template<> struct StructTraits<steam::StreamType>
99  {
100  static Symbol namePrefix() { return "type"; }
101  static Symbol catFolder() { return "stream-types";}
102  static Symbol idSymbol() { return "stype"; }
103  };
104  template<> struct StructTraits<const ProcPatt>
105  {
106  static Symbol namePrefix() { return "patt"; }
107  static Symbol catFolder() { return "build-templates";}
108  static Symbol idSymbol() { return "procPatt"; }
109  };
110  template<> struct StructTraits<Timeline>
111  {
112  static Symbol namePrefix() { return "tL"; }
113  static Symbol catFolder() { return "timelines";}
114  static Symbol idSymbol() { return "timeline"; }
115  };
116  template<> struct StructTraits<Sequence>
117  {
118  static Symbol namePrefix() { return "seq"; }
119  static Symbol catFolder() { return "sequences";}
120  static Symbol idSymbol() { return "sequence"; }
121  };
122  template<> struct StructTraits<meta::TimeGrid>
123  {
124  static Symbol namePrefix() { return "grid"; }
125  static Symbol catFolder() { return "time-scales";}
126  static Symbol idSymbol() { return "timeGrid"; }
127  };
128 
129 
130  /* catch-all defaults */
131  template<class X>
132  Symbol StructTraits<X>::idSymbol() { return lib::meta::typeSymbol<X>(); }
133  template<class X>
134  Symbol StructTraits<X>::catFolder(){ return idSymbol(); }
135  template<class X>
136  Symbol StructTraits<X>::namePrefix(){return idSymbol(); }
137 
138 
139 
147  template<typename TY>
148  inline Asset::Ident
149  getAssetIdent (lib::idi::EntryID<TY> const& entryID, asset::Kind assetKind =STRUCT)
150  {
151  Category cat (assetKind, idi::StructTraits<TY>::catFolder());
152  return Asset::Ident (entryID.getSym(), cat);
153  }
154 
155 
156 
157 }}} // namespace asset::idi
158 #endif
Interface: a grid and scale definition for time quantisation.
Definition: time-grid.hpp:77
"Processing Pattern" is a structural Asset representing information how to build some part of the ren...
Definition: procpatt.hpp:52
TODO type comment.
Definition: sequence.hpp:83
Tree like classification of Assets.
Definition: category.hpp:66
Simple and lightweight helpers for metaprogramming and type detection.
Front-end for printf-style string template interpolation.
typed symbolic and hash ID for asset-like position accounting.
Definition: entry-id.hpp:126
A user visible/editable Clip is a reference to a contiguous sequence of media data loaded as Asset in...
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
Definition: sequence.hpp:65
structural asset corresponding to the part of the model forming a processing pipe for generating medi...
Definition: pipe.hpp:70
Token or Atom with distinct identity.
Definition: symbol.hpp:117
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:149
Marker types to indicate a literal string and a Symbol.
Steam-Layer Interface: Assets.
Kind
top-level distinction of different Kinds of Assets.
Definition: category.hpp:46
A Fork serves as grouping device within the Session.
Definition: fork.hpp:94
Bare symbolic and hash ID used for accounting of asset like entries.
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:35
Asset::Ident getAssetIdent(lib::idi::EntryID< TY > const &entryID, asset::Kind assetKind=STRUCT)
generate an Asset identification tuple based on this EntryID&#39;s symbolic ID and type information...