-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCmdDispatcher.h
More file actions
26 lines (22 loc) · 783 Bytes
/
CmdDispatcher.h
File metadata and controls
26 lines (22 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef __CMD_DISPATCHER__
#define __CMD_DISPATCHER__
#include "ICmdDispatcher.h"
#include "ILED.h"
#include <map>
class CmdDispatcher : public ICmdDispatcher {
typedef std::string ( CmdDispatcher::* cmd_type ) ( std::vector< std::string > & );
typedef std::map< std::string, cmd_type > cmd_map_type;
public:
CmdDispatcher( ILED * );
virtual std::string dispatch( std::string & );
private:
std::string set_color( std::vector< std::string > & );
std::string get_color( std::vector< std::string > & );
std::string set_state( std::vector< std::string > & );
std::string get_state( std::vector< std::string > & );
std::string set_rate( std::vector< std::string > & );
std::string get_rate( std::vector< std::string > & );
ILED *pLED_;
cmd_map_type cmd_map_;
};
#endif