MessageInterpreter.MessageInterpreter Class Reference


Detailed Description

MessageInterpreter is the base class for all message interpreters.

A message interpreter is an object that given a message may choose to ignore it, or "interpret" the message by performing operations. An operation may in turn generate a new message.

#include <class_message_interpreter_1_1_message_interpreter.h>

Inheritance diagram for MessageInterpreter.MessageInterpreter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  __init__ ()
  __del__ ()
  setDispatcher ()
  getDispatcher ()
  requestEndOfFrameNotification ()
  setTrace ()
  getTrace ()
  getActionMethod ()
  setTraceLog ()
  doTrace ()
  activate ()
  Abstract - to be implemented by the subclasses.
  deactivate ()
  Abstract - to be implemented by the subclasses.
  isActive ()
  Returns whether or not the interpreter is active.
  safetick ()
  tick ()
  Remember that since this method is invoked by a timer it is called from a different thread.
  setAlarm ()
  Sets the alarm for the given number of seconds.
  isAlarmSet ()
  Returns True if the alarm is set; False otherwise.
  configureEventMapping ()
  Abstract - to be implemented by the subclasses.
  addEventMapping ()
  ( eventType, button ) = eventData
  clearEventMapping ()
  Clear all event mappings for this interpreter.
  handleEvent ()
  Returns True if the event has a callback and was executed; False otherwise.
  wantsMessage ()
  If processMessage were to be called at this point would this interpreter handle it?
  processMessage ()
  Abstract - to be implemented by the subclasses.

Member Function Documentation

MessageInterpreter.MessageInterpreter.__init__ ( )

Reimplemented in AlternativeInterpreter.AlternativeInterpreter, ApplicationInterpreter.ApplicationInterpreter, BookmarkInterpreter.BookmarkInterpreter, ClientInterpreter.ClientInterpreter, CloudInterpreter.CloudInterpreter, ComparisonUi.ComparisonUi, DelayInterpreter.DelayInterpreter, DiagnosticModeInterpreter.DiagnosticModeInterpreter, DialogInterpreter.DialogInterpreter, DisplayInterpreter.DisplayInterpreter, DocumentInterpreter.DocumentInterpreter, EnvironmentInterpreter.EnvironmentInterpreter, EnvironmentLibraryInterpreter.EnvironmentLibraryInterpreter, ExternalDataAccessInterpreter.ExternalDataAccessInterpreter, FloorIndicator.FloorInterpreter, FrameworkInterpreter.FrameworkInterpreter, HUD.HeadsUpDisplayInterpreter, HotkeyInterpreter.HotkeyInterpreter, ImportInterpreter.ImportInterpreter, ImportUiInterpreter.ImportUiInterpreter, JavaScriptInterpreter.JavaScriptInterpreter, KynapseInterpreter.KynapseInterpreter, LightInterpreter.LightInterpreter, LightsUi.BaseLightsUi, LightsUi.ClipsUi, LightsUi.LightsUi, ManipulatorInterpreter.ManipulatorInterpreter, MaterialInterpreter.MaterialInterpreter, MeasurementInterpreter.MeasurementInterpreter, MenuInterpreter.MenuInterpreter, MenubarUi.MenubarUi, MessageInterpreter.CompositeMessageInterpreter, ModelInterpreter.ModelInterpreter, NavigationBaseInterpreter.NavigationBaseInterpreter, NavigationInterpreter.NavigationInterpreter, NetworkInterpreter.NetworkInterpreter, ObjectPatchesInterpreter.ObjectPatchesInterpreter, OneClickInterpreter.OneClickInterpreter, OverlayInterpreter.NewOverlayInterpreter, OverlayInterpreter.OverlayInterpreter, RelationInterpreter.RelationInterpreter, RenderInterpreter.RenderInterpreter, SceneInterpreter.SceneInterpreter, ScriptInterpreter.ScriptInterpreter, SelectionInterpreter.SelectionInterpreter, SelectionSetInterpreter.SelectionSetInterpreter, ServerInterpreter.ServerInterpreter, ShotInterpreter.ShotInterpreter, StageInterpreter.StageInterpreter, StoryboardInterpreter.StoryboardInterpreter, StoryboardUi.StoryboardUi, StylesInterpreter.StylesInterpreter, TextureInterpreter.TextureInterpreter, TriggerInterpreter.TriggerInterpreter, TumbleTrackDollyInterpreter.TumbleTrackDollyInterpreter, UIInterpreter.UIInterpreter, Ui3dInterpreter.Ui3dInterpreter, UiSelector.OverlayUiNew, UiSelector.UiSelectorInterpreter, UndoInterpreter.UndoInterpreter, ViewerInterpreter.ViewerInterpreter, and XMLSocketInterpreter.XMLSocketInterpreter.

MessageInterpreter.MessageInterpreter.setDispatcher ( )
MessageInterpreter.MessageInterpreter.getDispatcher ( )
MessageInterpreter.MessageInterpreter.requestEndOfFrameNotification ( )
MessageInterpreter.MessageInterpreter.setTrace ( )
MessageInterpreter.MessageInterpreter.getTrace ( )
MessageInterpreter.MessageInterpreter.getActionMethod ( )
MessageInterpreter.MessageInterpreter.setTraceLog ( )
MessageInterpreter.MessageInterpreter.doTrace ( )
MessageInterpreter.MessageInterpreter.deactivate ( )

