- rep.getValue("reps", myGarage.m_reps);
- // Client know that server is sending two representations
- // and has key1 and key2 repsectively
- std::cout << "\treps[0].key1: " << myGarage.m_reps[0].getValue<int>("key1") << std::endl;
- std::cout << "\treps[0].key2: " << myGarage.m_reps[1].getValue<int>("key2") << std::endl;
+ myGarage.m_reps = rep["reps"];
+
+ int ct = 0;
+ for(auto& rep : myGarage.m_reps)
+ {
+ for(auto& attribute : rep)
+ {
+ std::cout<< "\treps["<<ct<<"]."<<attribute.attrname()<<":"
+ << attribute.type()<<" with value " <<attribute.getValueToString() <<std::endl;
+ }
+ ++ct;
+ }
+
+ std::cout << "\tjson: " << rep["json"] << std::endl;
+ myGarage.m_hingeStates = rep["hinges"];
+
+ std::cout<< "\tHinge parameter is type: " << rep["hinges"].type() << " with depth "<<
+ rep["hinges"].depth() << " and a base type of "<< rep["hinges"].base_type()<<std::endl;
+