OIS  1.5
Object-oriented Input System
OISObject.h
Go to the documentation of this file.
1 /*
2 The zlib/libpng License
3 
4 Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
5 
6 This software is provided 'as-is', without any express or implied warranty. In no event will
7 the authors be held liable for any damages arising from the use of this software.
8 
9 Permission is granted to anyone to use this software for any purpose, including commercial
10 applications, and to alter it and redistribute it freely, subject to the following
11 restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not claim that
14  you wrote the original software. If you use this software in a product,
15  an acknowledgment in the product documentation would be appreciated but is
16  not required.
17 
18  2. Altered source versions must be plainly marked as such, and must not be
19  misrepresented as being the original software.
20 
21  3. This notice may not be removed or altered from any source distribution.
22 */
23 #ifndef OIS_Object_H
24 #define OIS_Object_H
25 
26 #include "OISPrereqs.h"
27 #include "OISInterface.h"
28 
29 namespace OIS
30 {
33  {
34  public:
35  virtual ~Object() {}
36 
38  Type type() const { return mType; }
39 
41  const std::string& vendor() const { return mVendor; }
42 
44  virtual bool buffered() const { return mBuffered; }
45 
47  InputManager* getCreator() const { return mCreator; }
48 
50  virtual void setBuffered(bool buffered) = 0;
51 
53  virtual void capture() = 0;
54 
56  virtual int getID() const { return mDevID; }
57 
65  virtual Interface* queryInterface(Interface::IType type) = 0;
66 
68  virtual void _initialize() = 0;
69 
70  protected:
71  Object(const std::string& vendor, Type iType, bool buffered, int devID, InputManager* creator) :
72  mVendor(vendor),
73  mType(iType),
74  mBuffered(buffered),
75  mDevID(devID),
76  mCreator(creator) {}
77 
79  std::string mVendor;
80 
83 
85  bool mBuffered;
86 
88  int mDevID;
89 
92  };
93 }
94 #endif
Object(const std::string &vendor, Type iType, bool buffered, int devID, InputManager *creator)
Definition: OISObject.h:71
#define _OISExport
Definition: OISPrereqs.h:40
virtual bool buffered() const
Definition: OISObject.h:44
virtual ~Object()
Definition: OISObject.h:35
int mDevID
Not fully implemented yet.
Definition: OISObject.h:88
Type mType
Type of controller object.
Definition: OISObject.h:82
Definition: OISInterface.h:34
IType
Type of Interface.
Definition: OISInterface.h:40
InputManager * mCreator
The creator who created this object.
Definition: OISObject.h:91
Type type() const
Definition: OISObject.h:38
virtual int getID() const
Definition: OISObject.h:56
InputManager * getCreator() const
Definition: OISObject.h:47
const std::string & vendor() const
Definition: OISObject.h:41
Definition: OISObject.h:32
Type
Each Input class has a General Type variable, a form of RTTI.
Definition: OISPrereqs.h:159
Definition: OISInputManager.h:38
std::string mVendor
Vendor name if applicable/known.
Definition: OISObject.h:79
Definition: OISEffect.h:28
bool mBuffered
Buffered flag.
Definition: OISObject.h:85