Abstract - to be implemented by the subclasses.

Performs the operations necessary to place this interpreter into a passive state. Ensure that this base class implementation is called by the subclass implementation.

Reimplemented in AlternativeInterpreter.AlternativeInterpreter, ApplicationInterpreter.ApplicationInterpreter, ClientInterpreter.ClientInterpreter, DialogInterpreter.DialogInterpreter, DisplayInterpreter.DisplayInterpreter, DocumentInterpreter.DocumentInterpreter, EnvironmentInterpreter.EnvironmentInterpreter, ExternalDataAccessInterpreter.ExternalDataAccessInterpreter, FloorIndicator.FloorInterpreter, HUD.HeadsUpDisplayInterpreter, HotkeyInterpreter.HotkeyInterpreter, ImportInterpreter.ImportInterpreter, JavaScriptInterpreter.JavaScriptInterpreter, LightInterpreter.LightInterpreter, ManipulatorInterpreter.ManipulatorInterpreter, MaterialInterpreter.MaterialInterpreter, MessageInterpreter.CompositeMessageInterpreter, ModelInterpreter.ModelInterpreter, NavigationBaseInterpreter.NavigationBaseInterpreter, NavigationInterpreter.NavigationInterpreter, NetworkInterpreter.NetworkInterpreter, ObjectPatchesInterpreter.ObjectPatchesInterpreter, OverlayInterpreter.OverlayInterpreter, RelationInterpreter.RelationInterpreter, RenderInterpreter.RenderInterpreter, SceneInterpreter.SceneInterpreter, ScriptInterpreter.ScriptInterpreter, SelectionInterpreter.SelectionInterpreter, SelectionSetInterpreter.SelectionSetInterpreter, ServerInterpreter.ServerInterpreter, ShotInterpreter.ShotInterpreter, StageInterpreter.StageInterpreter, StoryboardInterpreter.StoryboardInterpreter, TextureInterpreter.TextureInterpreter, TriggerInterpreter.TriggerInterpreter, Ui3dInterpreter.Ui3dInterpreter, UiSelector.UiSelectorInterpreter, UndoInterpreter.UndoInterpreter, ViewerInterpreter.ViewerInterpreter, and XMLSocketInterpreter.XMLSocketInterpreter.

MessageInterpreter.MessageInterpreter.isActive ( )

Returns whether or not the interpreter is active.

MessageInterpreter.MessageInterpreter.safetick ( )
MessageInterpreter.MessageInterpreter.tick ( )

Remember that since this method is invoked by a timer it is called from a different thread.

This means in general that this method must be thread safe. Typically it will just trigger a redraw or queue a message.

Reimplemented in DelayInterpreter.DelayInterpreter, HUD.HeadsUpDisplayInterpreter, ImportInterpreter.ImportInterpreter, MaterialInterpreter.MaterialInterpreter, OverlayInterpreter.OverlayInterpreter, and UIInterpreter.UIInterpreter.

MessageInterpreter.MessageInterpreter.setAlarm ( )

Sets the alarm for the given number of seconds.

When the given time expires, the tick() method of this interpreter is called. If the alarm was previously set, then it is first cleared unless the onlyifnotset flag is True, in which case we do nothing.

MessageInterpreter.MessageInterpreter.isAlarmSet ( )

Returns True if the alarm is set; False otherwise.

MessageInterpreter.MessageInterpreter.addEventMapping ( )

( eventType, button ) = eventData

Assigns the callback to the given event. When the event is detected by handleEvent(), the callback is called with the event as an argument. Callbacks in turn can generate messages whose arguments may include the relevant parts of the event. Note, the signature of the callback should be:

def myCallback( self, event )

MessageInterpreter.MessageInterpreter.clearEventMapping ( )

Clear all event mappings for this interpreter.

MessageInterpreter.MessageInterpreter.handleEvent ( )

Returns True if the event has a callback and was executed; False otherwise.

Note, no event handling occurs if the interpreter is deactivated.

Reimplemented in ManipulatorInterpreter.ManipulatorInterpreter, and TriggerInterpreter.TriggerInterpreter.

MessageInterpreter.MessageInterpreter.processMessage ( )

Abstract - to be implemented by the subclasses.

The default implementation should be sufficient for most intepreters. Returns True if the message was processed; False otherwise. Note, no message processing occurs if the interpreter is deactivated.

The signature of a message handler method should be:

def methodName( self, message )

where message.id == methodName

Reimplemented in DocumentInterpreter.DocumentInterpreter, HUD.HeadsUpDisplayInterpreter, MessageInterpreter.CompositeMessageInterpreter, ServerInterpreter.ServerInterpreter, StoryboardInterpreter.StoryboardInterpreter, and XMLSocketInterpreter.XMLSocketInterpreter.


MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter
MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter MessageInterpreter.MessageInterpreter