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)
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 
24 #ifndef ASSET_PIPE_H
25 #define ASSET_PIPE_H
26 
27 #include "steam/asset/struct.hpp"
28 #include "steam/asset/procpatt.hpp"
29 #include "steam/streamtype.hpp"
30 #include "common/query.hpp"
31 
32 #include <string>
33 
34 
35 
36 namespace steam {
37 namespace asset {
38 
39  using lumiera::Query;
40  using std::string;
41 
42  class Pipe;
43  typedef lib::P<Pipe> PPipe;
44 
45 
46  template<>
47  class ID<Pipe> : public ID<Struct>
48  {
49  public:
50  ID (HashVal id);
51  ID (Pipe const&);
52  ID (PPipe const&);
53 
56  operator PPipe() const;
57 
60  StreamType::ID streamType() const;
61  };
62 
63 
64 
70  class Pipe
71  : public Struct
72  {
73  PProcPatt wiringTemplate_;
74  StreamType::ID streamID_;
75 
76  public:
77  string shortDesc;
78  string longDesc;
79 
80  virtual const ID<Pipe>& getID() const
81  {
82  return static_cast<const ID<Pipe>& > (Asset::getID());
83  }
84 
85 
86  protected:
87  Pipe (Asset::Ident const&, string const& streamID, PProcPatt& wiring, string shortName ="", string longName ="") ;
88 // friend class StructFactory;
89  friend class StructFactoryImpl;
90 
91  public:
92  string const& getPipeID() const { return ident.name; }
93  StreamType::ID getStreamID() const { return streamID_; }
94  PProcPatt const& getProcPatt() const { return wiringTemplate_; }
95 
96 
98  void switchProcPatt (PProcPatt& another);
99 
101  static PPipe query (string const& properties);
102 
104  static PPipe lookup (ID<Pipe> id);
105  };
106 
107 
108  // catch up with postponed definition of ID<Struct> ctors...
109  //
110  inline ID<Pipe>::ID(HashVal id) : ID<Struct> (id) {};
111  inline ID<Pipe>::ID(Pipe const& pipe) : ID<Struct> (pipe.getID()) {};
112  inline ID<Pipe>::ID(PPipe const& pipe) : ID<Struct> (pipe->getID()) {};
113 
114  inline
115  ID<Pipe>::operator PPipe() const
116  {
117  return Pipe::lookup(*this);
118  }
119 
120  inline StreamType::ID
122  {
123  return Pipe::lookup(*this)->getStreamID();
124  }
125 
126 
127 
128 
129 }} // namespace steam::asset
130 #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:70
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:67
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:149
virtual const ID< Pipe > & getID() const
<
Definition: pipe.hpp:80
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
key abstraction: structural asset Created automatically as a sideeffect of building the structure of ...
Definition: struct.hpp:104
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:35
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:270
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Definition: asset.hpp:99