SMACC
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
cl_keyboard::CbDefaultKeyboardBehavior Class Reference

#include <cb_default_keyboard_behavior.h>

Inheritance diagram for cl_keyboard::CbDefaultKeyboardBehavior:
Inheritance graph
Collaboration diagram for cl_keyboard::CbDefaultKeyboardBehavior:
Collaboration graph

Public Member Functions

void onEntry ()
 
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
void OnKeyPress (char character)
 
template<typename TEv >
void postKeyEvent ()
 
- Public Member Functions inherited from smacc::SmaccClientBehavior
virtual void onEntry () override
 
virtual void onExit () override
 
- Public Member Functions inherited from smacc::ISmaccClientBehavior
 ISmaccClientBehavior ()
 
virtual ~ISmaccClientBehavior ()
 
ISmaccStateMachinegetStateMachine ()
 
std::string getName () const
 
template<typename SmaccClientType >
void requiresClient (SmaccClientType *&storage)
 
template<typename SmaccComponentType >
void requiresComponent (SmaccComponentType *&storage)
 
ros::NodeHandle getNode ()
 

Public Attributes

ClKeyboardClKeyboard_
 
std::function< void(char)> postEventKeyPress
 

Additional Inherited Members

- Protected Member Functions inherited from smacc::ISmaccClientBehavior
virtual void runtimeConfigure ()
 
virtual void onEntry ()
 
virtual void onExit ()
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
ISmaccStategetCurrentState ()
 
virtual void executeOnEntry ()
 
virtual void executeOnExit ()
 
virtual void dispose ()
 

Detailed Description

Definition at line 10 of file cb_default_keyboard_behavior.h.

Member Function Documentation

◆ onEntry()

void cl_keyboard::CbDefaultKeyboardBehavior::onEntry ( )
inlinevirtual

Reimplemented from smacc::SmaccClientBehavior.

Definition at line 16 of file cb_default_keyboard_behavior.h.

17 {
20 }
void OnKeyPress(void(T::*callback)(char keypress), T *object)
Definition: cl_keyboard.h:154
void requiresClient(SmaccClientType *&storage)

References OnKeyPress(), cl_keyboard::ClKeyboard::OnKeyPress(), and smacc::ISmaccClientBehavior::requiresClient().

Here is the call graph for this function:

◆ OnKeyPress()

void cl_keyboard::CbDefaultKeyboardBehavior::OnKeyPress ( char  character)
inline

Definition at line 81 of file cb_default_keyboard_behavior.h.

82 {
83 postEventKeyPress(character);
84 }

References postEventKeyPress.

Referenced by onEntry().

Here is the caller graph for this function:

◆ onOrthogonalAllocation()

template<typename TOrthogonal , typename TSourceObject >
void cl_keyboard::CbDefaultKeyboardBehavior::onOrthogonalAllocation ( )
inline

Definition at line 23 of file cb_default_keyboard_behavior.h.

