Blame view

build1/epsilon-master/ion/src/device/bench/command_handler.h 571 Bytes
6663b6c9   adorian   projet complet av...
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
27
  #ifndef ION_DEVICE_BENCH_COMMAND_HANDLER_H
  #define ION_DEVICE_BENCH_COMMAND_HANDLER_H
  
  #include "command/command.h"
  
  namespace Ion {
  namespace Device {
  namespace Bench {
  
  class CommandHandler {
  public:
    constexpr CommandHandler(const char * name, Command::Function function) :
      m_name(name), m_function(function) {}
    bool valid() const;
    bool handle(const char * command) const;
    Command::Function function() const { return m_function; }
  private:
    bool matches(const char * command) const;
    const char * m_name;
    Command::Function m_function;
  };
  
  }
  }
  }
  
  #endif