Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

gadget::EventWindowProxy Class Reference

Proxy class to event window-based devices. More...

#include <EventWindowProxy.h>

Inheritance diagram for gadget::EventWindowProxy:

Inheritance graph
[legend]
Collaboration diagram for gadget::EventWindowProxy:

Collaboration graph
[legend]
List of all members.

Public Methods

 EventWindowProxy ()
EventWindowgetEventWindowPtr ()
virtual vpr::Interval getTimeStamp () const
 Returns time of last update. More...

bool modifierOnly (gadget::Keys modKey)
 Determines if the modifier key is pressed exclusively. More...

int keyPressed (gadget::Keys keyId)
EventWindow::EventQueue getEventQueue ()
bool config (jccl::ConfigElementPtr element)
 Configures the proxy. More...

virtual InputgetProxiedInputDevice ()
 Returns a pointer to the base class of the devices being proxied. More...


Static Public Methods

std::string getElementType ()
 Returns the string rep of the element type used to config this device. More...


Detailed Description

Proxy class to event window-based devices.

Definition at line 48 of file EventWindowProxy.h.


Constructor & Destructor Documentation

gadget::EventWindowProxy::EventWindowProxy   [inline]
 

Definition at line 51 of file EventWindowProxy.h.

00052    { ; }


Member Function Documentation

EventWindow* gadget::EventWindowProxy::getEventWindowPtr   [inline]
 

Definition at line 54 of file EventWindowProxy.h.

00055    {
00056       if(isStupified())
00057       {
00058          return NULL;
00059       }
00060       else
00061       {
00062          return mTypedDevice;
00063       }
00064    }

virtual vpr::Interval gadget::EventWindowProxy::getTimeStamp   const [inline, virtual]
 

Returns time of last update.

Implements gadget::Proxy.

Definition at line 67 of file EventWindowProxy.h.

00068    {
00069       if ( isStupified() || (mTypedDevice == NULL) )
00070       {
00071          return vpr::Interval();
00072       }
00073       else
00074       {
00075          return mTypedDevice->getSyncTime();
00076       }  
00077    }

bool gadget::EventWindowProxy::modifierOnly gadget::Keys    modKey [inline]
 

Determines if the modifier key is pressed exclusively.

Precondition:
modKey is a valid modifier identifier
Returns:
true if modKey is the only modifier pressed

Definition at line 84 of file EventWindowProxy.h.

00085    {
00086       if ( isStupified() || (mTypedDevice == NULL) )
00087       {
00088          return false;
00089       }
00090       else
00091       {
00092          return mTypedDevice->modifierOnly(modKey);
00093       }
00094    }

int gadget::EventWindowProxy::keyPressed gadget::Keys    keyId [inline]
 

Definition at line 96 of file EventWindowProxy.h.

00097    {
00098       if ( isStupified() || (mTypedDevice == NULL) )
00099       {
00100          return 0;
00101       }
00102       else
00103       {
00104          return mTypedDevice->keyPressed(keyId);
00105       }
00106    }

EventWindow::EventQueue gadget::EventWindowProxy::getEventQueue   [inline]
 

Definition at line 108 of file EventWindowProxy.h.

00109    {
00110       if ( isStupified() || (mTypedDevice == NULL) )
00111       {
00112          return EventWindow::EventQueue();
00113       }
00114       else
00115       {
00116          return mTypedDevice->getEventQueue();
00117       }
00118    }

std::string gadget::EventWindowProxy::getElementType   [static]
 

Returns the string rep of the element type used to config this device.

Used by the Input Manager to find elements that construct devices.

Reimplemented from gadget::Proxy.

Definition at line 42 of file EventWindowProxy.cpp.

Referenced by config.

00043 {
00044    return "event_window_proxy";
00045 }

bool gadget::EventWindowProxy::config jccl::ConfigElementPtr    element [virtual]
 

Configures the proxy.

Postcondition:
Proxy is configured (it is not registered yet though).
Returns:
success.

Reimplemented from gadget::Proxy.

Definition at line 47 of file EventWindowProxy.cpp.

References gadgetDBG_INPUT_MGR, getElementType, gadget::TypedProxy< EventWindow >::mDeviceName, and gadget::TypedProxy< EventWindow >::refresh.

00048 {
00049 vpr::DebugOutputGuard dbg_output(gadgetDBG_INPUT_MGR, vprDBG_STATE_LVL,
00050       std::string("------------------ EventWindow PROXY config() -----------------\n"),
00051       std::string("\n"));
00052    vprASSERT(element->getID() == getElementType());
00053 
00054    if( ! Proxy::config(element) )
00055    {
00056       return false;
00057    }
00058 
00059    mDeviceName = element->getProperty<std::string>("device");
00060 
00061    refresh();
00062 
00063    return true;
00064 }

virtual Input* gadget::EventWindowProxy::getProxiedInputDevice   [inline, virtual]
 

Returns a pointer to the base class of the devices being proxied.

Returns:
NULL if no device is proxied.

Implements gadget::Proxy.

Definition at line 124 of file EventWindowProxy.h.

00125    {
00126       if ((NULL == mTypedDevice) || (isStupified()))
00127          return NULL;
00128 
00129       Input* ret_val = dynamic_cast<Input*>(mTypedDevice);
00130       vprASSERT((ret_val != NULL) && "Cross-cast in EventWindowProxy failed");
00131       return ret_val;
00132    }


The documentation for this class was generated from the following files:
Generated on Sun May 2 14:26:58 2004 for Gadgeteer by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002