24 {
25 postEventKeyPress = [=](char character) {
26 if (character == 'a')
27 postKeyEvent<EvKeyPressA<CbDefaultKeyboardBehavior, TOrthogonal>>();
28 else if (character == 'b')
29 postKeyEvent<EvKeyPressB<CbDefaultKeyboardBehavior, TOrthogonal>>();
30 else if (character == 'c')
31 postKeyEvent<EvKeyPressC<CbDefaultKeyboardBehavior, TOrthogonal>>();
32 else if (character == 'd')
33 postKeyEvent<EvKeyPressD<CbDefaultKeyboardBehavior, TOrthogonal>>();
34 else if (character == 'e')
35 postKeyEvent<EvKeyPressE<CbDefaultKeyboardBehavior, TOrthogonal>>();
36 else if (character == 'f')
37 postKeyEvent<EvKeyPressF<CbDefaultKeyboardBehavior, TOrthogonal>>();
38 else if (character == 'g')
39 postKeyEvent<EvKeyPressG<CbDefaultKeyboardBehavior, TOrthogonal>>();
40 else if (character == 'h')
41 postKeyEvent<EvKeyPressH<CbDefaultKeyboardBehavior, TOrthogonal>>();
42 else if (character == 'i')
43 postKeyEvent<EvKeyPressI<CbDefaultKeyboardBehavior, TOrthogonal>>();
44 else if (character == 'j')
45 postKeyEvent<EvKeyPressJ<CbDefaultKeyboardBehavior, TOrthogonal>>();
46 else if (character == 'k')
47 postKeyEvent<EvKeyPressK<CbDefaultKeyboardBehavior, TOrthogonal>>();
48 else if (character == 'l')
49 postKeyEvent<EvKeyPressL<CbDefaultKeyboardBehavior, TOrthogonal>>();
50 else if (character == 'm')
51 postKeyEvent<EvKeyPressM<CbDefaultKeyboardBehavior, TOrthogonal>>();
52 else if (character == 'n')
53 postKeyEvent<EvKeyPressN<CbDefaultKeyboardBehavior, TOrthogonal>>();
54 else if (character == 'o')
55 postKeyEvent<EvKeyPressO<CbDefaultKeyboardBehavior, TOrthogonal>>();
56 else if (character == 'p')
57 postKeyEvent<EvKeyPressP<CbDefaultKeyboardBehavior, TOrthogonal>>();
58 else if (character == 'q')
59 postKeyEvent<EvKeyPressQ<CbDefaultKeyboardBehavior, TOrthogonal>>();
60 else if (character == 'r')
61 postKeyEvent<EvKeyPressR<CbDefaultKeyboardBehavior, TOrthogonal>>();
62 else if (character == 's')
63 postKeyEvent<EvKeyPressS<CbDefaultKeyboardBehavior, TOrthogonal>>();
64 else if (character == 't')
65 postKeyEvent<EvKeyPressT<CbDefaultKeyboardBehavior, TOrthogonal>>();
66 else if (character == 'u')
67 postKeyEvent<EvKeyPressU<CbDefaultKeyboardBehavior, TOrthogonal>>();
68 else if (character == 'v')
69 postKeyEvent<EvKeyPressV<CbDefaultKeyboardBehavior, TOrthogonal>>();
70 else if (character == 'w')
71 postKeyEvent<EvKeyPressW<CbDefaultKeyboardBehavior, TOrthogonal>>();
72 else if (character == 'x')
73 postKeyEvent<EvKeyPressX<CbDefaultKeyboardBehavior, TOrthogonal>>();
74 else if (character == 'y')
75 postKeyEvent<EvKeyPressY<CbDefaultKeyboardBehavior, TOrthogonal>>();
76 else if (character == 'z')
77 postKeyEvent<EvKeyPressZ<CbDefaultKeyboardBehavior, TOrthogonal>>();
78 };
79 }

References postEventKeyPress.

◆ postKeyEvent()

template<typename TEv >
void cl_keyboard::CbDefaultKeyboardBehavior::postKeyEvent ( )
inline

Definition at line 87 of file cb_default_keyboard_behavior.h.

88 {
89 ROS_WARN("CbDefaultKeyboardBehavior %ld ev: %s", (long)(void *)this, smacc::demangleSymbol(typeid(TEv).name()).c_str());
90 auto event = new TEv();
91 this->postEvent(event);
92 }
std::string demangleSymbol()
Definition: introspection.h:75

References smacc::introspection::demangleSymbol(), and smacc::ISmaccClientBehavior::postEvent().

Here is the call graph for this function:

Member Data Documentation

◆ ClKeyboard_

ClKeyboard* cl_keyboard::CbDefaultKeyboardBehavior::ClKeyboard_

Definition at line 13 of file cb_default_keyboard_behavior.h.

◆ postEventKeyPress

std::function<void(char)> cl_keyboard::CbDefaultKeyboardBehavior::postEventKeyPress

Definition at line 14 of file cb_default_keyboard_behavior.h.

Referenced by OnKeyPress(), and onOrthogonalAllocation().


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