Public Member Functions | Private Attributes | Static Private Attributes | List of all members
wiimote.WIIMote._WiiCallbackStack Class Reference
Inheritance diagram for wiimote.WIIMote._WiiCallbackStack:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, wiiDriver, sloppy=True)
 
def pause (self)
 
def pop (self)
 
def push (self, func)
 
def resume (self, sloppy=True)
 
def setcallback (self, f)
 

Private Attributes

 _paused
 

Static Private Attributes

list _functionStack = []
 
bool _paused = False
 
 _singletonInstance = None
 
 _wm = None
 

Detailed Description

Class organizes installation and removal/restoration
of callback functions for the Wii driver to use.
Only one instance of this class is allowed. Additional
instantiations generate a CallbackStackMultInstError.

A stack discipline is imposed. Operations:

   - push(<callBackFunc>)        # New function becomes the active
                                 # callback immediately
   - pop() -> <oldCallBackFunc>  # If another function is still on
                                     # the stack, it immediately becomes
                                     # the active callback. If callback
                                   # is paused, resume() is forced.
   - pause()                  # Callbacks are temporarily turned off
   - paused() -> True/False
   - resume(sloppy=True)      # If sloppy=False, resuming when
                                   # callbacks are not paused throws an
                                   # exception.  If sloppy=True, the call is
                                   # a no-op

Definition at line 653 of file WIIMote.py.

Constructor & Destructor Documentation

◆ __init__()

def wiimote.WIIMote._WiiCallbackStack.__init__ (   self,
  wiiDriver,
  sloppy = True 
)

Definition at line 682 of file WIIMote.py.

Member Function Documentation

◆ pause()

def wiimote.WIIMote._WiiCallbackStack.pause (   self)
WIIMote callbacks are temporarily stopped.

Definition at line 711 of file WIIMote.py.

◆ pop()

def wiimote.WIIMote._WiiCallbackStack.pop (   self)
Wiimote callback function is popped off the stack. New top of stack
becomes the new callback function. Old function is returned.

Definition at line 699 of file WIIMote.py.

◆ push()

def wiimote.WIIMote._WiiCallbackStack.push (   self,
  func 
)
Given function becomes the new WIImote callback function, shadowing
the function that is currently on the stack

Definition at line 691 of file WIIMote.py.

◆ resume()

def wiimote.WIIMote._WiiCallbackStack.resume (   self,
  sloppy = True 
)
Resume the (presumably) previously paused WIIMote callback functions.
If sloppy is True, this method won't complain if pause was not
called earlier. If sloppy is False, an exception is raised in
that case.

Definition at line 717 of file WIIMote.py.

◆ setcallback()

def wiimote.WIIMote._WiiCallbackStack.setcallback (   self,
  f 
)
Tell WIIMote which function to call when reporting status.

Definition at line 735 of file WIIMote.py.

Member Data Documentation

◆ _functionStack

list wiimote.WIIMote._WiiCallbackStack._functionStack = []
staticprivate

Definition at line 676 of file WIIMote.py.

◆ _paused [1/2]

bool wiimote.WIIMote._WiiCallbackStack._paused = False
staticprivate

Definition at line 678 of file WIIMote.py.

◆ _paused [2/2]

wiimote.WIIMote._WiiCallbackStack._paused
private

Definition at line 715 of file WIIMote.py.

◆ _singletonInstance

wiimote.WIIMote._WiiCallbackStack._singletonInstance = None
staticprivate

Definition at line 677 of file WIIMote.py.

◆ _wm

wiimote.WIIMote._WiiCallbackStack._wm = None
staticprivate

Definition at line 680 of file WIIMote.py.


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


wiimote
Author(s): Andreas Paepcke, Melonee Wise, Mark Horn
autogenerated on Thu Dec 5 2024 03:18:13