21 #ifndef _WORLDSTATE_HH_
22 #define _WORLDSTATE_HH_
61 public:
explicit WorldState(
const sdf::ElementPtr _sdf);
70 public:
void Load(
const WorldPtr _world);
76 public:
virtual void Load(
const sdf::ElementPtr _elem);
80 public:
void SetWorld(
const WorldPtr _world);
86 public:
ModelState_M GetModelStates(
const boost::regex &_regex)
const;
96 public:
unsigned int GetModelStateCount()
const;
102 public:
ModelState GetModelState(
const std::string &_modelName)
const;
108 public:
bool HasModelState(
const std::string &_modelName)
const;
114 public:
bool IsZero()
const;
118 public:
void FillSDF(sdf::ElementPtr _sdf);
123 public:
virtual void SetWallTime(
const common::Time &_time);
127 public:
virtual void SetRealTime(
const common::Time &_time);
131 public:
virtual void SetSimTime(
const common::Time &_time);
152 public:
inline friend std::ostream &
operator<<(std::ostream &_out,
155 _out <<
"<state world_name='" << _state.
name <<
"'>"
156 <<
"<sim_time>" << _state.
simTime <<
"</sim_time>"
157 <<
"<wall_time>" << _state.
wallTime <<
"</wall_time>"
158 <<
"<real_time>" << _state.
realTime <<
"</real_time>";
161 if (_state.insertions.size() > 0)
163 _out <<
"<insertions>";
164 for (std::vector<std::string>::const_iterator iter =
165 _state.insertions.begin();
166 iter != _state.insertions.end(); ++iter)
170 _out <<
"</insertions>";
174 if (_state.deletions.size() > 0)
176 _out <<
"<deletions>";
177 for (std::vector<std::string>::const_iterator iter =
178 _state.deletions.begin();
179 iter != _state.deletions.end(); ++iter)
181 _out <<
"<name>" << (*iter) <<
"</name>";
183 _out <<
"</deletions>";
187 for (ModelState_M::const_iterator iter = _state.modelStates.begin();
188 iter != _state.modelStates.end(); ++iter)
190 _out << iter->second;
203 private: std::vector<std::string> insertions;
207 private: std::vector<std::string> deletions;