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

gadget::DeviceInterface Class Template Reference

#include <DeviceInterface.h>

Inheritance diagram for gadget::DeviceInterface:

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

Collaboration graph
[legend]
List of all members.

Public Methods

 DeviceInterface (const DeviceInterface &other)
 DeviceInterface ()
PROXY_TYPE * operator-> ()
PROXY_TYPE & operator * ()
PROXY_TYPE * getProxy ()
void setProxy (PROXY_TYPE *proxy)
 Sets the proxy to an explicit proxy. More...

virtual void refresh ()
 NOTE: If the interface does not have an initialized mProxyName, then don't try to refresh it. More...

template<class PROXY_TYPE>
class gadget::DeviceInterface< PROXY_TYPE >


Constructor & Destructor Documentation

template<class PROXY_TYPE>
gadget::DeviceInterface< PROXY_TYPE >::DeviceInterface const DeviceInterface< PROXY_TYPE > &    other [inline]
 

Definition at line 129 of file DeviceInterface.h.

Referenced by gadget::DeviceInterface< DigitalProxy >::DeviceInterface.

00130       : BaseDeviceInterface(other)
00131    {
00132       if (other.mTypeSpecificProxy != NULL)
00133       {
00134          mTypeSpecificProxy = other.mTypeSpecificProxy;
00135       }
00136       else
00137       {
00138          mTypeSpecificProxy = &mDummyProxy;
00139       }
00140    }

template<class PROXY_TYPE>
gadget::DeviceInterface< PROXY_TYPE >::DeviceInterface   [inline]
 

Definition at line 143 of file DeviceInterface.h.

00144       : BaseDeviceInterface()
00145    {
00146       mTypeSpecificProxy = &mDummyProxy;
00147    }


Member Function Documentation

template<class PROXY_TYPE>
PROXY_TYPE* gadget::DeviceInterface< PROXY_TYPE >::operator->   [inline]
 

Definition at line 149 of file DeviceInterface.h.

00150    {
00151       return mTypeSpecificProxy;
00152    }

template<class PROXY_TYPE>
PROXY_TYPE& gadget::DeviceInterface< PROXY_TYPE >::operator *   [inline]
 

Definition at line 154 of file DeviceInterface.h.

00155    {
00156       return *(mTypeSpecificProxy);
00157    }

template<class PROXY_TYPE>
PROXY_TYPE* gadget::DeviceInterface< PROXY_TYPE >::getProxy   [inline]
 

Definition at line 159 of file DeviceInterface.h.

00160    {
00161       return mTypeSpecificProxy;
00162    }

template<class PROXY_TYPE>
void gadget::DeviceInterface< PROXY_TYPE >::setProxy PROXY_TYPE *    proxy [inline]
 

Sets the proxy to an explicit proxy.

Definition at line 165 of file DeviceInterface.h.

00166    {
00167       vprASSERT(NULL != proxy);
00168       mProxyName = proxy->getName();    // Set the name
00169       mNameSet = true;
00170       this->refresh();
00171 
00172       // Verify we found the correct proxy
00173       vprASSERT(mTypeSpecificProxy == proxy && "Found incorrect proxy for dev interface");
00174    }

template<class PROXY_TYPE>
virtual void gadget::DeviceInterface< PROXY_TYPE >::refresh   [inline, virtual]
 

NOTE: If the interface does not have an initialized mProxyName, then don't try to refresh it.

Postcondition:
(mProxyIndex == -1) ==> Proxy not initi.ized yet
(mProxyIndex != -1) ==> mProxyName has name of device && local proxy ptr is set to the device

Reimplemented from gadget::BaseDeviceInterface.

Definition at line 176 of file DeviceInterface.h.

Referenced by gadget::DeviceInterface< DigitalProxy >::setProxy.

00177    {
00178       BaseDeviceInterface::refresh();
00179       if(mProxyPtr != NULL)
00180       {
00181          mTypeSpecificProxy = dynamic_cast<PROXY_TYPE*>(mProxyPtr);
00182          if(NULL == mTypeSpecificProxy)
00183          {
00184             vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_CRITICAL_LVL)
00185                << "[gadget::DeviceInterface::refresh()] Tried to point at "
00186                << "proxy of incorrect type named '" << mProxyName << "'"
00187                << std::endl << vprDEBUG_FLUSH;
00188          }
00189       }
00190 
00191       if((NULL == mProxyPtr) || (NULL == mTypeSpecificProxy))
00192       {
00193          mTypeSpecificProxy = &mDummyProxy;
00194       }
00195    }


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