#include <gadget/Type/DeviceInterface.h>
Inheritance diagram for gadget::DeviceInterface< PROXY_TYPE >:


Public Member Functions | |
| DeviceInterface (const DeviceInterface &other) | |
| DeviceInterface () | |
| PROXY_TYPE * | getProxy () |
| Returns the underlying proxy to which we are connected. | |
| void | setProxy (PROXY_TYPE *proxy) |
| Sets the proxy to an explicit proxy. | |
| virtual void | refresh () |
| Refreshes the interface based on the current configuration. | |
Smart pointer operator overloads. | |
Device interfaces make use of the Smart Pointer design pattern.
Access to the contained device proxy must occur through one of these operators. | |
| PROXY_TYPE * | operator-> () |
| Member selection (via pointer) operator overload. | |
| PROXY_TYPE & | operator * () |
| Dereference operator overload. | |
Definition at line 145 of file DeviceInterface.h.
| gadget::DeviceInterface< PROXY_TYPE >::DeviceInterface | ( | const DeviceInterface< PROXY_TYPE > & | other | ) | [inline] |
Definition at line 148 of file DeviceInterface.h.
References gadget::DeviceInterface< PROXY_TYPE >::mTypeSpecificProxy.
00149 : BaseDeviceInterface(other) 00150 { 00151 if (other.mTypeSpecificProxy != NULL) 00152 { 00153 mTypeSpecificProxy = other.mTypeSpecificProxy; 00154 } 00155 else 00156 { 00157 mTypeSpecificProxy = &mDummyProxy; 00158 } 00159 }
| gadget::DeviceInterface< PROXY_TYPE >::DeviceInterface | ( | ) | [inline] |
Definition at line 162 of file DeviceInterface.h.
00163 : BaseDeviceInterface() 00164 { 00165 mTypeSpecificProxy = &mDummyProxy; 00166 }
| PROXY_TYPE* gadget::DeviceInterface< PROXY_TYPE >::operator-> | ( | ) | [inline] |
Member selection (via pointer) operator overload.
Definition at line 182 of file DeviceInterface.h.
| PROXY_TYPE& gadget::DeviceInterface< PROXY_TYPE >::operator * | ( | ) | [inline] |
Dereference operator overload.
Definition at line 194 of file DeviceInterface.h.
| PROXY_TYPE* gadget::DeviceInterface< PROXY_TYPE >::getProxy | ( | ) | [inline] |
Returns the underlying proxy to which we are connected.
Definition at line 201 of file DeviceInterface.h.
| void gadget::DeviceInterface< PROXY_TYPE >::setProxy | ( | PROXY_TYPE * | proxy | ) | [inline] |
Sets the proxy to an explicit proxy.
Definition at line 207 of file DeviceInterface.h.
References gadget::BaseDeviceInterface::mNameSet, gadget::BaseDeviceInterface::mProxyName, and gadget::DeviceInterface< PROXY_TYPE >::refresh().
00208 { 00209 vprASSERT(NULL != proxy); 00210 mProxyName = proxy->getName(); // Set the name 00211 mNameSet = true; 00212 this->refresh(); 00213 00214 // Verify we found the correct proxy 00215 vprASSERT(mTypeSpecificProxy == proxy && "Found incorrect proxy for dev interface"); 00216 }
| virtual void gadget::DeviceInterface< PROXY_TYPE >::refresh | ( | ) | [inline, virtual] |
Refreshes the interface based on the current configuration.
This method is called by refreshAllInterfaces when system
Reimplemented from gadget::BaseDeviceInterface.
Definition at line 218 of file DeviceInterface.h.
References gadgetDBG_INPUT_MGR(), gadget::BaseDeviceInterface::mProxyName, gadget::BaseDeviceInterface::mProxyPtr, and gadget::BaseDeviceInterface::refresh().
Referenced by gadget::DeviceInterface< PROXY_TYPE >::setProxy().
00219 { 00220 BaseDeviceInterface::refresh(); 00221 if(mProxyPtr != NULL) 00222 { 00223 mTypeSpecificProxy = dynamic_cast<PROXY_TYPE*>(mProxyPtr); 00224 if(NULL == mTypeSpecificProxy) 00225 { 00226 vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_CRITICAL_LVL) 00227 << "[gadget::DeviceInterface::refresh()] Tried to point at " 00228 << "proxy of incorrect type named '" << mProxyName << "'" 00229 << " it was type:" << typeid(mProxyPtr).name() 00230 << std::endl << vprDEBUG_FLUSH; 00231 } 00232 } 00233 00234 // If either one of the proxy pointers are NULL, then use a dummy 00235 if((NULL == mProxyPtr) || (NULL == mTypeSpecificProxy)) 00236 { 00237 mTypeSpecificProxy = &mDummyProxy; 00238 } 00239 }
1.5.1