blob: 45587ab7e59fdcc1e2822732940fd04786c6b937 (
plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#pragma once
#include "imodule.h"
#include "cli/commands/icommand.h"
#include <map>
#include <memory>
namespace modules
{
class Module : public IModule
{
public:
Module(const std::wstring &name, const std::wstring &description)
: m_name(name)
, m_description(description)
{
}
std::wstring name() override
{
return m_name;
}
std::wstring description() override
{
return m_description;
}
// Collect name and description from commands.
PropertyList commands() override;
// Identify requested command and dispatch to it.
void handleRequest(const std::vector<std::wstring> &request) override;
void addCommand(std::unique_ptr<commands::ICommand> command);
private:
Module(const Module &);
Module &operator=(const Module &);
std::wstring m_name;
std::wstring m_description;
std::map<std::wstring, std::unique_ptr<commands::ICommand> > m_commands;
};
}
|