8 #include <Poco/AtomicCounter.h>
9 #include <Poco/SharedPtr.h>
11 #include "core/CommandHandler.h"
12 #include "core/CommandSender.h"
13 #include "credentials/FileCredentialsStorage.h"
14 #include "io/Console.h"
15 #include "loop/StoppableRunnable.h"
16 #include "model/DeviceID.h"
17 #include "model/DeviceDescription.h"
18 #include "model/ModuleID.h"
19 #include "util/CryptoConfig.h"
20 #include "util/Loggable.h"
30 typedef std::map<ModuleID, double> DeviceData;
34 std::map<DeviceID, DeviceData> &devices;
37 const std::vector<std::string> args;
38 Poco::SharedPtr<FileCredentialsStorage> credentialsStorage;
39 Poco::SharedPtr<CryptoConfig> cryptoConfig;
40 std::list<DeviceID> &newDevices;
41 std::set<DeviceID> &acceptedDevices;
42 std::map<DeviceID, DeviceDescription> &seenDevices;
48 typedef std::function<void(ActionContext &context)>
Action;
51 std::string description;
57 bool accept(
const Command::Ptr cmd)
override;
58 void handle(Command::Ptr cmd, Answer::Ptr answer)
override;
63 void setConsole(Poco::SharedPtr<Console> console);
64 void setPairedDevices(
const std::list<std::string> &ids);
65 Poco::SharedPtr<Console> console()
const;
66 void setCredentialsStorage(Poco::SharedPtr<FileCredentialsStorage> storage);
67 void setCryptoConfig(Poco::SharedPtr<CryptoConfig> config);
71 const std::string &name,
73 const std::string &description);
75 void processLine(
ConsoleSession &session,
const std::string &line);
78 Poco::SharedPtr<Console> m_console;
79 std::list<DeviceID> m_newDevices;
80 Poco::AtomicCounter m_stop;
81 std::map<std::string, ActionRecord> m_action;
82 std::map<DeviceID, DeviceData> m_devices;
84 Poco::SharedPtr<FileCredentialsStorage> m_credentialsStorage;
85 Poco::SharedPtr<CryptoConfig> m_cryptoConfig;
86 std::map<DeviceID, DeviceDescription> m_seenDevices;
87 std::set<DeviceID> m_acceptedDevices;
void stop() override
Definition: TestingCenter.cpp:685
Definition: TestingCenter.h:24
Definition: TestingCenter.h:50
Definition: TestingCenter.h:32
Definition: CommandHandler.h:18
Definition: CommandSender.h:20
Definition: Loggable.h:19
Definition: StoppableRunnable.h:8
std::function< void(ActionContext &context)> Action
Definition: TestingCenter.h:48