21 #ifndef _WORLDSTATE_HH_
22 #define _WORLDSTATE_HH_
60 public:
explicit WorldState(
const sdf::ElementPtr _sdf);
75 public:
virtual void Load(
const sdf::ElementPtr _elem);
107 public:
bool HasModelState(
const std::string &_modelName)
const;
113 public:
bool IsZero()
const;
117 public:
void FillSDF(sdf::ElementPtr _sdf);
151 public:
inline friend std::ostream &
operator<<(std::ostream &_out,
154 _out <<
"<state world_name='" << _state.
name <<
"'>"
155 <<
"<sim_time>" << _state.
simTime <<
"</sim_time>"
156 <<
"<wall_time>" << _state.
wallTime <<
"</wall_time>"
157 <<
"<real_time>" << _state.
realTime <<
"</real_time>";
160 if (_state.insertions.size() > 0)
162 _out <<
"<insertions>";
163 for (std::vector<std::string>::const_iterator iter =
164 _state.insertions.begin();
165 iter != _state.insertions.end(); ++iter)
169 _out <<
"</insertions>";
173 if (_state.deletions.size() > 0)
175 _out <<
"<deletions>";
176 for (std::vector<std::string>::const_iterator iter =
177 _state.deletions.begin();
178 iter != _state.deletions.end(); ++iter)
180 _out <<
"<name>" << (*iter) <<
"</name>";
182 _out <<
"</deletions>";
186 for (ModelState_M::const_iterator iter = _state.modelStates.begin();
187 iter != _state.modelStates.end(); ++iter)
189 _out << iter->second;
202 private: std::vector<std::string> insertions;
206 private: std::vector<std::string> deletions;