The Assimilation Project  based on Assimilation version
cma.assimeventobserver.AssimEventObserver Class Reference
Inheritance diagram for cma.assimeventobserver.AssimEventObserver:
Collaboration diagram for cma.assimeventobserver.AssimEventObserver:

Public Member Functions

def __init__ (self, constraints)
def notifynewevent (self, event)
def is_interesting (self, event)

Static Public Member Functions

def getvalue (event, attr)

Data Fields


Detailed Description

This class is an abstract base class which is all about observing AssimEvents.
Our subclasses presumably know what to do with these events.

Definition at line 42 of file

Constructor & Destructor Documentation

def cma.assimeventobserver.AssimEventObserver.__init__ (   self,
Initializer for AssimEventObserver class.

constraints: dict-like *or* callable() returning bool
    A dict describing our desired events. The constraints in the dict are
    effectively ANDed together.  Each key is an attribute name in either
    the event itself or its associated object.  The value associated with
    each attribute is either a list or a scalar value or something
    implementing __contains__.  A scalar value implies that it *must* have exactly
    that value, otherwise it must be *in* the associated list/tuple/etc.

    This should be able to constrain the type of event we're looking at, the
    type of event-object we're looking at, and the domain of the event-object -
    and lots of other potentially useful things.

    See the "is_interesting" method below for implementation details...

    If 'constraints' is a callable (that is, callable(constraints) is True), then
    we will just call constraints(event) to see if the event is interesting to
    this observer. Whatever 'constraints' returns will be interpreted in a
    boolean context - so returning a bool would be a good idea...

Definition at line 47 of file

Member Function Documentation

def cma.assimeventobserver.AssimEventObserver.getvalue (   event,

Definition at line 122 of file

def cma.assimeventobserver.AssimEventObserver.is_interesting (   self,
Return True if the given event conforms to our constraints.  That is, would it
be interesting to our observers?

event: AssimEvent
    The event we're evaluating to see if our listeners want to hear about it.

Definition at line 83 of file

References cma.assimeventobserver.AssimEventObserver.constraints.

Referenced by cma.assimeventobserver.FIFOEventObserver.notifynewevent().

Here is the caller graph for this function:

def cma.assimeventobserver.AssimEventObserver.notifynewevent (   self,
We get called when a new AssimEvent has occured that we might want to observe.
But we are an abstract base class so we error out with NotImplementedError every time!

Definition at line 74 of file

Field Documentation


The documentation for this class was generated from the following file: