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) Lumiera.org
5  2008, 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 
36 #ifndef ASSET_PROC_H
37 #define ASSET_PROC_H
38 
39 #include "steam/asset.hpp"
40 #include "steam/streamtype.hpp"
41 #include "lib/nocopy.hpp"
42 
43 
44 
45 namespace steam {
46 namespace asset {
47 
48 
49  class Proc;
50  class ProcFactory;
51 
52  typedef lib::P<const Proc> PProc;
53 
54 
55 
56  template<>
57  class ID<Proc> : public ID<Asset>
58  {
59  public:
60  ID (HashVal id);
61  ID (const Proc&);
62  };
63 
64 
65 
72  class Proc : public Asset
73  {
74  public:
76 
77  virtual const ID<Proc>& getID() const
78  {
79  return static_cast<const ID<Proc>& > (Asset::getID());
80  }
81 
83  typedef Buff* PBuff;
84  typedef void (ProcFunc) (PBuff);
85 
86 
96  virtual ProcFunc*
97  resolveProcessor() const =0;
98 
99 
100 
101  protected:
102  Proc (const Asset::Ident& idi) : Asset(idi) {}
103  friend class ProcFactory;
104  };
105 
106 
107  // definition of ID<Proc> ctors is possible now,
108  // after providing full definition of class Proc
109 
110  inline ID<Proc>::ID(HashVal id) : ID<Asset> (id) {};
111  inline ID<Proc>::ID(const Proc& proc) : ID<Asset> (proc.getID()) {};
112 
113 
114 
115 
121  {
122  public:
123  typedef lib::P<asset::Proc> PType;
124 
125  PType operator() (Asset::Ident& key);
126 
127  };
128 
129 
130 
131 
132 }} // namespace steam::asset
133 #endif
Framework for classification of media streams.
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
static ProcFactory create
storage for the static ProcFactory instance
Definition: proc.hpp:75
Steam-Layer implementation namespace root.
Factory specialised for creating Processor Asset objects.
Definition: proc.hpp:119
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:158
key abstraction: data processing asset
Definition: proc.hpp:72
Superinterface describing especially bookkeeping properties.
Definition: asset.hpp:148
Steam-Layer Interface: Assets.
size_t HashVal
a STL compatible hash value
Definition: hash-value.h:56
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:80
Proc
Result instruction from Activity activation.
Definition: activity.hpp:149
virtual const ID< Proc > & getID() const
<
Definition: proc.hpp:77
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:44
placeholder type for the contents of a data buffer.
Definition: streamtype.hpp:121
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Definition: asset.hpp:108