Lumiera  0.pre.03
»edit your freedom«
pipe.hpp
Go to the documentation of this file.
1 /*
2  PIPE.hpp - structural asset denoting a processing pipe generating media output
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 
33 #ifndef ASSET_PIPE_H
34 #define ASSET_PIPE_H
35 
36 #include "steam/asset/struct.hpp"
37 #include "steam/asset/procpatt.hpp"
38 #include "steam/streamtype.hpp"
39 #include "common/query.hpp"
40 
41 #include <string>
42 
43 
44 
45 namespace steam {
46 namespace asset {
47 
48  using lumiera::Query;
49  using std::string;
50 
51  class Pipe;
52  typedef lib::P<Pipe> PPipe;
53 
54 
55  template<>
56  class ID<Pipe> : public ID<Struct>
57  {
58  public:
59  ID (HashVal id);
60  ID (Pipe const&);
61  ID (PPipe const&);
62 
65  operator PPipe() const;
66 
69  StreamType::ID streamType() const;
70  };
71 
72 
73 
79  class Pipe
80  : public Struct
81  {
82  PProcPatt wiringTemplate_;
83  StreamType::ID streamID_;
84 
85  public:
86  string shortDesc;
87  string longDesc;
88 
89  virtual const ID<Pipe>& getID() const
90  {
91  return static_cast<const ID<Pipe>& > (Asset::getID());
92  }
93 
94 
95  protected:
96  Pipe (Asset::Ident const&, string const& streamID, PProcPatt& wiring, string shortName ="", string longName ="") ;
97 // friend class StructFactory;
98  friend class StructFactoryImpl;
99 
100  public:
101  string const& getPipeID() const { return ident.name; }
102  StreamType::ID getStreamID() const { return streamID_; }
103  PProcPatt const& getProcPatt() const { return wiringTemplate_; }
104 
105 
107  void switchProcPatt (PProcPatt& another);
108 
110  static PPipe query (string const& properties);
111 
113  static PPipe lookup (ID<Pipe> id);
114  };
115 
116 
117  // catch up with postponed definition of ID<Struct> ctors...
118  //
119  inline ID<Pipe>::ID(HashVal id) : ID<Struct> (id) {};
120  inline ID<Pipe>::ID(Pipe const& pipe) : ID<Struct> (pipe.getID()) {};
121  inline ID<Pipe>::ID(PPipe const& pipe) : ID<Struct> (pipe->getID()) {};
122 
123  inline
124  ID<Pipe>::operator PPipe() const
125  {
126  return Pipe::lookup(*this);
127  }
128 
129  inline StreamType::ID
131  {
132  return Pipe::lookup(*this)->getStreamID();
133  }
134 
135 
136 
137 
138 }} // namespace steam::asset
139 #endif
Definition of a structural asset to express patterns of wiring or processing Processing patterns can ...
Framework for classification of media streams.
Basic and generic representation of an internal query.
Steam-Layer implementation namespace root.
structural asset corresponding to the part of the model forming a processing pipe for generating medi...
Definition: pipe.hpp:79
Implementation details, especially concerning how configuration queries are resolved and when to crea...
static PPipe lookup(ID< Pipe > id)
convenience shortcut for lookup by id
Definition: pipe.cpp:76
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:158
virtual const ID< Pipe > & getID() const
<
Definition: pipe.hpp:89
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
key abstraction: structural asset Created automatically as a sideeffect of building the structure of ...
Definition: struct.hpp:113
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:44
Asset representation of structural elements within the model.
Generic interface to express a query for specifically typed result elements exposing some capabilitie...
Definition: query.hpp:279
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Definition: asset.hpp:108