module Quartz::Coupler
Overview
This mixin provides coupled models with several components and coupling methods.
Direct including types
Defined in:
quartz/coupler.crInstance Method Summary
-
#<<(model : Model)
Append the given model to childrens
-
#[](name : Name) : Model
Find the component identified by the given name
-
#[]?(name : Name) : Model | Nil
Find the component identified by the given name
-
#add_child(child)
Alias for
#<<
. -
#attach(p1 : InputPort, to p2 : InputPort)
Adds an external input coupling (EIC) to self between the two given input ports.
-
#attach(p1 : InputPort, to p2 : InputPort, &block : Enumerable(Any) -> Enumerable(Any))
Adds an external input coupling (EIC) to self between the two given input ports.
-
#attach(p1 : OutputPort, to p2 : InputPort)
Adds an internal coupling (IC) to self between the two given ports.
-
#attach(p1 : OutputPort, to p2 : InputPort, &block : Enumerable(Any) -> Enumerable(Any))
Adds an internal coupling (IC) to self between the two given ports.
-
#attach(p1 : OutputPort, to p2 : OutputPort)
Adds an external output coupling (EOC) to self between the two given output ports.
-
#attach(p1 : OutputPort, to p2 : OutputPort, &block : Enumerable(Any) -> Enumerable(Any))
Adds an external output coupling (EOC) to self between the two given output ports.
-
#attach(p1 : Name, *, to p2 : Name, between sender : Coupleable, and receiver : Coupleable)
Adds a coupling to self.
-
#attach(p1 : Name, *, to p2 : Name, between sender : Coupleable, and receiver : Coupleable, &block : Enumerable(Any) -> Enumerable(Any))
Adds a coupling to self.
-
#attach(p1 : Name, *, to p2 : Name, between sender : Name, and receiver : Name)
Adds a coupling to self.
-
#attach(p1 : Name, *, to p2 : Name, between sender : Name, and receiver : Name, &block : Enumerable(Any) -> Enumerable(Any))
Adds a coupling to self.
-
#attach_input(myport : Name, *, to iport : Name, of child : Coupleable)
Adds an external input coupling (EIC) to self.
-
#attach_input(myport : Name, *, to iport : Name, of child : Coupleable, &block : Enumerable(Any) -> Enumerable(Any))
Adds an external input coupling (EIC) to self.
-
#attach_input(myport : Name, *, to iport : Name, of child : Name)
Adds an external input coupling (EIC) to self.
-
#attach_input(myport : Name, *, to iport : Name, of child : Name, &block : Enumerable(Any) -> Enumerable(Any))
Adds an external input coupling (EIC) to self.
-
#attach_output(oport : Name, *, of child : Coupleable, to myport : Name)
Adds an external output coupling (EOC) to self.
-
#attach_output(oport : Name, *, of child : Coupleable, to myport : Name, &block : Enumerable(Any) -> Enumerable(Any))
Adds an external output coupling (EOC) to self.
-
#attach_output(oport : Name, *, of child : Name, to myport : Name)
Adds an external output coupling (EOC) to self.
-
#attach_output(oport : Name, *, of child : Name, to myport : Name, &block : Enumerable(Any) -> Enumerable(Any))
Adds an external output coupling (EOC) to self.
-
#children_names : Array(Name)
Returns the children names
-
#children_size
Returns the number of children in
self
. -
#detach(p1 : InputPort, from p2 : InputPort) : Bool
Deletes a external input coupling (EOC) from self.
-
#detach(p1 : OutputPort, from p2 : InputPort) : Bool
Deletes an internal coupling (IC) from self.
-
#detach(p1 : OutputPort, from p2 : OutputPort) : Bool
Deletes an external output coupling (EOC) from self.
-
#detach(oport : Name, *, from iport : Name, between sender : Coupleable, and receiver : Coupleable) : Bool
Deletes a coupling from self.
-
#detach(oport : Name, *, from iport : Name, between sender : Name, and receiver : Name)
Deletes a coupling from self.
-
#detach(oport : Name, *, of child : Coupleable, from myport : Name) : Bool
Deletes an external output coupling (EOC) from self.
-
#detach(oport : Name, *, of child : Name, from myport : Name) : Bool
Deletes an external output coupling (EOC) from self.
-
#each_child(&)
Calls given block once for each child, passing that element as a parameter.
-
#each_child
Returns an
Iterator
for the children ofself
-
#each_coupling(port : InputPort, &)
Calls block once for each coupling, passing that element as a parameter.
-
#each_coupling(port : OutputPort, &)
Calls block once for each coupling, passing that element as a parameter.
-
#each_coupling(&)
Calls block once for each coupling (EIC, IC, EOC), passing that element as a parameter.
-
#each_coupling_reverse(port : InputPort, &)
TODO doc
- #each_coupling_reverse(port : OutputPort, &)
-
#each_input_coupling(port : InputPort, &)
Calls block once for each external input coupling (EIC) in
#input_couplings
, passing that element as a parameter. -
#each_input_coupling(&)
Calls block once for each external input coupling (EIC) in
#input_couplings
, passing that element as a parameter. -
#each_input_coupling_reverse(port : InputPort, &)
TODO doc
-
#each_internal_coupling(port : OutputPort, &)
Calls block once for each internal coupling (IC) in
#internal_couplings
, passing that element as a parameter. -
#each_internal_coupling(&)
Calls block once for each internal coupling (IC) in
#internal_couplings
, passing that element as a parameter. -
#each_internal_coupling_reverse(port : InputPort, &)
TODO doc
-
#each_output_coupling(port : OutputPort, &)
Calls block once for each external output coupling (EOC) in
#output_couplings
, passing that element as a parameter. -
#each_output_coupling(&)
Calls block once for each external output coupling (EOC) in
#output_couplings
, passing that element as a parameter. -
#each_output_coupling_reverse(port : OutputPort, &)
TODO doc
-
#find_direct_couplings(&block : OutputPort, InputPort, Array(Proc(Enumerable(Any), Enumerable(Any))) -> )
Finds and yields direct connections in the coupling graph of self.
-
#has_child?(model : Coupleable) : Bool
Returns whether given model is a child of self
-
#has_child?(name : Name) : Bool
Returns whether self has a child named like name
-
#has_transducer_for?(src : Port, dst : Port) : Bool
Whether the given coupling has an associated transducer.
-
#input_couplings(port : InputPort) : Array(InputPort)
Returns all external input couplings attached to the given input port.
-
#internal_couplings(port : OutputPort) : Array(InputPort)
Returns all internal couplings attached to the given output port.
-
#output_couplings(port : OutputPort) : Array(OutputPort)
Returns all external output couplings attached to the given output port.
-
#remove_child(model : Model)
Deletes the given model from childrens
-
#transducer_for(src : Port, dst : Port)
Returns the transducer associated with the given coupling.
Instance Method Detail
Find the component identified by the given name
Raise NoSuchChildError
error if name doesn't match any child
Adds an external input coupling (EIC) to self between the two given input ports.
Raises an InvalidPortHostError
if no coupling can be established from
given ports hosts.
Adds an external input coupling (EIC) to self between the two given input ports.
Raises an InvalidPortHostError
if no coupling can be established from
given ports hosts.
Adds an internal coupling (IC) to self between the two given ports.
Raises a FeedbackLoopError
if p1 and p2 hosts are the same child
when constructing the internal coupling. Direct feedback loops are not
allowed, i.e, no output port of a component may be connected to an input
port of the same component.
Raises an InvalidPortHostError
if no coupling can be established from
given ports hosts.
Adds an internal coupling (IC) to self between the two given ports.
Raises a FeedbackLoopError
if p1 and p2 hosts are the same child
when constructing the internal coupling. Direct feedback loops are not
allowed, i.e, no output port of a component may be connected to an input
port of the same component.
Raises an InvalidPortHostError
if no coupling can be established from
given ports hosts.
Adds an external output coupling (EOC) to self between the two given output ports.
Raises an InvalidPortHostError
if no coupling can be established from
given ports hosts.
Adds an external output coupling (EOC) to self between the two given output ports.
Raises an InvalidPortHostError
if no coupling can be established from
given ports hosts.
Adds a coupling to self. Establish a relation between the two given ports that belongs respectively to sender and receiver.
Note: If given port names p1 and p2 doesn't exist within their host (respectively sender and receiver), they will be automatically generated.
Adds a coupling to self. Establish a relation between the two given ports that belongs respectively to sender and receiver.
Note: If given port names p1 and p2 doesn't exist within their host (respectively sender and receiver), they will be automatically generated.
Adds a coupling to self. Establish a relation between the two given ports that belongs respectively to sender and receiver.
Note: If given port names p1 and p2 doesn't exist within their host (respectively sender and receiver), they will be automatically generated.
Adds a coupling to self. Establish a relation between the two given ports that belongs respectively to sender and receiver.
Note: If given port names p1 and p2 doesn't exist within their host (respectively sender and receiver), they will be automatically generated.
Adds an external input coupling (EIC) to self. Establish a relation between a self input port and a child input port.
Note: If given port names myport and iport doesn't exist within their host (respectively self and child), they will be automatically generated.
Adds an external input coupling (EIC) to self. Establish a relation between a self input port and a child input port.
Note: If given port names myport and iport doesn't exist within their host (respectively self and child), they will be automatically generated.
Adds an external input coupling (EIC) to self. Establish a relation between a self input port and a child input port.
Note: If given port names myport and iport doesn't exist within their host (respectively self and child), they will be automatically generated.
Adds an external input coupling (EIC) to self. Establish a relation between a self input port and a child input port.
Note: If given port names myport and iport doesn't exist within their host (respectively self and child), they will be automatically generated.
Adds an external output coupling (EOC) to self. Establish a relation between an output port of one of self's children and one of self's output ports.
Note: If given port names oport and myport doesn't exist within their host (respectively child and self), they will be automatically generated.
Adds an external output coupling (EOC) to self. Establish a relation between an output port of one of self's children and one of self's output ports.
Note: If given port names oport and myport doesn't exist within their host (respectively child and self), they will be automatically generated.
Adds an external output coupling (EOC) to self. Establish a relation between an output port of one of self's children and one of self's output ports.
Note: If given port names oport and myport doesn't exist within their host (respectively child and self), they will be automatically generated.
Adds an external output coupling (EOC) to self. Establish a relation between an output port of one of self's children and one of self's output ports.
Note: If given port names oport and myport doesn't exist within their host (respectively child and self), they will be automatically generated.
Deletes a external input coupling (EOC) from self.
Returns true
if successful.
Deletes an internal coupling (IC) from self.
Returns true
if successful.
Deletes an external output coupling (EOC) from self.
Returns true
if successful.
Deletes a coupling from self. Returns true
if successful.
Deletes a coupling from self. Returns true
if successful.
Deletes an external output coupling (EOC) from self. Returns true
if
successful.
Deletes an external output coupling (EOC) from self. Returns true
if
successful.
Calls block once for each coupling, passing that element as a parameter. Given input port is used to filter external input couplings (EIC) having this port as a source.
Calls block once for each coupling, passing that element as a parameter. Given output port is used to filter internal couplings and external output couplings (IC, EOC) having this port as a source.
Calls block once for each coupling (EIC, IC, EOC), passing that element as a parameter.
Calls block once for each external input coupling (EIC) in
#input_couplings
, passing that element as a parameter. Given port is
used to filter couplings having this port as a source.
TODO check if port in input_couplings ?
Calls block once for each external input coupling (EIC) in
#input_couplings
, passing that element as a parameter.
Calls block once for each internal coupling (IC) in
#internal_couplings
, passing that element as a parameter. Given port
is used to filter couplings having this port as a source.
Calls block once for each internal coupling (IC) in
#internal_couplings
, passing that element as a parameter.
Calls block once for each external output coupling (EOC) in
#output_couplings
, passing that element as a parameter. Given port is
used to filter couplings having this port as a source.
Calls block once for each external output coupling (EOC) in
#output_couplings
, passing that element as a parameter.
Finds and yields direct connections in the coupling graph of self.
Whether the given coupling has an associated transducer.
Returns all external input couplings attached to the given input port.
Returns all internal couplings attached to the given output port.
Returns all external output couplings attached to the given output port.
Returns the transducer associated with the given coupling.