nomlib
Loading...
Searching...
No Matches
nom::InputActionMapper Class Reference

High-level API for associating names with input actions. More...

#include <InputActionMapper.hpp>

Public Types

typedef InputActionMapper SelfType
typedef std::multimap< std::string, std::shared_ptr< InputAction > > ActionMap
typedef std::pair< std::string, std::shared_ptr< InputAction > > ActionPair

Public Member Functions

 InputActionMapper (void)
 Default constructor.
 ~InputActionMapper (void)
 Destructor.
bool insert (const std::string &key, const InputAction &action, const event_callback &callback)
 Insert an action mapping.
bool erase (const std::string &key)
 Remove an action mapping.

Private Member Functions

const ActionMap & get (void) const
 Obtain the input map's contents.

Private Attributes

ActionMap input_map_
 Hash container of input actions, sorted by name.

Friends

class InputStateMapper

Detailed Description

High-level API for associating names with input actions.

Remarks
See also, nom::InputAction.

Definition at line 46 of file InputActionMapper.hpp.

Member Typedef Documentation

◆ ActionMap

typedef std::multimap<std::string, std::shared_ptr<InputAction> > nom::InputActionMapper::ActionMap

Definition at line 52 of file InputActionMapper.hpp.

◆ ActionPair

typedef std::pair<std::string, std::shared_ptr<InputAction> > nom::InputActionMapper::ActionPair

Definition at line 53 of file InputActionMapper.hpp.

◆ SelfType

typedef InputActionMapper nom::InputActionMapper::SelfType

Definition at line 51 of file InputActionMapper.hpp.

Member Function Documentation

◆ get()

const ActionMap & nom::InputActionMapper::get ( void ) const
private

Obtain the input map's contents.

Remarks
Used internally by nom::InputStateMapper.

◆ insert()

bool nom::InputActionMapper::insert ( const std::string & key,
const InputAction & action,
const event_callback & callback )

Insert an action mapping.

See also
nom::InputAction

◆ InputStateMapper

friend class InputStateMapper
friend

Definition at line 49 of file InputActionMapper.hpp.

Member Data Documentation

◆ input_map_

ActionMap nom::InputActionMapper::input_map_
private

Hash container of input actions, sorted by name.

Remarks
Note that we are a multi-map, therefore multiple duplicate action keys can be used.

Definition at line 81 of file InputActionMapper.hpp.


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