MessageRegistry.MessageRegistry Class Reference


Detailed Description

Our message architecture requires that a message be registered with this class before it may be created or queued up for processing.

The registry is a singleton object. Use theMessageRegistry to access the registry.

All registered messages must have a unique message id, which is usually a name. The message id must not contain whitespace.

Note the registry is thread safe.

#include <class_message_registry_1_1_message_registry.h>

List of all members.

Classes

class   __RegistryItem
  This is a private class used by the Message Registry. More...

Public Member Functions

  __init__ ()
  isValueOfType ()
  __len__ ()
  Return the number of registered messages.
  isRegistered ()
  Return True if a message with the given message id exists in the registry, otherwise return False.
  register ()
  Register a message in the registry.
  create ()
  Create a message.
  hasProperty ()
  Return True if the message with the given message id has the specified properties, otherwise return False.
  documentation ()
  Return the string containing a message's documentation.
  dataType ()
  Return a tuple containing the data types expected for all the arguments of a particular message.
  ids ()
  clear ()

Member Function Documentation

MessageRegistry.MessageRegistry.__init__ ( )
MessageRegistry.MessageRegistry.isValueOfType ( )
MessageRegistry.MessageRegistry.__len__ ( )

Return the number of registered messages.

May be 0 if no messages have been registered.

MessageRegistry.MessageRegistry.isRegistered ( )

Return True if a message with the given message id exists in the registry, otherwise return False.

MessageRegistry.MessageRegistry.register ( )

Register a message in the registry.

Returns True if the message is successfully registered, otherwise return False.

messageID - Must be a non-empty string.

dataType - A tuple indicating the type for the message data. For example:

  • no data required use ()
  • a single integer argument use ( int )
  • a string, integer and float use ( str, int, float )

properties - An integer value specifying the properties. May be Message.kBroadcastable, Message.kInternal, Message.kUndoable, or bitwise combination.

documentation - A string completely describing the purpose and use of the message. Note you may (and should) use the triple " notation for specifying the documentation. Documentation must be provided for non-internal messages.

MessageRegistry.MessageRegistry.create ( )

Create a message.

Return a valid message if the message was created successfully (meaning the message was registered and the data provided was valid), otherwise return None.

MessageRegistry.MessageRegistry.hasProperty ( )

Return True if the message with the given message id has the specified properties, otherwise return False.

MessageRegistry.MessageRegistry.documentation ( )

Return the string containing a message's documentation.

May return an empty string if the message does not exist or if the message has no documentation.

MessageRegistry.MessageRegistry.dataType ( )

Return a tuple containing the data types expected for all the arguments of a particular message.

If the message does not exist, then an empty tuple is returned.

MessageRegistry.MessageRegistry.ids ( )
MessageRegistry.MessageRegistry.clear ( )

MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry
MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry MessageRegistry.MessageRegistry