PicoScenes API Docs
 
Loading...
Searching...
No Matches
AbstractPicoScenesPlugin.hxx
Go to the documentation of this file.
1//
2// Created by Zhiping Jiang on 2020/1/8.
3//
4
5#ifndef PICOSCENES_PLATFORM_ABSTRACTPICOSCENESPLUGIN_HXX
6#define PICOSCENES_PLATFORM_ABSTRACTPICOSCENESPLUGIN_HXX
7
8#include <memory>
9#include "BoostHeaders.hxx"
10#include "ModularPicoScenesFrame.hxx"
11
12namespace pos = boost::program_options::command_line_style;
13
14class AbstractNIC;
15
17public:
18 // Plugin name and description must be provided, hence declare them as pure virtual
19 virtual std::string getPluginName() = 0;
20
21 virtual std::string getPluginDescription() = 0;
22
23 virtual std::string pluginStatus() = 0;
24
25 virtual std::vector<PicoScenesDeviceType> getSupportedDeviceTypes() {
26 return std::vector{PicoScenesDeviceType::USRP, PicoScenesDeviceType::QCA9300, PicoScenesDeviceType::IWL5300, PicoScenesDeviceType::MAC80211Compatible};
27 };
28
29 virtual void initialization() {};
30
31 virtual std::shared_ptr<po::options_description> pluginOptionsDescription() { return nullptr; }
32
33 virtual void parseAndExecuteCommands(const std::string &commandString) {}
34
35 virtual void rxHandle(const ModularPicoScenesRxFrame &rxs) {}
36
37 virtual void finalize() {}
38
39 virtual ~AbstractPicoScenesPlugin() = default;
40
41 void setNIC(const std::shared_ptr<AbstractNIC> &nicV) {
42 this->nic = nicV;
43 }
44
45// virtual pt::ptree plugInRESTfulGET(const pt::ptree &request) { return this->getBoostPropertyTree(); };
46//
47// virtual pt::ptree plugInRESTfulPOST(const pt::ptree &request) { return pt::ptree(); };
48
49protected:
50 std::shared_ptr<AbstractNIC> nic;
51};
52
53#endif //PICOSCENES_PLATFORM_ABSTRACTPICOSCENESPLUGIN_HXX
virtual void parseAndExecuteCommands(const std::string &commandString)
virtual std::string getPluginName()=0
virtual std::string getPluginDescription()=0
virtual void rxHandle(const ModularPicoScenesRxFrame &rxs)
virtual std::shared_ptr< po::options_description > pluginOptionsDescription()
void setNIC(const std::shared_ptr< AbstractNIC > &nicV)
virtual std::string pluginStatus()=0
virtual std::vector< PicoScenesDeviceType > getSupportedDeviceTypes()
virtual ~AbstractPicoScenesPlugin()=default
std::shared_ptr< AbstractNIC > nic