#include <Proxy.h>
Inheritance diagram for gadget::TypedProxy:


Public Methods | |
| TypedProxy () | |
| virtual void | set (std::string devName, DEV_TYPE *devPtr) |
| Sets the proxy to point to the given type-specific device. More... | |
| virtual bool | refresh () |
| Refreshes the proxy. More... | |
| virtual std::string | getDeviceName () const |
| Get the name of the device that we are proxying. More... | |
Protected Attributes | |
| std::string | mDeviceName |
| Name of the device to link up with. More... | |
| DEV_TYPE * | mTypedDevice |
| The device (type-specific pointer). More... | |
|
|||||||||
|
Definition at line 147 of file Proxy.h.
00148 : mDeviceName("Unknown") 00149 , mTypedDevice(NULL) 00150 { 00151 ; 00152 } |
|
||||||||||||||||
|
Sets the proxy to point to the given type-specific device.
Definition at line 163 of file Proxy.h.
00164 {
00165 mTypedDevice = devPtr;
00166 if(NULL != devPtr)
00167 {
00168 mDeviceName = devName;
00169 stupify(false);
00170 }
00171 else
00172 {
00173 vprASSERT(false && "Tried to set proxy to NULL device");
00174 }
00175 }
|
|
|||||||||
|
Refreshes the proxy. This attempts to lookup the device that we are proxying. If the lookup fails, then we become stupified. If not the the proxy is pointed at this potentially new device. Implements gadget::Proxy. Definition at line 183 of file Proxy.h.
00184 {
00185 Input* input_dev = NULL;
00186 input_dev = InputManager::instance()->getDevice(mDeviceName);
00187
00188 if ( NULL == input_dev ) // Not found, so stupify
00189 {
00190 vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_STATE_LVL)
00191 << "gadget::TypedProxy::refresh: Could not find device '"
00192 << mDeviceName << "' pointed to by '" << mName << "'\n"
00193 << std::endl << vprDEBUG_FLUSH;
00194 stupify(true);
00195 }
00196 else
00197 {
00198 DEV_TYPE* typed_dev = dynamic_cast<DEV_TYPE*>(input_dev);
00199 if ( NULL == typed_dev )
00200 {
00201 vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_CRITICAL_LVL)
00202 << "gadget::TypedProxy::config: Device was of wrong type: "
00203 << mDeviceName << " it was type:" << typeid(input_dev).name()
00204 << std::endl << vprDEBUG_FLUSH;
00205 stupify(true);
00206 return false;
00207 }
00208 vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_STATE_LVL)
00209 << " Proxy '" << mName << "' configured" << std::endl
00210 << vprDEBUG_FLUSH;
00211 mTypedDevice = typed_dev; // Set the proxy
00212 stupify(false);
00213 }
00214 return true;
00215 }
|
|
|||||||||
|
Get the name of the device that we are proxying.
Definition at line 218 of file Proxy.h.
00219 {
00220 return mDeviceName;
00221 }
|
|
|||||
|
Name of the device to link up with.
Definition at line 224 of file Proxy.h. Referenced by gadget::TypedProxy< EventWindow >::getDeviceName, gadget::TypedProxy< EventWindow >::refresh, gadget::TypedProxy< EventWindow >::set, and gadget::TypedProxy< EventWindow >::TypedProxy. |
|
|||||
|
The device (type-specific pointer).
Definition at line 225 of file Proxy.h. Referenced by gadget::TypedProxy< EventWindow >::refresh, gadget::TypedProxy< EventWindow >::set, and gadget::TypedProxy< EventWindow >::TypedProxy. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002