Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Private Member Functions | Private Attributes | List of all members
orxonox::InputBuffer Class Reference

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/input/InputBuffer.h>

Inheritance diagram for orxonox::InputBuffer:
orxonox::InputHandler orxonox::Configurable orxonox::Listable orxonox::Identifiable

Public Member Functions

 InputBuffer ()
 
 InputBuffer (const std::string &allowedChars)
 
 ~InputBuffer ()
 
virtual void buttonPressed (const KeyEvent &evt) override
 
void clear (bool update=true)
 
void decreaseCursor ()
 
const std::string & get () const
 
unsigned int getCursorPosition () const
 
unsigned int getMaxLength () const
 
unsigned int getSize () const
 
void increaseCursor ()
 
void insert (const std::string &input, bool update=true)
 
void insert (const char &input, bool update=true)
 
template<class T >
void registerListener (T *listener, void(T::*function)(), bool bOnlySingleInput)
 
template<class T >
void registerListener (T *listener, void(T::*function)() const, bool bOnlySingleInput)
 
template<class T >
void registerListener (T *listener, void(T::*function)(), char _char, bool bOnlySingleInput)
 
template<class T >
void registerListener (T *listener, void(T::*function)() const, char _char, bool bOnlySingleInput)
 
template<class T >
void registerListener (T *listener, void(T::*function)(), KeyCode::ByEnum key)
 
template<class T >
void registerListener (T *listener, void(T::*function)() const, KeyCode::ByEnum key)
 
void removeAtCursor (bool update=true)
 
void removeBehindCursor (bool update=true)
 
void set (const std::string &input, bool update=true)
 
void setConfigValues ()
 
void setCursorPosition (unsigned int cursor)
 
void setCursorToBegin ()
 
void setCursorToEnd ()
 
void setMaxLength (unsigned int length)
 
template<class T >
void unregisterListener (T *listener)
 
void updated ()
 
void updated (const char &update, bool bSingleInput)
 
- Public Member Functions inherited from orxonox::InputHandler
virtual ~InputHandler ()=default
 
virtual void allDevicesUpdated (float dt)
 
virtual void axisMoved (unsigned int joyStick, unsigned int axis, float value)
 
template<class T >
void buttonEvent (unsigned int device, T button, ButtonEvent::TPress)
 
template<class T >
void buttonEvent (unsigned int device, T button, ButtonEvent::TRelease)
 
template<class T >
void buttonEvent (unsigned int device, T button, ButtonEvent::THold)
 
virtual void buttonHeld (MouseButtonCode::ByEnum button)
 
virtual void buttonHeld (unsigned int joyStick, JoyStickButtonCode::ByEnum button)
 
virtual void buttonPressed (MouseButtonCode::ByEnum button)
 
virtual void buttonPressed (unsigned int joyStick, JoyStickButtonCode::ByEnum button)
 
virtual void buttonReleased (const KeyEvent &evt)
 
virtual void buttonReleased (MouseButtonCode::ByEnum button)
 
virtual void buttonReleased (unsigned int joyStick, JoyStickButtonCode::ByEnum button)
 
virtual void joyStickUpdated (unsigned int joyStick, float dt)
 
