lib/fast-tcpn/tcpn.rb
def cb_for(what, tag = nil, &block)
      if what == :transition
        cb_for_transition tag, &block
      elsif what == :place
        cb_for_place tag, &block
      elsif what == :clock
        cb_for_clock tag, &block
      else
        raise InvalidCallback.new "Don't know how to add callback for #{what}"
      end
    end
def cb_for(what, tag = nil, &block)
      if what == :transition
        cb_for_transition tag, &block
      elsif what == :place
        cb_for_place tag, &block
      elsif what == :clock
        cb_for_clock tag, &block
      else
        raise InvalidCallback.new "Don't know how to add callback for #{what}"
      end
    end
Defines new callback for this net.
 +what+ can be +:transition+, +:place+ or +:clock+.
 Transition callbacks are fired when transitions are fired, place
 callbacks when place marking changes, clock callbacks when clock is moved.
 +tag+ for transition and clock callback can be +:before+ or +:after+, for
 place, can be +:add+ or +:remove+. It defines when the callbacks fill be
 fired. If omitted, it will be called for both cases.

 Callback block for transition gets value of event +tag+ (:before or :after)
 FastTCPN::Transition::Event object.

 Callback block for place gets value of event +tag+ (:add or :remove)
 and FastTCPN::Place::Event object.

 Callback block for clock gets value of event +tag+ (:before or :after)
 and FastTCPN::TCPN::ClockEvent object.