orxonox::InputBuffer Class Reference

#include <src/core/input/InputBuffer.h>

Inheritance diagram for orxonox::InputBuffer:

orxonox::KeyHandler orxonox::OrxonoxClass orxonox::InputHandler

List of all members.

Public Member Functions

void clear (bool update=true)
void decreaseCursor ()
const std::stringget () const
unsigned int getCursorPosition () const
unsigned int getSize () const
void increaseCursor ()
 InputBuffer (const std::string &allowedChars)
 InputBuffer ()
void insert (const char &input, bool update=true)
void insert (const std::string &input, bool update=true)
template<class T>
void registerListener (T *listener, void(T::*function)() const, KeyCode::ByEnum key)
template<class T>
void registerListener (T *listener, void(T::*function)(), KeyCode::ByEnum key)
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)(), char _char, 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)(), bool bOnlySingleInput)
void removeAtCursor (bool update=true)
void removeBehindCursor (bool update=true)
void set (const std::string &input, bool update=true)
void setConfigValues ()
 Function to collect the SetConfigValue-macro calls.
void setCursorPosition (unsigned int cursor)
void setCursorToBegin ()
void setCursorToEnd ()
template<class T>
void unregisterListener (T *listener)
void updated (const char &update, bool bSingleInput)
void updated ()
 ~InputBuffer ()

Private Member Functions

bool charIsAllowed (const char &input)
void keyHeld (const KeyEvent &evt)
void keyPressed (const KeyEvent &evt)
void keyReleased (const KeyEvent &evt)
void processKey (const KeyEvent &e)
void updateInput (float dt)
 This update() function is called by the InputManager if the InputBuffer is active.
void updateKey (float dt)

Private Attributes

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


Constructor & Destructor Documentation

orxonox::InputBuffer::InputBuffer (  ) 

orxonox::InputBuffer::~InputBuffer (  ) 

References listeners_.

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


Member Function Documentation

bool orxonox::InputBuffer::charIsAllowed ( const char &  input  )  [private]

References allowedChars_.

Referenced by insert().

void orxonox::InputBuffer::clear ( bool  update = true  ) 

References buffer_, cursor_, and updated().

Referenced by orxonox::Shell::clear(), processKey(), and set().

void orxonox::InputBuffer::decreaseCursor (  )  [inline]

const std::string& orxonox::InputBuffer::get (  )  const [inline]

unsigned int orxonox::InputBuffer::getCursorPosition (  )  const [inline]

unsigned int orxonox::InputBuffer::getSize (  )  const [inline]

Referenced by orxonox::Shell::exit().

void orxonox::InputBuffer::increaseCursor (  )  [inline]

void orxonox::InputBuffer::insert ( const char &  input,
bool  update = true 
)

void orxonox::InputBuffer::insert ( const std::string input,
bool  update = true 
)

References updated().

Referenced by processKey(), and set().

void orxonox::InputBuffer::keyHeld ( const KeyEvent evt  )  [private, virtual]

void orxonox::InputBuffer::keyPressed ( const KeyEvent evt  )  [private, virtual]

void orxonox::InputBuffer::keyReleased ( const KeyEvent evt  )  [inline, private, virtual]

Implements orxonox::KeyHandler.

void orxonox::InputBuffer::processKey ( const KeyEvent e  )  [private]

template<class T>
void orxonox::InputBuffer::registerListener ( T *  listener,
void(T::*)() const   function,
KeyCode::ByEnum  key 
) [inline]

References orxonox::KeyCode::T.

template<class T>
void orxonox::InputBuffer::registerListener ( T *  listener,
void(T::*)()  function,
KeyCode::ByEnum  key 
) [inline]

References orxonox::KeyCode::T.

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,
char  _char,
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,
bool  bOnlySingleInput 
) [inline]

void orxonox::InputBuffer::removeAtCursor ( bool  update = true  ) 

References buffer_, cursor_, and updated().

Referenced by orxonox::Shell::deletechar().

void orxonox::InputBuffer::removeBehindCursor ( bool  update = true  ) 

References buffer_, cursor_, and updated().

Referenced by orxonox::Shell::backspace().

void orxonox::InputBuffer::set ( const std::string input,
bool  update = true 
)

void orxonox::InputBuffer::setConfigValues (  ) 

Function to collect the SetConfigValue-macro calls.

Reimplemented from orxonox::OrxonoxClass.

References keyRepeatDeleay_, keyRepeatTime_, ResetConfigValue, and SetConfigValue.

Referenced by InputBuffer().

void orxonox::InputBuffer::setCursorPosition ( unsigned int  cursor  )  [inline]

void orxonox::InputBuffer::setCursorToBegin (  )  [inline]

void orxonox::InputBuffer::setCursorToEnd (  )  [inline]

template<class T>
void orxonox::InputBuffer::unregisterListener ( T *  listener  )  [inline]

void orxonox::InputBuffer::updated ( const char &  update,
bool  bSingleInput 
)

References listeners_.

void orxonox::InputBuffer::updated (  ) 

void orxonox::InputBuffer::updateInput ( float  dt  )  [private, virtual]

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

Parameters:
dt Delta time

Implements orxonox::InputHandler.

References keyRepeatDeleay_, keyRepeatTime_, keysToRepeat_, timeSinceKeyPressed_, and timeSinceKeyRepeated_.

void orxonox::InputBuffer::updateKey ( float  dt  )  [inline, private, virtual]

Implements orxonox::KeyHandler.


Member Data Documentation

Referenced by charIsAllowed(), and InputBuffer().

unsigned int orxonox::InputBuffer::cursor_ [private]

Referenced by setConfigValues(), and updateInput().

Referenced by InputBuffer(), keyHeld(), and keyPressed().

Referenced by processKey(), updated(), and ~InputBuffer().


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

Generated on Tue Jul 28 16:22:38 2009 for Orxonox by  doxygen 1.5.6