Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
buildinstruct.hpp
Go to the documentation of this file.
1/*
2 BUILDINSTRUCT.hpp - Instructions for building some configuration of render nodes.
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
22#ifndef STEAM_ASSET_BUILDINSTRUCT_H
23#define STEAM_ASSET_BUILDINSTRUCT_H
24
25
26#include "lib/symbol.hpp"
27
28#include <boost/variant.hpp>
29#include <string>
30
31using std::string;
32
33
34
35namespace steam {
36namespace asset {
37
38 using lib::Symbol;
39 using lib::Literal;
40
41 class Proc;
42 class ProcPatt;
43
46
47
48 static Symbol CURRENT = "current";
49
50 struct DoAttach
51 {
52 vector<PProc> nodes;
53
56
58 : point(where)
59 { }
60
61 DoAttach (PProc& node, Symbol where = CURRENT)
62 : point(where)
63 {
64 nodes.push_back(node);
65 }
66 };
67
68
69 struct DoRecurse
70 {
72
73 explicit DoRecurse (PProcPatt& pattern) : subPattern_(pattern) {}
74 };
75
76
77
79 {
80 // How to do this? we need some context to test the condition...
81 };
82
83
84 typedef boost::variant< DoAttach, DoRecurse, DoConditional > InstructEntry;
85
102 : public InstructEntry
103 {
104 template<typename T>
105 BuildInstruct (T& instr) : InstructEntry() {}
106
107 // TODO: this ctor is *not* correct, just to make it compile
108 // There is a strange problem with boost::variant, probably because the
109 // template parameter T could be anything (but actually we know it's one
110 // of our Instruction types.
111 // I have to re-investigate this design anyway, and probably will replace
112 // the boost::variant by something else, derive from a common base or such.
113 // Note: as of 8/2008 ProcPatt is just a draft and not implemented.
114
115 // Note: 9/2013 : meanwhile the obvious solution would be to use our "polymorphic value",
116 // which was invented exactly to solve this notorious design mismatch in C++
117 };
118
119
120
121
122
123}} // namespace steam::asset
124#endif
Inline string literal.
Definition symbol.hpp:78
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition p.hpp:77
Token or Atom with distinct identity.
Definition symbol.hpp:120
The asset subsystem of the Steam-Layer.
static Symbol CURRENT
boost::variant< DoAttach, DoRecurse, DoConditional > InstructEntry
Steam-Layer implementation namespace root.
Proc
Result instruction from Activity activation.
Definition activity.hpp:140
(Interface) building instructions to be executed by the Builder on the render node network under cons...
DoAttach(Symbol where=CURRENT)
DoAttach(PProc &node, Symbol where=CURRENT)
Literal point
identifying the point where the nodes should be attached
DoRecurse(PProcPatt &pattern)
Marker types to indicate a literal string and a Symbol.