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) Lumiera.org
5  2010, 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 
35 #ifndef ASSET_STRUCT_SCHEME_H
36 #define ASSET_STRUCT_SCHEME_H
37 
38 
39 #include "lib/symbol.hpp"
40 #include "steam/asset.hpp"
41 #include "lib/idi/entry-id.hpp"
42 #include "lib/meta/util.hpp"
43 #include "lib/format-string.hpp"
44 
45 #include <cstdlib>
46 
47 
48 
49 namespace steam {
50  struct StreamType;
51 
52 namespace mobject {
53 namespace session {
54 
55  class Fork;
56  class Clip;
57 
58 }}
59 
60 namespace asset{
61 
62  class Pipe;
63  class ProcPatt;
64  class Timeline;
65  class Sequence;
66 
67  namespace meta {
68  class TimeGrid;
69  }
70 
71 
72  namespace idi {
73 
74  using lib::Symbol;
75 
76 
77 
78  /* ==== structural asset ID scheme ==== */
79 
80  template<class STRU>
81  struct StructTraits
82  {
83  static Symbol namePrefix();
84  static Symbol catFolder();
85  static Symbol idSymbol();
86  };
87 
88 
89  template<> struct StructTraits<mobject::session::Fork>
90  {
91  static Symbol namePrefix() { return "fork"; }
92  static Symbol catFolder() { return "forks";}
93  static Symbol idSymbol() { return "fork"; }
94  };
95  template<> struct StructTraits<mobject::session::Clip>
96  {
97  static Symbol namePrefix() { return "clip"; }
98  static Symbol catFolder() { return "clips";}
99  static Symbol idSymbol() { return "clip"; }
100  };
101  template<> struct StructTraits<Pipe>
102  {
103  static Symbol namePrefix() { return "pipe"; }
104  static Symbol catFolder() { return "pipes";}
105  static Symbol idSymbol() { return "pipe"; }
106  };
107  template<> struct StructTraits<steam::StreamType>
108  {
109  static Symbol namePrefix() { return "type"; }
110  static Symbol catFolder() { return "stream-types";}
111  static Symbol idSymbol() { return "stype"; }
112  };
113  template<> struct StructTraits<const ProcPatt>
114  {
115  static Symbol namePrefix() { return "patt"; }
116  static Symbol catFolder() { return "build-templates";}
117  static Symbol idSymbol() { return "procPatt"; }
118  };
119  template<> struct StructTraits<Timeline>
120  {
121  static Symbol namePrefix() { return "tL"; }
122  static Symbol catFolder() { return "timelines";}
123  static Symbol idSymbol() { return "timeline"; }
124  };
125  template<> struct StructTraits<Sequence>
126  {
127  static Symbol namePrefix() { return "seq"; }
128  static Symbol catFolder() { return "sequences";}
129  static Symbol idSymbol() { return "sequence"; }
130  };
131  template<> struct StructTraits<meta::TimeGrid>
132  {
133  static Symbol namePrefix() { return "grid"; }
134  static Symbol catFolder() { return "time-scales";}
135  static Symbol idSymbol() { return "timeGrid"; }
136  };
137 
138 
139  /* catch-all defaults */
140  template<class X>
141  Symbol StructTraits<X>::idSymbol() { return lib::meta::typeSymbol<X>(); }
142  template<class X>
143  Symbol StructTraits<X>::catFolder(){ return idSymbol(); }
144  template<class X>
145  Symbol StructTraits<X>::namePrefix(){return idSymbol(); }
146 
147 
148 
156  template<typename TY>
157  inline Asset::Ident
158  getAssetIdent (lib::idi::EntryID<TY> const& entryID, asset::Kind assetKind =STRUCT)
159  {
160  Category cat (assetKind, idi::StructTraits<TY>::catFolder());
161  return Asset::Ident (entryID.getSym(), cat);
162  }
163 
164 
165 
166 }}} // namespace asset::idi
167 #endif
Interface: a grid and scale definition for time quantisation.
Definition: time-grid.hpp:86
"Processing Pattern" is a structural Asset representing information how to build some part of the ren...
Definition: procpatt.hpp:61
TODO type comment.
Definition: sequence.hpp:92
Tree like classification of Assets.
Definition: category.hpp:75
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:135
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:74
structural asset corresponding to the part of the model forming a processing pipe for generating medi...
Definition: pipe.hpp:79
Token or Atom with distinct identity.
Definition: symbol.hpp:126
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:158
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:55
A Fork serves as grouping device within the Session.
Definition: fork.hpp:103
Bare symbolic and hash ID used for accounting of asset like entries.
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:44
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...