class Quartz::MultiComponent::Model

Included Modules

Defined in:

quartz/multi_component/model.cr
quartz/visitor.cr

Class Method Summary

Instance Method Summary

Macro Summary

Instance methods inherited from module Quartz::Coupleable

add_input_port(name) add_input_port, add_output_port(name) add_output_port, add_port(port : InputPort)
add_port(port : OutputPort)
add_port
, each_input_port(&) each_input_port, each_output_port(&) each_output_port, input_port(name : Name) : InputPort input_port, input_port?(name : Name) : InputPort | Nil input_port?, input_port_list : Array(InputPort) input_port_list, input_port_names input_port_names, output_port(name : Name) : OutputPort output_port, output_port?(name : Name) : OutputPort | Nil output_port?, output_port_list : Array(OutputPort) output_port_list, output_port_names output_port_names, remove_input_port(name) remove_input_port, remove_output_port(name) remove_output_port, remove_port(port : InputPort)
remove_port(port : OutputPort)
remove_port

Instance methods inherited from module Quartz::Observable

add_observer(observer : Observer) add_observer, count_observers count_observers, delete_observer(observer : Observer) : Bool delete_observer, notify_observers(info = nil) notify_observers

Instance methods inherited from class Quartz::Model

accept(visitor : Visitor) accept, accept_children(visitor) accept_children, after_initialize after_initialize, inspect(io) inspect, name : Name name, name=(name : Name) name=, processor : Processor | Nil processor, processor=(processor : Processor | Nil) processor=, processor? : Processor | Nil | Nil processor?, to_s(io) to_s

Constructor methods inherited from class Quartz::Model

new(name : Name) new

Instance methods inherited from class Reference

==(other : Quartz::Any) ==

Instance methods inherited from class Object

===(other : Quartz::Any) ===

Class Method Detail

def self.preferred_event_set : Symbol #

def self.preferred_event_set=(preferred_event_set : Symbol) #

[View source]
def self.preferred_event_set? : Symbol | Nil #

Instance Method Detail

def <<(component) #

[View source]
def accept_children(visitor) #

[View source]
def components : Hash(String | Symbol, Quartz::MultiComponent::Component) #

[View source]

Macro Detail

macro event_set(name) #

Defines the preferred event set for this particular class of coupled models. Specified event set will be used to coordinate childrens in all instances of this multicomponent model.

Writing:

class MyCoupled < CoupledModel
  event_set ladder_queue
end

Is the same as writing:

class MyCoupled < CoupledModel
  self.preferred_event_set = :ladder_queue
end

Or the same as:

class MyCoupled < CoupledModel; end
MyCoupled.preferred_event_set = :ladder_queue

The argument can be a string literal, a symbol literal or a plain name.


[View source]
macro input(*names) #

Defines default input ports for each of the given arguments. Those default input ports will be available in all instances, including instances of subclasses (meaning that ports are inherited).

Writing:

class MyModel < AtomicModel
  input port_name
end

Is the same as writing:

class MyModel < AtomicModel
  def initialize(name)
    super(name)
    add_input_port :port_name
  end
end

The arguments can be string literals, symbol literals or plain names. However, they will be converted to symbol literals when the model is instantiated.

class MyModel < AtomicModel
  input :in1, "in2", in3
end

[View source]
macro output(*names) #

Defines default output ports for each of the given arguments. Those default output ports will be available in all instances, including instances of subclasses (meaning that ports are inherited).

Writing:

class MyModel < AtomicModel
  output port_name
end

Is the same as writing:

class MyModel < AtomicModel
  def initialize(name)
    super(name)
    add_output_port :port_name
  end
end

The arguments can be string literals, symbol literals or plain names. However, they will be converted to symbols literals when the model is instantiated.

class MyModel < AtomicModel
  output :out1, "out2", out3
end

[View source]