File tree Expand file tree Collapse file tree
occ/occlib/examples/dummy-process Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525
2626#include " ControlledStateMachine.h"
2727
28+ #include < boost/property_tree/json_parser.hpp>
29+
2830#include < iostream>
2931
3032#define LOG_SCOPE RaiiLogEntry obj ## __LINE__ (__FUNCTION__);
@@ -37,12 +39,14 @@ struct RaiiLogEntry
3739};
3840
3941
40- int ControlledStateMachine::executeConfigure (const PropertyMap & properties)
42+ int ControlledStateMachine::executeConfigure (const boost::property_tree::ptree & properties)
4143{
4244 LOG_SCOPE
43- for (auto const & item : properties) {
44- printf (" %s :\t %s\n " , item.first .c_str (), item.second .c_str ());
45- }
45+ printf (" received runtime configuration:\n " );
46+ std::stringstream ss;
47+ boost::property_tree::json_parser::write_json (ss, properties);
48+ printf (" %s\n " , ss.str ().c_str ());
49+
4650 return RuntimeControlledObject::executeConfigure (properties);
4751}
4852
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class ControlledStateMachine : public RuntimeControlledObject
3333public:
3434 explicit ControlledStateMachine () : RuntimeControlledObject(" Dummy Process" ) {}
3535
36- int executeConfigure (const PropertyMap & properties) override ; // to go from standby to configured
36+ int executeConfigure (const boost::property_tree::ptree & properties) override ; // to go from standby to configured
3737 int executeReset () override ; // to go from configured to standby
3838 int executeRecover () override ; // to go from error to standby
3939 int executeStart () override ; // to go from configured to running
You can’t perform that action at this time.
0 commit comments