The Assimilation Project  based on Assimilation version 1.1.7.1474836767
cma.assimevent.AssimEvent Class Reference
Inheritance diagram for cma.assimevent.AssimEvent:
Collaboration diagram for cma.assimevent.AssimEvent:

Public Member Functions

def __init__ (self, associatedobject, eventtype, extrainfo=None)
 
def notifynewevent (self)
 

Static Public Member Functions

def disable_all_observers ()
 
def enable_all_observers ()
 
def is_registered (observer)
 
def registerobserver (observer)
 
def unregisterobserver (observer)
 

Data Fields

 associatedobject
 
 eventtype
 
 extrainfo
 

Static Public Attributes

int CREATEOBJ = 0
 
int OBJUP = 1
 
int OBJDOWN = 2
 
int OBJWARN = 3
 
int OBJUNWARN = 4
 
int OBJUPDATE = 5
 
int OBJDELETE = 6
 
dictionary eventtypenames
 
bool event_observation_enabled = True
 
list observers = []
 

Detailed Description

This class is all about highlighting events which others might want to know about.
Other objects can register to be notified about the creation of new events.
Or at least they will be able to when that code is written ;-).
All of this happens without any concern by the event objects themselves.
It is handled by static methods and a tiny bit of code in our constructor.

Definition at line 30 of file assimevent.py.

Constructor & Destructor Documentation

def cma.assimevent.AssimEvent.__init__ (   self,
  associatedobject,
  eventtype,
  extrainfo = None 
)
Initializer for AssimEvent class.
We save our parameters then notify our registered observers.

Parameters:
----------
associatedobject: GraphNode
    The GraphNode associated with this event
eventtype: int
    one of AssimEvent.CREATEOBJ, AssimEvent.OBJUP, AssimEvent.OBJDOWN,
    AssimEvent.OBJWARN, AssimEvent.OBJUPDATE or AssimEvent.OBJDELETE

Definition at line 60 of file assimevent.py.

Member Function Documentation

def cma.assimevent.AssimEvent.disable_all_observers ( )
static

Definition at line 82 of file assimevent.py.

def cma.assimevent.AssimEvent.enable_all_observers ( )
static

Definition at line 87 of file assimevent.py.

def cma.assimevent.AssimEvent.is_registered (   observer)
static
Return True if the given observer is registered with us.

Definition at line 92 of file assimevent.py.

def cma.assimevent.AssimEvent.notifynewevent (   self)
method for notifying all our observers that a new event
has been created.
We call the 'notifynewevent' method in each registered observer object.

Definition at line 119 of file assimevent.py.

def cma.assimevent.AssimEvent.registerobserver (   observer)
static
Static method for registering an observer with the AssimEvent class.
The given observer object must implement a 'notifynewevent' method
-- because we will surely call it :-D.

Definition at line 98 of file assimevent.py.

def cma.assimevent.AssimEvent.unregisterobserver (   observer)
static
Static method for unregistering an observer with the AssimEvent class.
We return True if the given observer was registered with us, False otherwise.

Definition at line 109 of file assimevent.py.

Field Documentation

cma.assimevent.AssimEvent.associatedobject

Definition at line 75 of file assimevent.py.

int cma.assimevent.AssimEvent.CREATEOBJ = 0
static

Definition at line 38 of file assimevent.py.

bool cma.assimevent.AssimEvent.event_observation_enabled = True
static

Definition at line 56 of file assimevent.py.

cma.assimevent.AssimEvent.eventtype

Definition at line 76 of file assimevent.py.

dictionary cma.assimevent.AssimEvent.eventtypenames
static
Initial value:
1 = {
2  CREATEOBJ: 'create',
3  OBJUP: 'up',
4  OBJDOWN: 'down',
5  OBJWARN: 'warn',
6  OBJUNWARN: 'unwarn',
7  OBJUPDATE: 'update',
8  OBJDELETE: 'delete'
9  }

Definition at line 46 of file assimevent.py.

cma.assimevent.AssimEvent.extrainfo

Definition at line 77 of file assimevent.py.

int cma.assimevent.AssimEvent.OBJDELETE = 6
static

Definition at line 44 of file assimevent.py.

int cma.assimevent.AssimEvent.OBJDOWN = 2
static

Definition at line 40 of file assimevent.py.

int cma.assimevent.AssimEvent.OBJUNWARN = 4
static

Definition at line 42 of file assimevent.py.

int cma.assimevent.AssimEvent.OBJUP = 1
static

Definition at line 39 of file assimevent.py.

int cma.assimevent.AssimEvent.OBJUPDATE = 5
static

Definition at line 43 of file assimevent.py.

int cma.assimevent.AssimEvent.OBJWARN = 3
static

Definition at line 41 of file assimevent.py.

list cma.assimevent.AssimEvent.observers = []
static

Definition at line 58 of file assimevent.py.


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