gadget::DeviceConstructor< DEV > Class Template Reference

Type-specific device object creator. More...

#include <gadget/Type/DeviceConstructor.h>

Inheritance diagram for gadget::DeviceConstructor< DEV >:

Inheritance graph
[legend]
Collaboration diagram for gadget::DeviceConstructor< DEV >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DeviceConstructor (gadget::InputManager *inputMgr)
InputcreateDevice (jccl::ConfigElementPtr element)
 Creates the device.
virtual std::string getElementType ()
 Gets the string desc of the type of element we can create.

Detailed Description

template<class DEV>
class gadget::DeviceConstructor< DEV >

Type-specific device object creator.

Definition at line 55 of file DeviceConstructor.h.


Constructor & Destructor Documentation

template<class DEV>
gadget::DeviceConstructor< DEV >::DeviceConstructor ( gadget::InputManager inputMgr  )  [inline]

Definition at line 58 of file DeviceConstructor.h.

References gadget::InputManager::getDeviceFactory(), and gadget::DeviceFactory::registerDevice().

00059    {
00060       vprASSERT(DeviceFactory::instance() != NULL);
00061       vprASSERT(inputMgr != NULL);
00062       inputMgr->getDeviceFactory()->registerDevice(this);
00063    }


Member Function Documentation

template<class DEV>
Input* gadget::DeviceConstructor< DEV >::createDevice ( jccl::ConfigElementPtr  element  )  [inline, virtual]

Creates the device.

Reimplemented from gadget::DeviceConstructorBase.

Definition at line 65 of file DeviceConstructor.h.

References gadget::Input::config().

00066    {
00067       DEV* new_dev = new DEV;
00068       bool success = new_dev->config(element);
00069       if(success)
00070       {
00071          return new_dev;
00072       }
00073       else
00074       {
00075          delete new_dev;
00076          return NULL;
00077       }
00078    }

template<class DEV>
virtual std::string gadget::DeviceConstructor< DEV >::getElementType (  )  [inline, virtual]

Gets the string desc of the type of element we can create.

Reimplemented from gadget::DeviceConstructorBase.

Definition at line 80 of file DeviceConstructor.h.

00081    {
00082       return DEV::getElementType();
00083    }


The documentation for this class was generated from the following file:
Generated on Thu Jan 4 10:44:52 2007 for Gadgeteer by  doxygen 1.5.1