objects.logic.common.subjectInterface.subjectInterface Class Reference

The subjectInterface class follows a generic observer/subject pattern In reality the networkMonitor class acts as the observer, delivering a copy of all packets to various listeners. More...

Inherited by objects.logic.network.networkMonitor.networkMonitor.

List of all members.

Public Member Functions

def __init__
def attach
 Add a new observer to the list.
def detach
 removed an observer from the list.
def notifyAll


Detailed Description

The subjectInterface class follows a generic observer/subject pattern In reality the networkMonitor class acts as the observer, delivering a copy of all packets to various listeners.

These listeners include the "storageManage" and the "entityManager"

Definition at line 25 of file subjectInterface.py.


Member Function Documentation

def objects.logic.common.subjectInterface.subjectInterface.__init__ (   self  ) 

Reimplemented in objects.logic.network.networkMonitor.networkMonitor.

Definition at line 26 of file subjectInterface.py.

00026                       :
00027         self._observers = []
00028         
    ## Add a new observer to the list. The observer is notifies by calling the

def objects.logic.common.subjectInterface.subjectInterface.attach (   self,
  observer 
)

Add a new observer to the list.

The observer is notifies by calling the update method

Parameters:
observer Observer object

Definition at line 32 of file subjectInterface.py.

00032                               :
00033         if not observer in self._observers:
00034             self._observers.append(observer)
00035 
    ## removed an observer from the list.

def objects.logic.common.subjectInterface.subjectInterface.detach (   self,
  observer 
)

removed an observer from the list.

Definition at line 37 of file subjectInterface.py.

00037                               :
00038         try:
00039             self._observers.remove(observer)
00040         except ValueError:
00041             pass
00042         
00043         
00044     # Notifies all Observers
00045     # @param header Raw DataLink header
00046     # @param data  Raw DataLink frame
    def notifyAll(self, header, data):

def objects.logic.common.subjectInterface.subjectInterface.notifyAll (   self,
  header,
  data 
)

Definition at line 47 of file subjectInterface.py.

00047                                      :
00048         for observer in self._observers:
00049             observer.update(header, data)
            observer.update(header, data)


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

Generated on Mon Mar 30 00:26:35 2009 for EyeSpy by  doxygen 1.5.8