#ifndef _OWLPS_POSITIONING_BUILDING_HH_ #define _OWLPS_POSITIONING_BUILDING_HH_ class Area ; class Waypoint ; #include #include #include #include /// Represents a building, containing one or more Area class Building { protected: std::string name ; /// List of Area contained in the Building std::tr1::unordered_map areas ; /// List of Waypoint in the Building std::tr1::unordered_set waypoints ; public : Building(const std::string &_name = "Unnamed building"): name(_name) {} Building(const Building &source): name(source.name), areas(source.areas), waypoints(source.waypoints) {} ~Building(void) ; /** @name Read accessors */ //@{ const std::string& get_name(void) const ; const std::tr1::unordered_map& get_areas(void) const ; const std::tr1::unordered_set& get_waypoints(void) const ; //@} /** @name Write accessors */ //@{ void set_name(const std::string &_name) ; /// Adds an Area to the \link #areas list of areas\endlink void add_area(Area *&a) ; /// Adds a Waypoint to the \link #waypoints list of waypoints\endlink void add_waypoint(const Waypoint *wp) ; //@} /** @name Operators */ //@{ const Building& operator=(const Building &source) ; bool operator==(const Building &source) const ; bool operator!=(const Building &source) const ; //@} /// Displays a Building friend std::ostream& operator<<(std::ostream &os, const Building &b) ; } ; /* *** Read accessors *** */ inline const std::string& Building::get_name() const { return name ; } inline const std::tr1::unordered_map& Building::get_areas() const { return areas ; } inline const std::tr1::unordered_set& Building::get_waypoints() const { return waypoints ; } /* *** Write accessors *** */ inline void Building::set_name(const std::string &_name) { name = _name ; } /** * @param wp A pointer to the Waypoint to add. If \em wp is NULL, * nothing will be added. */ inline void Building::add_waypoint(const Waypoint *wp) { if (wp != NULL) waypoints.insert(const_cast(wp)) ; } /* *** Operators *** */ inline bool Building::operator!=(const Building &b) const { return !(*this == b) ; } #endif // _OWLPS_POSITIONING_BUILDING_HH_