#ifndef _OWLPS_POSITIONING_BUILDING_HH_ #define _OWLPS_POSITIONING_BUILDING_HH_ class Area ; class Waypoint ; #include #include #include /// Represents a building, containing one or more Area class Building { protected: std::string name ; ///< Name of the Building std::vector areas ; ///< List of Area contained in the Building std::vector waypoints ; ///< List of Waypoint in the Building public : /// Constructs a Building from its name (or default constructor) Building(const std::string &_name = "Unnamed building") ; /// Copy constructor Building(const Building &b) ; ~Building(void) ; ///< Destructor /** @name Read accessors */ //@{ /// #name read accessor const std::string& get_name(void) const ; /// #areas read accessor const std::vector& get_areas(void) const ; /// #waypoints read accessor const std::vector& get_waypoints(void) const ; //@} /** @name Write accessors */ //@{ /// #name write accessor void set_name(const std::string &_name) ; /// Adds an Area to the \link #areas list of areas\endlink void add_area(const 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 &p) ; bool operator==(const Building &p) const ; bool operator!=(const Building &p) 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::vector& Building::get_areas() const { return areas ; } inline const std::vector& Building::get_waypoints() const { return waypoints ; } /* *** Write accessors *** */ inline void Building::set_name(const std::string &_name) { name = _name ; } /** * @param a A pointer to the Area to add. If \em a is NULL, nothing * will be added. */ inline void Building::add_area(const Area *a) { if (a != NULL) areas.push_back(const_cast(a)) ; } /** * @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.push_back(const_cast(wp)) ; } /* *** Operators *** */ inline bool Building::operator!=(const Building &b) const { return !(*this == b) ; } #endif // _OWLPS_POSITIONING_BUILDING_HH_