6 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
8 #pragma warning(disable:4100)
9 #pragma warning(disable:4127)
10 #pragma warning(disable:4244)
11 #pragma warning(disable:4267)
12 #pragma warning(disable:4512)
16 #include <boost/python.hpp>
17 #include <boost/python/suite/indexing/vector_indexing_suite.hpp>
27 std::vector<long> getIds() {
28 return CommandManager::getInstance().commandKeys();
32 return CommandManager::getInstance().runTickCommand(200);
37 mt4cpp::CommandDesc::State getState(
long id) {
return CommandManager::getInstance().findCommandDesc(
id).state_; }
38 double getProgress(
long id) {
return CommandManager::getInstance().findCommandDesc(
id).progress_; }
47 boost::python::def(
"getNumber", getNumber );
49 boost::python::enum_<mt4cpp::CommandDesc::State>(
"CommandState")
50 .value(
"NONE",mt4cpp::CommandDesc::NONE)
51 .value(
"QUEUED",mt4cpp::CommandDesc::QUEUED)
52 .value(
"PENDING",mt4cpp::CommandDesc::PENDING)
53 .value(
"INTERRUPTED",mt4cpp::CommandDesc::INTERRUPTED)
54 .value(
"EXCEPTION",mt4cpp::CommandDesc::EXCEPTION)
55 .value(
"DONE",mt4cpp::CommandDesc::DONE)
59 class_<std::vector<long> >(
"CommandKeys")
60 .def(vector_indexing_suite<std::vector<long> >() )
63 class_<CommandManagerPy>(
"CommandManager")
64 .def(
"getIds", &CommandManagerPy::getIds )
65 .def(
"start", &CommandManagerPy::startTick )
66 .def(
"break", &CommandManagerPy::breakCmd )
67 .def(
"getState", &CommandManagerPy::getState )
68 .def(
"getProgress", &CommandManagerPy::getProgress )
the C++ calculation library interface
BOOST_PYTHON_MODULE(calc)