Lumiera  0.pre.03
»edit your freedom«
proc.hpp
Go to the documentation of this file.
1 /*
2  PROC.hpp - key abstraction: data-processing assets
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 
27 #ifndef ASSET_PROC_H
28 #define ASSET_PROC_H
29 
30 #include "steam/asset.hpp"
31 #include "steam/streamtype.hpp"
32 #include "lib/nocopy.hpp"
33 
34 
35 
36 namespace steam {
37 namespace asset {
38 
39 
40  class Proc;
41  class ProcFactory;
42 
43  typedef lib::P<const Proc> PProc;
44 
45 
46 
47  template<>
48  class ID<Proc> : public ID<Asset>
49  {
50  public:
51  ID (HashVal id);
52  ID (const Proc&);
53  };
54 
55 
56 
63  class Proc : public Asset
64  {
65  public:
67 
68  virtual const ID<Proc>& getID() const
69  {
70  return static_cast<const ID<Proc>& > (Asset::getID());
71  }
72 
74  typedef Buff* PBuff;
75  typedef void (ProcFunc) (PBuff);
76 
77 
87  virtual ProcFunc*
88  resolveProcessor() const =0;
89 
90 
91 
92  protected:
93  Proc (const Asset::Ident& idi) : Asset(idi) {}
94  friend class ProcFactory;
95  };
96 
97 
98  // definition of ID<Proc> ctors is possible now,
99  // after providing full definition of class Proc
100 
101  inline ID<Proc>::ID(HashVal id) : ID<Asset> (id) {};
102  inline ID<Proc>::ID(const Proc& proc) : ID<Asset> (proc.getID()) {};
103 
104 
105 
106 
112  {
113  public:
114  typedef lib::P<asset::Proc> PType;
115 
116  PType operator() (Asset::Ident& key);
117 
118  };
119 
120 
121 
122 
123 }} // namespace steam::asset
124 #endif
Framework for classification of media streams.
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
static ProcFactory create
storage for the static ProcFactory instance
Definition: proc.hpp:66
Steam-Layer implementation namespace root.
Factory specialised for creating Processor Asset objects.
Definition: proc.hpp:110
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
key abstraction: data processing asset
Definition: proc.hpp:63
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
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:71
Proc
Result instruction from Activity activation.
Definition: activity.hpp:140
virtual const ID< Proc > & getID() const
<
Definition: proc.hpp:68
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:35
placeholder type for the contents of a data buffer.
Definition: streamtype.hpp:112
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Definition: asset.hpp:99