Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
output-designation.cpp
Go to the documentation of this file.
1/*
2 OutputDesignation - specifying a desired output destination
3
4 Copyright (C)
5 2010, 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
31#include "lib/error.hpp"
32#include "lib/symbol.hpp"
33#include "lib/query-util.hpp"
40#include "lib/util.hpp"
41
42#include <boost/functional/hash.hpp>
43#include <cstdlib>
44
45using lumiera::Symbol;
50using lib::HashVal;
51using util::uNum;
52
53namespace steam {
54namespace mobject {
55
59
60
63 {
65
66 AbsoluteSpec (PID explicitTarget)
67 : target_(explicitTarget)
68 { }
69
70 PID resolve (PPipe) { return target_; }
71 };
72
75 {
77
78 IndirectSpec (RefPlacement const& indirectTarget)
79 : mediator_(indirectTarget)
80 { }
81
82 PID
84 {
85 REQUIRE (mediator_);
86 UNIMPLEMENTED ("how to query a placement for output designation");
87 }
88 };
89
92 {
94
95 RelativeSpec (uint relative_busNr)
96 : busNr_(relative_busNr)
97 { }
98
99 PID
101 {
102 UNIMPLEMENTED ("how the hell can we get a grip on the target to resolve the bus??");
103 }
104 };
105
106
107
108
110
111
116 : spec_(AbsoluteSpec (explicitTarget))
117 { }
118
119
125 : spec_(IndirectSpec (indirectTarget))
126 { }
127
128
139 : spec_(RelativeSpec (relative_busNr))
140 { }
141
142
143
144
145
146
147 namespace _mapping {
148
152 HashVal
154 {
155 return hash_value (query);
156 }
157
163 HashVal
165 {
166 PPipe res;
168 typeHandler.resolve (res, query4pipe);
169 HashVal resulting_targetPipeID (res? (HashVal)res->getID() : 0 );
170 return resulting_targetPipeID;
171 }
172
174
175 uint
177 {
178 string seqNr = query4pipe.extractID (SEQNR_PREDICATE);
179 return uNum (seqNr); // defaults to 0 in case of an invalid number
180 }
181
184 {
185 return query4pipe.rebuild()
187 }
188 }
189
190
191
192}} // namespace mobject
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
Builder & removeTerm(Symbol termPredicate)
remove the first term from this query definition, which matches the given predicate symbol
Definition query.hpp:507
Generic interface to express a query for specifically typed result elements exposing some capabilitie...
Definition query.hpp:254
Builder rebuild() const
Definition query.hpp:550
string extractID(Symbol predicate) const
convenience shortcut to extract a desired name-ID.
Definition query.hpp:564
the "front side" interface: the Steam-Layer code can use this QueryHandler to retrieve instances of t...
virtual bool resolve(P< TY > &solution, Query< TY > const &q)=0
try to find or create an object of type TY fulfilling the given query.
user-visible Interface to the ConfigRules subsystem.
static lib::Depend< ConfigResolver > instance
Singleton factory instance, configured with the actual implementation type.
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Definition asset.hpp:98
OutputDesignation(PID explicitTarget)
create an output designation by directly specifying the target to connect
SpecBuff spec_
Storage to hold the Target Spec inline.
Definition of the concrete frontend for rule based configuration within the session.
Lumiera error handling (C++ interface).
unsigned int uint
Definition integral.hpp:29
Core abstraction of the Session model: a media object.
string extractID(Symbol sym, const string &termString)
(preliminary) helper: instead of really parsing and evaluating the terms, just do a regular expressio...
string removeTerm(Symbol sym, string &queryString)
(preliminary) helper: cut a term with the given symbol.
size_t HashVal
a STL compatible hash value
Definition hash-value.h:52
Query< asset::Pipe > build_corresponding_sourceQuery(Query< asset::Pipe > const &query4pipe)
..and build the corresponding defaults source query for this case
uint is_defaults_query_with_channel(Query< asset::Pipe > const &query4pipe)
detect the special case, when actually the Nth solution of a defaults query is requested
HashVal slot(Query< asset::Pipe > const &query)
yield a suitable table slot for this query
HashVal resolveQuery(Query< asset::Pipe > const &query4pipe)
delegate target pipe resolution to the rules system
OutputDesignation::PPipe PPipe
OutputDesignation::TargetSpec TargetSpec
OutputDesignation::PID PID
Steam-Layer implementation namespace root.
uint uNum(CStr charPtr)
positive integral number from textual representation
Definition util.hpp:117
Core abstraction: symbolic representation of some output target.
Translating and wiring output designations.
A generic reference mechanism for Placements, as added to the current session.
framework and to resolve logical queries.
Utilities to support working with predicate queries.
IndirectSpec(RefPlacement const &indirectTarget)
Marker types to indicate a literal string and a Symbol.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...