Orxonox  0.0.5 Codename: Arcturus
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,
72  int devID, InputManager* creator) :
73  mVendor(vendor),
74  mType(iType),
75  mBuffered(buffered),
76  mDevID(devID),
77  mCreator(creator) {}
78 
81 
84 
86  bool mBuffered;
87 
89  int mDevID;
90 
93  };
94 }
95 #endif
Object(const std::string &vendor, Type iType, bool buffered, int devID, InputManager *creator)
Definition: OISObject.h:71
InputManager * getCreator() const
Definition: OISObject.h:47
#define _OISExport
Definition: OISPrereqs.h:40
virtual ~Object()
Definition: OISObject.h:35
int mDevID
Not fully implemented yet.
Definition: OISObject.h:89
Type mType
Type of controller object.
Definition: OISObject.h:83
virtual int getID() const
Definition: OISObject.h:56
An Object's interface is a way to gain write access to devices which support it.
Definition: OISInterface.h:34
::std::string string
Definition: gtest-port.h:756
IType
Type of Interface.
Definition: OISInterface.h:40
InputManager * mCreator
The creator who created this object.
Definition: OISObject.h:92
const std::string & vendor() const
Definition: OISObject.h:41
virtual bool buffered() const
Definition: OISObject.h:44
The base class of all input types.
Definition: OISObject.h:32
Type
Each Input class has a General Type variable, a form of RTTI.
Definition: OISPrereqs.h:138
Base Manager class.
Definition: OISInputManager.h:38
std::string mVendor
Vendor name if applicable/known.
Definition: OISObject.h:80
Definition: EventHelpers.h:31
bool mBuffered
Buffered flag.
Definition: OISObject.h:86
Type type() const
Definition: OISObject.h:38