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) 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 
29 #include "steam/asset/procpatt.hpp"
30 #include "steam/asset/proc.hpp"
31 #include "steam/assetmanager.hpp"
33 #include "lib/util.hpp"
34 
35 using util::isnil;
36 
37 namespace steam {
38 namespace asset {
39 
40 
43 
44 
45 
52  : Struct (idi),
53  instructions_()
54  { }
55 
56 
58  ProcPatt::ProcPatt (const Asset::Ident& idi, const InstructionSequence& instru)
59  : Struct (idi),
60  instructions_(instru)
61  {
62  TODO ("verify building instructions, maybe preprocess...");
63  }
64 
65 
66 
74  ProcPatt::newCopy (string newID) const
75  {
76  TODO ("implement the Pattern-ID within the propDescriptor!");
77  TODO ("implement a consistent struct asset naming scheme at one central location!!!!!");
78  const Asset::Ident newIdi ( this->ident.name+".X"
79  , this->ident.category
80  );
81  ProcPatt* pP = new ProcPatt (newIdi, this->instructions_);
82  return AssetManager::instance().wrap (*pP);
83  }
84 
85 
90  ProcPatt&
92  {
93  DoAttach *last (0);
94  if ( !isnil (instructions_)
95  && (last = boost::get<DoAttach> (&(instructions_.back())))
96  && last->point==where
97  )
98  // instead of adding a new build instruct entry,
99  // we can extend the list in the last "DoAttach" entry.
100  last->nodes.push_back(node);
101  else
102  {
103  DoAttach entry(node, where);
104  BuildInstruct instruction(entry);
105  instructions_.push_back(instruction);
106  }
107  TODO ("declare dependency??");
108  return *this;
109  }
110 
111 
117  ProcPatt&
119  {
120  DoRecurse entry(toReuse);
121  instructions_.push_back(BuildInstruct (entry));
122  TODO ("declare dependency??");
123 
124  return *this;
125  }
126 
127 
128 
129 
130 }} // namespace asset
string name
element ID, comprehensible but sanitised.
Definition: asset.hpp:164
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:61
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:208
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:126
Data processing Plugins and Codecs can be treated as a specific Kind of Asset.
~ProcPatt()
emit VTable and member destructors here...
Definition: procpatt.cpp:42
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:158
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:58
(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:118
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
lib::P< ProcPatt > newCopy(string newID) const
create a new ProcPatt asset as a literal copy of this one.
Definition: procpatt.cpp:74
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:44
ProcPatt & attach(Symbol where, PProc &node)
extend the processing instructions to add some Effect
Definition: procpatt.cpp:91