Commit 24236447 authored by TheOnlyJoey's avatar TheOnlyJoey
Browse files

Merge pull request #5 from hymerman/tidying

General tidy-up
parents c546989f ed6e1ba6
...@@ -46,10 +46,6 @@ namespace OIS ...@@ -46,10 +46,6 @@ namespace OIS
*/ */
class _OISExport Effect class _OISExport Effect
{ {
/**
hidden so this class cannot be instanced with default constructor
*/
Effect();
public: public:
//! Type of force //! Type of force
enum EForce enum EForce
...@@ -158,6 +154,10 @@ namespace OIS ...@@ -158,6 +154,10 @@ namespace OIS
*/ */
mutable int _handle; mutable int _handle;
protected: protected:
// Prevent copying.
Effect(const Effect&);
Effect& operator=(Effect);
ForceEffect* effect; //Properties depend on EForce ForceEffect* effect; //Properties depend on EForce
short axes; //Number of axes to use in effect short axes; //Number of axes to use in effect
}; };
...@@ -215,7 +215,7 @@ namespace OIS ...@@ -215,7 +215,7 @@ namespace OIS
public: public:
ConstantEffect() : level(5000) {} ConstantEffect() : level(5000) {}
class Envelope envelope; //Optional envolope Envelope envelope; //Optional envolope
signed short level; //-10K to +10k signed short level; //-10K to +10k
}; };
...@@ -228,7 +228,7 @@ namespace OIS ...@@ -228,7 +228,7 @@ namespace OIS
public: public:
RampEffect() : startLevel(0), endLevel(0) {} RampEffect() : startLevel(0), endLevel(0) {}
class Envelope envelope; //Optional envelope Envelope envelope; //Optional envelope
signed short startLevel; //-10K to +10k signed short startLevel; //-10K to +10k
signed short endLevel; //-10K to +10k signed short endLevel; //-10K to +10k
}; };
...@@ -242,7 +242,7 @@ namespace OIS ...@@ -242,7 +242,7 @@ namespace OIS
public: public:
PeriodicEffect() : magnitude(0), offset(0), phase(0), period(0) {} PeriodicEffect() : magnitude(0), offset(0), phase(0), period(0) {}
class Envelope envelope; //Optional Envelope Envelope envelope; //Optional Envelope
unsigned short magnitude; //0 to 10,0000 unsigned short magnitude; //0 to 10,0000
signed short offset; signed short offset;
......
...@@ -32,7 +32,7 @@ namespace OIS ...@@ -32,7 +32,7 @@ namespace OIS
class _OISExport EventArg class _OISExport EventArg
{ {
public: public:
EventArg( Object* obj ) : device(obj) {} explicit EventArg( Object* obj ) : device(obj) {}
virtual ~EventArg() {} virtual ~EventArg() {}
//! Pointer to the Input Device //! Pointer to the Input Device
......
...@@ -50,13 +50,14 @@ namespace OIS ...@@ -50,13 +50,14 @@ namespace OIS
*/ */
class _OISExport Exception : public std::exception class _OISExport Exception : public std::exception
{ {
//! Hidden default
Exception() : eType(E_General), eLine(0), eFile(0) {}
public: public:
//! Creates exception object //! Creates exception object
Exception( OIS_ERROR err, const char* str, int line, const char *file ) Exception( OIS_ERROR err, const char* str, int line, const char *file )
: eType(err), eLine(line), eFile(file), eText(str) {} : eType(err), eLine(line), eFile(file), eText(str) {}
Exception(const Exception& other)
: eType(other.eType), eLine(other.eLine), eFile(other.eFile), eText(other.eText) {}
~Exception() throw() {} ~Exception() throw() {}
virtual const char* what() const throw(); virtual const char* what() const throw();
...@@ -69,6 +70,10 @@ namespace OIS ...@@ -69,6 +70,10 @@ namespace OIS
const char* eFile; const char* eFile;
//! A message passed along when the exception was raised //! A message passed along when the exception was raised
const char* eText; const char* eText;
private:
// Unimplemented and unaccessible due to const members.
Exception& operator=(Exception);
}; };
} }
......
...@@ -177,7 +177,7 @@ namespace OIS ...@@ -177,7 +177,7 @@ namespace OIS
@remarks @remarks
Derived classes must provide input system name Derived classes must provide input system name
*/ */
InputManager(const std::string& name); explicit InputManager(const std::string& name);
/** /**
@remarks @remarks
...@@ -200,6 +200,11 @@ namespace OIS ...@@ -200,6 +200,11 @@ namespace OIS
//! Extra factory (not enabled by default) //! Extra factory (not enabled by default)
LIRCFactoryCreator *m_lircSupport; LIRCFactoryCreator *m_lircSupport;
WiiMoteFactoryCreator *m_wiiMoteSupport; WiiMoteFactoryCreator *m_wiiMoteSupport;
private:
// Prevent copying.
InputManager(const InputManager&);
InputManager& operator=(InputManager);
}; };
} }
#endif #endif
...@@ -119,6 +119,11 @@ namespace OIS ...@@ -119,6 +119,11 @@ namespace OIS
virtual ~JoyStickEvent() {} virtual ~JoyStickEvent() {}
const JoyStickState &state; const JoyStickState &state;
private:
// Prevent copying.
JoyStickEvent(const JoyStickEvent&);
JoyStickEvent& operator=(JoyStickEvent);
}; };
/** /**
...@@ -143,13 +148,13 @@ namespace OIS ...@@ -143,13 +148,13 @@ namespace OIS
//-- Not so common control events, so are not required --// //-- Not so common control events, so are not required --//
//! Joystick Event, and sliderID //! Joystick Event, and sliderID
virtual bool sliderMoved( const JoyStickEvent &, int index) {return true;} virtual bool sliderMoved( const JoyStickEvent &arg, int index) { OIS_UNUSED(arg); OIS_UNUSED(index); return true; }
//! Joystick Event, and povID //! Joystick Event, and povID
virtual bool povMoved( const JoyStickEvent &arg, int index) {return true;} virtual bool povMoved( const JoyStickEvent &arg, int index) { OIS_UNUSED(arg); OIS_UNUSED(index); return true; }
//! Joystick Event, and Vector3ID //! Joystick Event, and Vector3ID
virtual bool vector3Moved( const JoyStickEvent &arg, int index) {return true;} virtual bool vector3Moved( const JoyStickEvent &arg, int index) { OIS_UNUSED(arg); OIS_UNUSED(index); return true; }
}; };
/** /**
......
...@@ -187,7 +187,7 @@ namespace OIS ...@@ -187,7 +187,7 @@ namespace OIS
virtual ~KeyEvent() {} virtual ~KeyEvent() {}
//! KeyCode of event //! KeyCode of event
const KeyCode key; KeyCode key;
//! Text character, depends on current TextTranslationMode //! Text character, depends on current TextTranslationMode
unsigned int text; unsigned int text;
}; };
......
...@@ -85,6 +85,11 @@ namespace OIS ...@@ -85,6 +85,11 @@ namespace OIS
//! The state of the mouse - including buttons and axes //! The state of the mouse - including buttons and axes
const MouseState &state; const MouseState &state;
private:
// Prevent copying.
MouseEvent(const MouseEvent&);
MouseEvent& operator=(MouseEvent);
}; };
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment