Lumiera  0.pre.03
»edit your freedom«
procpatt.cpp
Go to the documentation of this file.
1 /*
2  ProcPatt - template for building some render processing network
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 
20 #include "steam/asset/procpatt.hpp"
21 #include "steam/asset/proc.hpp"
22 #include "steam/assetmanager.hpp"
24 #include "lib/util.hpp"
25 
26 using util::isnil;
27 
28 namespace steam {
29 namespace asset {
30 
31 
34 
35 
36 
43  : Struct (idi),
44  instructions_()
45  { }
46 
47 
49  ProcPatt::ProcPatt (const Asset::Ident& idi, const InstructionSequence& instru)
50  : Struct (idi),
51  instructions_(instru)
52  {
53  TODO ("verify building instructions, maybe preprocess...");
54  }
55 
56 
57 
65  ProcPatt::newCopy (string newID) const
66  {
67  TODO ("implement the Pattern-ID within the propDescriptor!");
68  TODO ("implement a consistent struct asset naming scheme at one central location!!!!!");
69  const Asset::Ident newIdi ( this->ident.name+".X"
70  , this->ident.category
71  );
72  ProcPatt* pP = new ProcPatt (newIdi, this->instructions_);
73  return AssetManager::instance().wrap (*pP);
74  }
75 
76 
81  ProcPatt&
83  {
84  DoAttach *last (0);
85  if ( !isnil (instructions_)
86  && (last = boost::get<DoAttach> (&(instructions_.back())))
87  && last->point==where
88  )
89  // instead of adding a new build instruct entry,
90  // we can extend the list in the last "DoAttach" entry.
91  last->nodes.push_back(node);
92  else
93  {
94  DoAttach entry(node, where);
95  BuildInstruct instruction(entry);
96  instructions_.push_back(instruction);
97  }
98  TODO ("declare dependency??");
99  return *this;
100  }
101 
102 
108  ProcPatt&
110  {
111  DoRecurse entry(toReuse);
112  instructions_.push_back(BuildInstruct (entry));
113  TODO ("declare dependency??");
114 
115  return *this;
116  }
117 
118 
119 
120 
121 }} // namespace asset
string name
element ID, comprehensible but sanitised.
Definition: asset.hpp:155
Steam-Layer Interface: Asset Lookup and Organisation.
Definition of a structural asset to express patterns of wiring or processing Processing patterns can ...
"Processing Pattern" is a structural Asset representing information how to build some part of the ren...
Definition: procpatt.hpp:52
Literal point
identifying the point where the nodes should be attached
AnyPair entry(Query< TY > const &query, typename WrapReturn< TY >::Wrapper &obj)
helper to simplify creating mock table entries, wrapped correctly
const Ident ident
Asset identification tuple.
Definition: asset.hpp:199
Steam-Layer implementation namespace root.
static lib::Depend< AssetManager > instance
get at the system-wide asset manager instance.
Token or Atom with distinct identity.
Definition: symbol.hpp:117
Data processing Plugins and Codecs can be treated as a specific Kind of Asset.
~ProcPatt()
emit VTable and member destructors here...
Definition: procpatt.cpp:33
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:149
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Helper classes used by asset::ProcPatt to represent the processing information.
ProcPatt(const Asset::Ident &, const InstructionSequence &)
Definition: procpatt.cpp:49
(Interface) building instructions to be executed by the Builder on the render node network under cons...
ProcPatt & operator+=(PProcPatt &toReuse)
extend the processing instructions by reference to another ProcPatt, which will be "executed" at this...
Definition: procpatt.cpp:109
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
lib::P< ProcPatt > newCopy(string newID) const
create a new ProcPatt asset as a literal copy of this one.
Definition: procpatt.cpp:65
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:35
ProcPatt & attach(Symbol where, PProc &node)
extend the processing instructions to add some Effect
Definition: procpatt.cpp:82