Orxonox  0.0.5 Codename: Arcturus
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OIS::InputManager Class Referenceabstract

Base Manager class. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/external/ois/OISInputManager.h>

Inheritance diagram for OIS::InputManager:
OIS::LinuxInputManager OIS::MacInputManager OIS::Win32InputManager

Public Types

enum  AddOnFactories { AddOn_All = 0, AddOn_LIRC = 1, AddOn_WiiMote = 2 }
 All generic devices OIS supports internally (if they are compiled in) More...
 

Public Member Functions

void addFactoryCreator (FactoryCreator *factory)
 
ObjectcreateInputObject (Type iType, bool bufferMode, const std::string &vendor="")
 
void destroyInputObject (Object *obj)
 
void enableAddOnFactory (AddOnFactories factory)
 
int getNumberOfDevices (Type iType)
 
const std::string & getVersionName ()
 
const std::string & inputSystemName ()
 
DeviceList listFreeDevices ()
 
void removeFactoryCreator (FactoryCreator *factory)
 

Static Public Member Functions

static InputManagercreateInputSystem (std::size_t winHandle)
 
static InputManagercreateInputSystem (ParamList &paramList)
 
static void destroyInputSystem (InputManager *manager)
 
static unsigned int getVersionNumber ()
 

Protected Member Functions

 InputManager (const std::string &name)
 
virtual ~InputManager ()
 
virtual void _initialize (ParamList &paramList)=0
 

Protected Attributes

LIRCFactoryCreator * m_lircSupport
 Extra factory (not enabled by default) More...
 
const std::string m_VersionName
 OIS Version name. More...
 
WiiMoteFactoryCreator * m_wiiMoteSupport
 
FactoryList mFactories
 FactoryCreator list. More...
 
FactoryCreatedObject mFactoryObjects
 Factory created objects - useful so we can find creator to send destruction request to. More...
 
const std::string mInputSystemName
 Name of the input system. More...
 

Detailed Description

Base Manager class.

No longer a Singleton; so feel free to create as many InputManager's as you have windows.

Member Enumeration Documentation

All generic devices OIS supports internally (if they are compiled in)

Enumerator
AddOn_All 
AddOn_LIRC 
AddOn_WiiMote 

Constructor & Destructor Documentation

InputManager::InputManager ( const std::string &  name)
protected
Remarks
Derived classes must provide input system name
InputManager::~InputManager ( )
protectedvirtual
Remarks
Virtual Destructor - this base class will clean up all devices still opened in mFactoryObjects list

Member Function Documentation

virtual void OIS::InputManager::_initialize ( ParamList paramList)
protectedpure virtual
Remarks
Called from createInputSystem, gives derived input class a chance to setup after it is created

Implemented in OIS::LinuxInputManager, OIS::MacInputManager, and OIS::Win32InputManager.

void InputManager::addFactoryCreator ( FactoryCreator factory)
Remarks
Add a custom object factory to allow for user controls.
Parameters
factoryFactory instance to add Make sure you do not delete the factory before devices created from the factory are destroyed (either by calling RemoveFactoryCreator, or shutting down the input system). Order should be something like the following: Create Input System Create Factory Instance AddFactoryCreator(factory) Create a device from the InputManager (device created by factory) One of the follwoing: removeFactoryCreator(factory) inputManager->destroyInputObject(obj) destroyInputSystem(inputManager) destroy Factory Instance You can safely delete the factory instance once you have removed it or shut down the input manager.
Object * InputManager::createInputObject ( Type  iType,
bool  bufferMode,
const std::string &  vendor = "" 
)
Remarks
Tries to create an object with the specified vendor. If you have no preference of vendor, leave vender as default (""). Raises exception on failure
InputManager * InputManager::createInputSystem ( std::size_t  winHandle)
static
Remarks
Creates appropriate input system dependent on platform.
Parameters
winHandleContains OS specific window handle (such as HWND or X11 Window)
Returns
A pointer to the created manager, or raises Exception
InputManager * InputManager::createInputSystem ( ParamList paramList)
static
Remarks
Creates appropriate input system dependent on platform.
Parameters
paramListParamList contains OS specific info (such as HWND and HINSTANCE for window apps), and access mode.
Returns
A pointer to the created manager, or raises Exception
void InputManager::destroyInputObject ( Object obj)
Remarks
Destroys Input Object
void InputManager::destroyInputSystem ( InputManager manager)
static
Remarks
Destroys the InputManager
Parameters
managerManager to destroy
void InputManager::enableAddOnFactory ( AddOnFactories  factory)
Remarks
Enable an addon FactoryCreator extension. By default, none are activated. If the desired support was not compiled in, this has no effect. Calling multiple times has no effect. Once activated, there is no way to deactivate - simply destroy and recreate input manager.
int InputManager::getNumberOfDevices ( Type  iType)
Remarks
Returns the number of the specified OIS::Type devices discovered by OIS
Parameters
iTypeType that you are interested in
const std::string & InputManager::getVersionName ( )
Remarks
Returns version string (useful in DLL/SO libs)
Returns
Version name
unsigned int InputManager::getVersionNumber ( )
static
Remarks
Returns version number (useful in DLL/SO libs)
Returns
Bits: 1-8 Patch number, 9-16 Minor version, 17-32 Major version
const std::string & InputManager::inputSystemName ( )
Remarks
Gets the name of the current platform input system
DeviceList InputManager::listFreeDevices ( )
Remarks
Lists all unused devices
Returns
DeviceList which contains Type and vendor of device
void InputManager::removeFactoryCreator ( FactoryCreator factory)
Remarks
Remove a previously added object factory
Parameters
factoryFactory object to remove. Removing a factory will automatically destroy any Objects created from the factory

Member Data Documentation

LIRCFactoryCreator* OIS::InputManager::m_lircSupport
protected

Extra factory (not enabled by default)

const std::string OIS::InputManager::m_VersionName
protected

OIS Version name.

WiiMoteFactoryCreator* OIS::InputManager::m_wiiMoteSupport
protected
FactoryList OIS::InputManager::mFactories
protected
FactoryCreatedObject OIS::InputManager::mFactoryObjects
protected

Factory created objects - useful so we can find creator to send destruction request to.

const std::string OIS::InputManager::mInputSystemName
protected

Name of the input system.


The documentation for this class was generated from the following files: