Commit c50bad3f authored by Ben Hymers's avatar Ben Hymers
Browse files

Add unimplemented private copy constructors and assignment operators for

classes that can't have them automatically generated, to avoid warnings
under MSVC.

Add copy constructor for Exception, since throwing it requires a copy
constructor.

Make KeyEvent::key non-const to allow automatic generation of
assignment operator and copy constructor.
parent dc8bd636
...@@ -154,6 +154,10 @@ namespace OIS ...@@ -154,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
}; };
......
...@@ -55,6 +55,9 @@ namespace OIS ...@@ -55,6 +55,9 @@ namespace OIS
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();
...@@ -67,6 +70,10 @@ namespace OIS ...@@ -67,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);
}; };
} }
......
...@@ -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);
}; };
/** /**
......
...@@ -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