1st Version
This commit is contained in:
69
rt_service.cpp
Normal file
69
rt_service.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#include <boost/python.hpp>
|
||||
#include <boost/python/list.hpp>
|
||||
#include <boost/python/extract.hpp>
|
||||
#include <string>
|
||||
//#include <sstream>
|
||||
//#include <vector>
|
||||
|
||||
struct RTService
|
||||
{
|
||||
// private:
|
||||
// /* data */
|
||||
|
||||
// public:
|
||||
// RT_Service(/* args */) {}
|
||||
|
||||
// ~RT_Service() {}
|
||||
|
||||
bool createMonitoring(std::string id) {
|
||||
//TODO ML: add this to the M4Core
|
||||
return true;
|
||||
}
|
||||
|
||||
bool deleteMonitoring(std::string id) {
|
||||
//TODO ML: add this to the M4Core
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string getMonitoringState(std::string id) {
|
||||
//TODO ask the M4Core for the Monitpring Status
|
||||
return "Start";
|
||||
}
|
||||
|
||||
boost::python::list getMonitoringStates() {
|
||||
//TODO ask the M4Core for the Monitpring Status
|
||||
boost::python::list list;
|
||||
return list;
|
||||
}
|
||||
|
||||
bool setMonitoringStatus(std::string id, std::string status) {
|
||||
//set the Status
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
using namespace boost::python;
|
||||
|
||||
BOOST_PYTHON_MODULE(rt_service)
|
||||
{
|
||||
class_<RTService>("RT_Service")
|
||||
.def("createMonitoring", &RTService::createMonitoring)
|
||||
.def("getMonitoringStatus", &RTService::getMonitoringState)
|
||||
.def("getAllMonitoringStat", &RTService::getMonitoringStates)
|
||||
.def("setMonitoringStatus", &RTService::setMonitoringStatus)
|
||||
;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//examples
|
||||
// long l = len(msgs);
|
||||
// std::stringstream ss;
|
||||
// for (long i = 0; i<l; ++i) {
|
||||
// if (i>0) ss << ", ";
|
||||
// std::string s = boost::python::extract<std::string>(msgs[i]);
|
||||
// ss << s;
|
||||
// }
|
||||
// mMsg = ss.str();
|
||||
Reference in New Issue
Block a user