module

Quartz::Coupler

This mixin provides coupled models with several components and coupling methods.

Instance methods

<<(model : Model)

Append the given model to childrens

Source
[](name : Name) : Model

Find the component identified by the given name

Raise NoSuchChildError error if name doesn't match any child

Source
[]?(name : Name) : Model | Nil

Find the component identified by the given name

Source
add_child(child)

Alias for #<<.

Source
attach(p1 : InputPort, to p2 : InputPort)

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.

Source
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.

Raises an InvalidPortHostError if no coupling can be established from given ports hosts.

Source
attach(p1 : OutputPort, to p2 : InputPort)

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.

Source
attach(p1 : OutputPort, to p2 : InputPort, &block : Enumerable(Any) -> Enumerable(Any))

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.

Source
attach(p1 : OutputPort, to p2 : OutputPort)

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.

Source
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.

Raises an InvalidPortHostError if no coupling can be established from given ports hosts.

Source
attach(p1 : Name, *, to p2 : Name, between sender : Coupleable, and receiver : Coupleable)

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.

Source
attach(p1 : Name, *, to p2 : Name, between sender : Coupleable, and receiver : Coupleable, &block : Enumerable(Any) -> Enumerable(Any))

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.

Source
attach(p1 : Name, *, to p2 : Name, between sender : Name, and receiver : Name)

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.

Source
attach(p1 : Name, *, to p2 : Name, between sender : Name, and receiver : Name, &block : Enumerable(Any) -> Enumerable(Any))

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.

Source
attach_input(myport : Name, *, to iport : Name, of child : Coupleable)

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.

Source
attach_input(myport : Name, *, to iport : Name, of child : Coupleable, &block : Enumerable(Any) -> Enumerable(Any))

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.

Source
attach_input(myport : Name, *, to iport : Name, of child : Name)

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.

Source
attach_input(myport : Name, *, to iport : Name, of child : Name, &block : Enumerable(Any) -> Enumerable(Any))

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.

Source
attach_output(oport : Name, *, of child : Coupleable, to myport : Name)

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.

Source
attach_output(oport : Name, *, of child : Coupleable, to myport : Name, &block : Enumerable(Any) -> Enumerable(Any))

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.

Source
attach_output(oport : Name, *, of child : Name, to myport : Name)

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.

Source
attach_output(oport : Name, *, of child : Name, to myport : Name, &block : Enumerable(Any) -> Enumerable(Any))

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.

Source
children_names

Returns the children names

Source
children_size

Returns the number of children in self.

Source
detach(p1 : InputPort, from p2 : InputPort) : Bool

Deletes a external input coupling (EOC) from self.

Returns true if successful.

Source
detach(p1 : OutputPort, from p2 : InputPort) : Bool

Deletes an internal coupling (IC) from self.

Returns true if successful.

Source
detach(p1 : OutputPort, from p2 : OutputPort) : Bool

Deletes an external output coupling (EOC) from self.

Returns true if successful.

Source
detach(oport : Name, *, from iport : Name, between sender : Coupleable, and receiver : Coupleable) : Bool

Deletes a coupling from self. Returns true if successful.

Source
detach(oport : Name, *, from iport : Name, between sender : Name, and receiver : Name)

Deletes a coupling from self. Returns true if successful.

Source
detach(oport : Name, *, of child : Coupleable, from myport : Name) : Bool

Deletes an external output coupling (EOC) from self. Returns true if successful.

Source
detach(oport : Name, *, of child : Name, from myport : Name) : Bool

Deletes an external output coupling (EOC) from self. Returns true if successful.

Source
each_child

Calls given block once for each child, passing that element as a parameter.

Source
each_child

Returns an Iterator for the children of self

Source
each_coupling(port : InputPort, &)

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.

Source
each_coupling(port : OutputPort, &)

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.

Source
each_coupling

Calls block once for each coupling (EIC, IC, EOC), passing that element as a parameter.

Source
each_coupling_reverse(port : InputPort, &)

TODO doc

Source
each_coupling_reverse(port : OutputPort, &)
Source
each_input_coupling(port : InputPort, &)

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 ?

Source
each_input_coupling

Calls block once for each external input coupling (EIC) in #input_couplings, passing that element as a parameter.

Source
each_input_coupling_reverse(port : InputPort, &)

TODO doc

Source
each_internal_coupling(port : OutputPort, &)

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.

Source
each_internal_coupling

Calls block once for each internal coupling (IC) in #internal_couplings, passing that element as a parameter.

Source
each_internal_coupling_reverse(port : InputPort, &)

TODO doc

Source
each_output_coupling(port : OutputPort, &)

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.

Source
each_output_coupling

Calls block once for each external output coupling (EOC) in #output_couplings, passing that element as a parameter.

Source
each_output_coupling_reverse(port : OutputPort, &)

TODO doc

Source
find_direct_couplings

Finds and yields direct connections in the coupling graph of self.

Source
has_child?(model : Coupleable) : Bool

Returns whether given model is a child of self

Source
has_child?(name : Name) : Bool

Returns whether self has a child named like name

Source
has_transducer_for?(src : Port, dst : Port) : Bool

Whether the given coupling has an associated transducer.

Source
input_couplings(port : InputPort) : Array(InputPort)

Returns all external input couplings attached to the given input port.

Source
internal_couplings(port : OutputPort) : Array(InputPort)

Returns all internal couplings attached to the given output port.

Source
output_couplings(port : OutputPort) : Array(OutputPort)

Returns all external output couplings attached to the given output port.

Source
remove_child(model : Model)

Deletes the given model from childrens

Source
transducer_for(src : Port, dst : Port)

Returns the transducer associated with the given coupling.

Source

Nested types