objects.logic.common.threads.appThreadBase.appThreadBase Class Reference

Base class for all thread based objects. More...

Inherits threading::Thread.

Inherited by objects.gui.threads.mouseHoverThread.mouseHoverThread, objects.gui.threads.redrawThread.redrawThread, objects.logic.network.pcapyImplementation.pcapyWorkerThread, objects.storage.storageManager.storageMonitorThread, and objects.storage.storageManager.storageWriterThread.

List of all members.

Public Member Functions

def __init__
 Constructor method.
def reset
 Resets the members to their original state.
def killSignal
 Sets the killSwitch flag to True.
def getKillSignal
 returns the value of the killSwitch flag
def wait
 Waits for threadEvent event to be set.
def killSignalAndWait
 Just calls killSignal() and wiat().

Public Attributes

 parent
 threadEvent
 killSwitch


Detailed Description

Base class for all thread based objects.

This class is basically a representation of a thread, which can be started, stopped and restarted on command. appThreadBase derived objects are typically alive for the duration of most of the application.

Definition at line 23 of file appThreadBase.py.


Member Function Documentation

def objects.logic.common.threads.appThreadBase.appThreadBase.__init__ (   self,
  _parent 
)

Constructor method.

Parameters:
_parent pointer. It could be anything, but usually whatever object starts the thread

Definition at line 27 of file appThreadBase.py.

00027                                :
00028         Thread.__init__(self)
00029         self.parent = _parent
00030         
00031         self.threadEvent = Event()
00032         self.threadEvent.set()
00033         
00034         self.killSwitch = False;
00035     
    ## Resets the members to their original state

def objects.logic.common.threads.appThreadBase.appThreadBase.getKillSignal (   self  ) 

returns the value of the killSwitch flag

Returns:
Boolean

Definition at line 48 of file appThreadBase.py.

00048                            :
00049         return self.killSwitch;
00050         
00051     
    ## Waits for threadEvent event to be set.

def objects.logic.common.threads.appThreadBase.appThreadBase.killSignal (   self  ) 

Sets the killSwitch flag to True.

The KillSwitch is just the flag which causes the while() loop in the run method to end.

Definition at line 43 of file appThreadBase.py.

00043                         :
00044         self.killSwitch = True;
00045         
    ## returns the value of the killSwitch flag

def objects.logic.common.threads.appThreadBase.appThreadBase.killSignalAndWait (   self,
  timeSecs 
)

Just calls killSignal() and wiat().

Parameters:
timeSecs Number of seconds to wait.

Definition at line 60 of file appThreadBase.py.

00060                                          :
00061         self.killSignal()
00062         self.wait(timeSecs)
00063         
00064     
    

def objects.logic.common.threads.appThreadBase.appThreadBase.reset (   self  ) 

Resets the members to their original state.

Definition at line 37 of file appThreadBase.py.

00037                    :
00038         self.threadEvent.set()        
00039         self.killSwitch = False;
00040         
    ## Sets the killSwitch flag to True. The KillSwitch is just the flag which causes the while() loop

def objects.logic.common.threads.appThreadBase.appThreadBase.wait (   self,
  timeSecs 
)

Waits for threadEvent event to be set.

Parameters:
timeSecs Number of seconds to wait.

Definition at line 54 of file appThreadBase.py.

00054                             :
00055         self.threadEvent.wait(timeSecs)
00056         
00057     
    ## Just calls killSignal() and wiat()


Member Data Documentation

Definition at line 29 of file appThreadBase.py.

Definition at line 31 of file appThreadBase.py.


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