Robot Devastation
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
rd::MockInputManager Class Reference

Allows to simulate input from a user programatically (mainly for test purposes)

#include <MockInputManager.hpp>

Inheritance diagram for rd::MockInputManager:
rd::InputManager

Public Member Functions

bool sendKeyPress (const Key &key)
 
bool sendKeyUp (const Key &key)
 
bool sendKeyDown (const Key &key)
 
bool sendWindowEvent (const WindowEvent &event)
 
virtual bool start ()
 Start to capture input events. More...
 
virtual bool stop ()
 Stop capturing input events.
 
virtual bool isStopped () const
 True if the manager is not active.
 
int getNumListeners ()
 
- Public Member Functions inherited from rd::InputManager
bool addInputEventListener (InputEventListener *listener)
 Adds a InputEventListener to the list of observers to be notified of events.
 
bool removeInputEventListeners ()
 Unregisters all the InputEventListener stored.
 
virtual bool configure (const std::string &parameter, const std::string &value)
 Configures a parameter with a value.
 
virtual bool refreshEvents ()
 Get system info about input events.
 

Static Public Member Functions

static bool RegisterManager ()
 Register this manager in the InputManager registry so that can be used. More...
 
- Static Public Member Functions inherited from rd::InputManager
static InputManagergetInputManager ()
 Get a reference to the InputManager. More...
 
static InputManagergetInputManager (const std::string &id)
 Get a reference to the InputManager. More...
 
static bool destroyInputManager ()
 Deallocate all the registered InputManager.
 

Static Public Attributes

static const std::string id = "MOCK"
 String that identifies this manager.
 

Private Member Functions

 MockInputManager ()
 Constructor. More...
 
 MockInputManager (const MockInputManager &)
 
MockInputManageroperator= (const MockInputManager &)
 

Private Attributes

bool stopped
 

Static Private Attributes

static MockInputManageruniqueInstance = NULL
 Reference to this manager (unique instance)
 

Additional Inherited Members

- Static Protected Member Functions inherited from rd::InputManager
static bool Register (InputManager *manager, const std::string &id)
 This function allows subclasses to install their unique instances in the singleton register to be selected later by the user.
 
- Protected Attributes inherited from rd::InputManager
std::vector< InputEventListener * > listeners
 Observers registered to be notified of input events.
 

Constructor & Destructor Documentation

◆ MockInputManager()

rd::MockInputManager::MockInputManager ( )
private

Constructor for this class is private, since the singleton can only be instantiated once, and the instantiation is done at the RegisterManager() method.

Member Function Documentation

◆ RegisterManager()

bool rd::MockInputManager::RegisterManager ( )
static

It ensures that only one manager of this type is created (unique instance).

◆ start()

bool rd::MockInputManager::start ( )
virtual

This function is supposed to be called after InputManager configuration.

Implements rd::InputManager.


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