virtual void mouseMoved (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
 
virtual void mouseScrolled (int abs, int rel)
 
virtual void mouseUpdated (float dt)
 
- Public Member Functions inherited from orxonox::Configurable
 Configurable ()
 
void setConfigValues ()
 Function to collect the SetConfigValue-macro calls. More...
 
- Public Member Functions inherited from orxonox::Listable
 Listable ()
 Constructor: Allocates space in the element list. More...
 
 Listable (Context *context)
 Constructor: Allocates space in the element list and assigns the context. More...
 
virtual ~Listable ()
 Destructor: Removes the object from the object-lists. More...
 
ContextgetContext () const
 
void setContext (Context *context)
 Changes the context. More...
 
void unregisterObject ()
 Removes this object from the object-lists. More...
 
- Public Member Functions inherited from orxonox::Identifiable
 Identifiable ()
 Constructor: Sets the default values. More...
 
virtual ~Identifiable ()
 
ORX_FORCEINLINE voidgetDerivedPointer (unsigned int classID)
 Returns a valid pointer of any derived type that is registered in the class hierarchy. More...
 
template<class T >
ORX_FORCEINLINE T * getDerivedPointer (unsigned int classID)
 Version of getDerivedPointer with template. More...
 
template<class T >
ORX_FORCEINLINE const T * getDerivedPointer (unsigned int classID) const
 Const version of getDerivedPointer with template. More...
 
IdentifiergetIdentifier () const
 Returns the Identifier of the object. More...
 
bool isA (const Identifier *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
template<class B >
bool isA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isA (const Identifiable *object)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isChildOf (const Identifier *identifier)
 Returns true if the object's class is a child of the given type. More...
 
template<class B >
bool isChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a child of the given type. More...
 
bool isChildOf (const Identifiable *object)
 Returns true if the object's class is a child of the given type. More...
 
bool isDirectChildOf (const Identifier *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
template<class B >
bool isDirectChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectChildOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectParentOf (const Identifier *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
template<class B >
bool isDirectParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
bool isDirectParentOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isExactlyA (const Identifier *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
template<class B >
bool isExactlyA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
bool isExactlyA (const Identifiable *object)
 Returns true if the object's class is exactly of the given type. More...
 
bool isParentOf (const Identifier *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
template<class B >
bool isParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
bool isParentOf (const Identifiable *object)
 Returns true if the object's class is a parent of the given type. More...
 

Private Member Functions

virtual void buttonHeld (const KeyEvent &evt) override
 
bool charIsAllowed (const char &input)
 
virtual void keyboardUpdated (float dt) override
 This update() function is called by the InputState if the InputBuffer is active. More...
 
void processKey (const KeyEvent &evt)
 

Private Attributes

std::string allowedChars_
 
std::string buffer_
 
unsigned int cursor_
 
float keyRepeatDeleay_
 
float keyRepeatTime_
 
int keysToRepeat_
 
KeyCode::ByEnum lastKey_
 
std::list< BaseInputBufferListenerTuple * > listeners_
 
unsigned int maxLength_
 
float timeSinceKeyPressed_
 
float timeSinceKeyRepeated_
 

Additional Inherited Members

- Static Public Attributes inherited from orxonox::InputHandler
static InputHandler EMPTY
 Use this input handler if you want to occupy a device in an input state. More...
 

Constructor & Destructor Documentation

orxonox::InputBuffer::InputBuffer ( )
orxonox::InputBuffer::~InputBuffer ( )
orxonox::InputBuffer::InputBuffer ( const std::string &  allowedChars)

Member Function Documentation

void orxonox::InputBuffer::buttonHeld ( const KeyEvent evt)
overrideprivatevirtual

Reimplemented from orxonox::InputHandler.

void orxonox::InputBuffer::buttonPressed ( const KeyEvent evt)
overridevirtual

Reimplemented from orxonox::InputHandler.

bool orxonox::InputBuffer::charIsAllowed ( const char &  input)
private
void orxonox::InputBuffer::clear ( bool  update = true)
void orxonox::InputBuffer::decreaseCursor ( )
inline
const std::string& orxonox::InputBuffer::get ( ) const
inline
unsigned int orxonox::InputBuffer::getCursorPosition ( ) const
inline
unsigned int orxonox::InputBuffer::getMaxLength ( ) const
inline
unsigned int orxonox::InputBuffer::getSize ( void  ) const
inline
void orxonox::InputBuffer::increaseCursor ( )
inline
void orxonox::InputBuffer::insert ( const std::string &  input,
bool  update = true 
)
void orxonox::InputBuffer::insert ( const char &  input,
bool  update = true 
)
void orxonox::InputBuffer::keyboardUpdated ( float  dt)
overrideprivatevirtual

This update() function is called by the InputState if the InputBuffer is active.

Parameters
dtDelta time

Reimplemented from orxonox::InputHandler.

void orxonox::InputBuffer::processKey ( const KeyEvent evt)
private
template<class T >
void orxonox::InputBuffer::registerListener ( T *  listener,
void(T::*)()  function,
bool  bOnlySingleInput 
)
inline
template<class T >
void orxonox::InputBuffer::registerListener ( T *  listener,
void(T::*)() const  function,
bool  bOnlySingleInput 
)
inline
template<class T >
void orxonox::InputBuffer::registerListener ( T *  listener,
void(T::*)()  function,
char  _char,
bool  bOnlySingleInput 
)
inline
template<class T >
void orxonox::InputBuffer::registerListener ( T *  listener,
void(T::*)() const  function,
char  _char,
bool  bOnlySingleInput 
)
inline
template<class T >
void orxonox::InputBuffer::registerListener ( T *  listener,
void(T::*)()  function,
KeyCode::ByEnum  key 
)
inline
template<class T >
void orxonox::InputBuffer::registerListener ( T *  listener,
void(T::*)() const  function,
KeyCode::ByEnum  key 
)
inline
void orxonox::InputBuffer::removeAtCursor ( bool  update = true)
void orxonox::InputBuffer::removeBehindCursor ( bool  update = true)
void orxonox::InputBuffer::set ( const std::string &  input,
bool  update = true 
)
void orxonox::InputBuffer::setConfigValues ( void  )
void orxonox::InputBuffer::setCursorPosition ( unsigned int  cursor)
inline
void orxonox::InputBuffer::setCursorToBegin ( )
inline
void orxonox::InputBuffer::setCursorToEnd ( )
inline
void orxonox::InputBuffer::setMaxLength ( unsigned int  length)
template<class T >
void orxonox::InputBuffer::unregisterListener ( T *  listener)
inline
void orxonox::InputBuffer::updated ( )
void orxonox::InputBuffer::updated ( const char &  update,
bool  bSingleInput 
)

Member Data Documentation

std::string orxonox::InputBuffer::allowedChars_
private
std::string orxonox::InputBuffer::buffer_
private
unsigned int orxonox::InputBuffer::cursor_
private
float orxonox::InputBuffer::keyRepeatDeleay_
private
float orxonox::InputBuffer::keyRepeatTime_
private
int orxonox::InputBuffer::keysToRepeat_
private
KeyCode::ByEnum orxonox::InputBuffer::lastKey_
private
std::list<BaseInputBufferListenerTuple*> orxonox::InputBuffer::listeners_
private
unsigned int orxonox::InputBuffer::maxLength_
private
float orxonox::InputBuffer::timeSinceKeyPressed_
private
float orxonox::InputBuffer::timeSinceKeyRepeated_
private

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