OIS  1.5
Object-oriented Input System
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OIS::InputManager Class Referenceabstract

#include <OISInputManager.h>

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

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

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

const std::string m_VersionName
 OIS Version name. More...
 
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...
 
LIRCFactoryCreator * m_lircSupport
 Extra factory (not enabled by default) More...
 
WiiMoteFactoryCreator * m_wiiMoteSupport
 

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

◆ AddOnFactories

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

Enumerator
AddOn_All 
AddOn_LIRC 
AddOn_WiiMote 

Constructor & Destructor Documentation

◆ InputManager()

InputManager::InputManager ( const std::string &  name)
explicitprotected
Remarks
Derived classes must provide input system name

◆ ~InputManager()

InputManager::~InputManager ( )
protectedvirtual
Remarks
Virtual Destructor - this base class will clean up all devices still opened in mFactoryObjects list

Member Function Documentation

◆ _initialize()

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

◆ addFactoryCreator()

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.

◆ createInputObject()

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

◆ createInputSystem() [1/2]

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

◆ createInputSystem() [2/2]

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

◆ destroyInputObject()

void InputManager::destroyInputObject ( Object obj)
Remarks
Destroys Input Object

◆ destroyInputSystem()

void InputManager::destroyInputSystem ( InputManager manager)
static
Remarks
Destroys the InputManager
Parameters
managerManager to destroy

◆ enableAddOnFactory()

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.

◆ getNumberOfDevices()

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

◆ getVersionName()

const std::string & InputManager::getVersionName ( )
Remarks
Returns version string (useful in DLL/SO libs)
Returns
Version name

◆ getVersionNumber()

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

◆ inputSystemName()

const std::string & InputManager::inputSystemName ( )
Remarks
Gets the name of the current platform input system

◆ listFreeDevices()

DeviceList InputManager::listFreeDevices ( )
Remarks
Lists all unused devices
Returns
DeviceList which contains Type and vendor of device

◆ removeFactoryCreator()

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

◆ m_lircSupport

LIRCFactoryCreator* OIS::InputManager::m_lircSupport
protected

Extra factory (not enabled by default)

◆ m_VersionName

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

OIS Version name.

◆ m_wiiMoteSupport

WiiMoteFactoryCreator* OIS::InputManager::m_wiiMoteSupport
protected

◆ mFactories

FactoryList OIS::InputManager::mFactories
protected

◆ mFactoryObjects

FactoryCreatedObject OIS::InputManager::mFactoryObjects
protected

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

◆ mInputSystemName

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

Name of the input system.


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