Class: Roby::StateEvent

Inherits:
EventGenerator show all
Defined in:
lib/roby/state/events.rb

Overview

A state event is an event which emits when some parameters over the state are reached. See DeltaEvent and TimePointEvent.

Direct Known Subclasses

DeltaEvent, TimePointEvent

Constant Summary

Constants included from Log::EventGeneratorHooks

Log::EventGeneratorHooks::HOOKS

Constants included from Log::BasicObjectHooks

Log::BasicObjectHooks::HOOKS

Instance Attribute Summary

Attributes inherited from EventGenerator

#command, #executable, #pending, #unreachable_handlers

Attributes inherited from PlanObject

#executable, #plan, #removed_at

Attributes inherited from BasicObject

#distribute

Instance Method Summary collapse

Methods inherited from EventGenerator

#&, #_dump, _load, #achieve_with, #add_child_object, #call, #call_handlers, #call_without_propagation, #called, #calling, #cancel, #controlable?, #default_command, #delay, #droby_dump, #each_precondition, #emit, #emit_failed, #emit_on, #emit_without_propagation, #emitting, event_gathering, #executable?, #filter, #fired, #forward, #forward_once, #forwarding, gather_events, #if_unreachable, #initialize, #initialize_copy, #last, #model, #name, #new, #on, #once, #pending?, #postpone, #postponed, #precondition, #pretty_print, #realize_with, #related_events, #related_tasks, remove_event_gathering, #signal, #signal_once, #signalling, #to_event, #unreachable!, #until, #when_unreachable, #|

Methods included from Distributed::DRobyModel::Dump

#droby_dump

Methods included from Distributed::EventNotifications

#fired, #forwarding, #signalling

Methods included from Propagation::EventPrecedenceChanged

#added_child_object, #removed_child_object

Methods included from Log::EventGeneratorHooks

#added_child_object, #called, #calling, #emitting, #fired, #forwarding, #postponed, #removed_child_object, #signalling

Methods inherited from PlanObject

#add_child_object, #apply_relation_changes, child_plan_object, #each_plan_child, #executable?, #finalized?, #forget_peer, #read_write?, #remotely_useful?, #removing_child_object, #replace_by, #replace_subplan_by, #root_object, #root_object?, #subscribed?, #update_on?, #updated_by?

Methods included from Distributed::RelationModificationHooks

#added_child_object, #removed_child_object

Methods included from Transactions::PlanObjectUpdates

#adding_child_object, #removing_child_object

Methods included from DirectedRelationSupport

#add_child_object, #add_parent_object, #check_is_relation, #related_objects, #relations, #remove_child_object, #remove_children, #remove_parent_object, #remove_parents, #remove_relations

Methods inherited from BasicObject

#add_sibling_for, #distribute?, distribute?, #finalized?, #forget_peer, #has_sibling_on?, #initialize_copy, local_only, #read_write?, #remotely_useful?, #remove_sibling_for, #self_owned?, #sibling_of, #sibling_on, #subscribe, #subscribed?, #update_on?, #updated?, #updated_by?, #updated_peers

Methods included from Log::BasicObjectHooks

#added_owner, #removed_owner

Constructor Details

This class inherits a constructor from Roby::EventGenerator

Instance Method Details

#disableObject

Call to disable this event. When the state events are disabled, they will no more emit.



89
# File 'lib/roby/state/events.rb', line 89

def disable; @disabled = true end

#disabled?Boolean

True if this event is currently disabled

Returns:

  • (Boolean)


80
# File 'lib/roby/state/events.rb', line 80

def disabled?; @disabled end

#enable(reset = true) ⇒ Object

Call to reenable this event. If reset is true, the event is reset at the same time.



83
84
85
86
# File 'lib/roby/state/events.rb', line 83

def enable(reset = true)
    @disabled = false
    self.reset if reset
end

#enabled?Boolean

True if this event is currently active

Returns:

  • (Boolean)


78
# File 'lib/roby/state/events.rb', line 78

def enabled?; !@disabled end