49 using mobject::ModelPort;
55 using MPDescriptor = ModelPortRegistry::ModelPortDescriptor
const&;
57 using mobject::LUMIERA_ERROR_INVALID_MODEL_PORT;
58 using mobject::LUMIERA_ERROR_UNCONNECTED_MODEL_PORT;
70 getTimeline (
string id)
119 fabricating_ModelPorts (ctx.registry_);
120 accessing_ModelPorts();
121 transactionalSwitch (ctx.registry_);
129 PID pipeA = getPipe (
"pipeA");
130 PID pipeB = getPipe (
"pipeB");
131 TID someTimeline = getTimeline (
"some_test_Timeline");
134 MPDescriptor p1 = registry.
definePort (pipeA, someTimeline);
135 MPDescriptor p2 = registry.
definePort (pipeB, someTimeline);
143 CHECK (pipeA == p1.id());
144 CHECK (pipeB == p2.id());
145 CHECK (someTimeline == p1.holder());
146 CHECK (someTimeline == p2.holder());
153 accessing_ModelPorts ()
155 PID pipeA = getPipe (
"pipeA");
156 PID pipeB = getPipe (
"pipeB");
157 PID pipeWC = getPipe (
"WCpipe");
179 CHECK (!isSameObject (mp1, mp1x));
182 CHECK (mp1 != mpNull);
183 CHECK (mp2 != mpNull);
185 CHECK (mp1.
pipe() == pipeA);
186 CHECK (mp2.
pipe() == pipeB);
187 CHECK (mp1x.
pipe() == pipeA);
198 PID pipeA = getPipe (
"pipeA");
199 PID pipeB = getPipe (
"pipeB");
200 PID pipeWC = getPipe (
"WCpipe");
212 TID anotherTimeline = getTimeline (
"another_test_Timeline");
213 MPDescriptor p1 = registry.
definePort (pipeA, anotherTimeline);
215 CHECK (anotherTimeline == p1.holder());
216 CHECK (
ModelPort(pipeA).holder() != anotherTimeline);
219 registry.
definePort (pipeWC, anotherTimeline);
221 CHECK ( registry.
contains (pipeWC));
232 CHECK (portA.pipe() == pipeA);
233 CHECK (portB.
pipe() == pipeB);
234 CHECK (portA.holder() != anotherTimeline);
242 CHECK (portA.holder() == anotherTimeline);
243 CHECK (portA.pipe() == pipeA);
248 CHECK (pwc.pipe() == pipeWC);
249 CHECK (pwc.holder() == anotherTimeline);
255 CHECK ( registry.
contains (pipeWC));
260 CHECK (!registry.
contains (pipeWC));
271 CHECK ( registry.
contains (pipeWC));
ModelPortDescriptor const & get(PID) const
basic access operation: access the descriptor of a currently valid model port.
ModelPortDescriptor const & definePort(PID pipe, StID element_exposing_this_port)
create and register a new model port entry, within the pending transaction
A "processing pipe" represented as Asset.
void clear()
schedule removal of all registry contents.
bool contains(PID) const
does the transaction currently being built already contain a model port registration for the given ID...
Basic and generic representation of an internal query.
void commit()
activate pending model port changes.
static bool exists(ID< asset::Pipe >)
check if the global model port registration contains a mapping for the given pipe-ID ...
Mutation and management facility for model ports within the builder.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Steam-Layer implementation namespace root.
structural asset corresponding to the part of the model forming a processing pipe for generating medi...
static StructFactory retrieve
storage for the static StructFactory instance
ID< asset::Pipe > pipe() const
access the Pipe (ID) of the global model port registered with the ID underlying this model port...
static ModelPortRegistry * setActiveInstance(ModelPortRegistry &newRegistry)
switch the implicit link to the global ModelPort registry to point to the given implementation instan...
static void shutdown()
globally deactivate access to model ports
Management facility for tracking model ports.
Simple test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
A collection of frequently used helper functions to support unit testing.
StreamType::ID streamType() const
allows to fetch the StreamType directly just from a Pipe-ID
static PPipe query(string const &properties)
convenience shortcut for retrieving default configured pipes
bool isRegistered(PID) const
Handle designating a point within the model, where actually output data can be pulled.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
ID< asset::Struct > holder() const
access the timeline (or similar structural element) holding a global pipe which corresponds to this m...
key abstraction: structural asset Created automatically as a sideeffect of building the structure of ...
StreamType::ID streamType() const
convenience shortcut to access the stream type associated with the pipe-ID corresponding to this mode...
void rollback()
discard pending changes.
Generic interface to express a query for specifically typed result elements exposing some capabilitie...
void remove(PID)
remove a model port entry from the pending transaction
Top level structural element within the session.
bool isSameObject(A const &a, B const &b)
compare plain object identity, bypassing any custom comparison operators.