#include <GUIShapeContainer.h>

Definition at line 44 of file GUIShapeContainer.h.
Public Member Functions | |
| bool | add (int layer, PointOfInterest *p) throw () |
| Adds a POI to the container. | |
| bool | add (int layer, Polygon2D *p) throw () |
| Adds a polygon to the container. | |
| int | getMaxLayer () const throw () |
| Returns the highest layer. | |
| int | getMinLayer () const throw () |
| Returns the lowest layer. | |
| const NamedObjectCont < PointOfInterest * > & | getPOICont (int layer) const throw () |
| Returns the polygons located at the given layer. | |
| const NamedObjectCont < Polygon2D * > & | getPolygonCont (int layer) const throw () |
| Returns the polygons located at the given layer. | |
| GUIShapeContainer () throw () | |
| Constructor. | |
| bool | removePOI (int layer, const std::string &id) throw () |
| Removes a PoI from the container. | |
| bool | removePolygon (int layer, const std::string &id) throw () |
| Removes a polygon from the container. | |
| virtual | ~GUIShapeContainer () throw () |
| Destructor. | |
Private Attributes | |
| MFXMutex | myLock |
| The mutex for adding/removing operations. | |
| GUIShapeContainer::GUIShapeContainer | ( | ) | throw () |
| GUIShapeContainer::~GUIShapeContainer | ( | ) | throw () [virtual] |
| bool GUIShapeContainer::add | ( | int | layer, | |
| PointOfInterest * | p | |||
| ) | throw () [virtual] |
Adds a POI to the container.
| [in] | layer | The layer the poi is located in |
| [in] | p | The poi to add |
Reimplemented from ShapeContainer.
Definition at line 60 of file GUIShapeContainer.cpp.
References ShapeContainer::add(), MFXMutex::lock(), myLock, and MFXMutex::unlock().
00060 { 00061 myLock.lock(); 00062 bool ret = ShapeContainer::add(layer, p); 00063 myLock.unlock(); 00064 return ret; 00065 }
Adds a polygon to the container.
| [in] | layer | The layer the polygon is located in |
| [in] | p | The polygon to add |
Reimplemented from ShapeContainer.
Definition at line 51 of file GUIShapeContainer.cpp.
References ShapeContainer::add(), MFXMutex::lock(), myLock, and MFXMutex::unlock().
00051 { 00052 myLock.lock(); 00053 bool ret = ShapeContainer::add(layer, p); 00054 myLock.unlock(); 00055 return ret; 00056 }
| int ShapeContainer::getMaxLayer | ( | ) | const throw () [inline, inherited] |
Returns the highest layer.
Definition at line 114 of file ShapeContainer.h.
References ShapeContainer::myMaxLayer.
Referenced by traci::TraCIServer::getPoiByExtId(), traci::TraCIServer::getPolygonByExtId(), GUINet::getShapeIDs(), traci::TraCIServer::handlePoiDomain(), traci::TraCIServer::handlePolygonDomain(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_POI::processSet(), and traci::TraCIServer::TraCIServer().
00114 { 00115 return myMaxLayer; 00116 }
| int ShapeContainer::getMinLayer | ( | ) | const throw () [inline, inherited] |
Returns the lowest layer.
Definition at line 106 of file ShapeContainer.h.
References ShapeContainer::myMinLayer.
Referenced by traci::TraCIServer::getPoiByExtId(), traci::TraCIServer::getPolygonByExtId(), GUINet::getShapeIDs(), traci::TraCIServer::handlePoiDomain(), traci::TraCIServer::handlePolygonDomain(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_POI::processSet(), and traci::TraCIServer::TraCIServer().
00106 { 00107 return myMinLayer; 00108 }
| const NamedObjectCont< PointOfInterest * > & ShapeContainer::getPOICont | ( | int | layer | ) | const throw () [inherited] |
Returns the polygons located at the given layer.
| [in] | layer | The layer of polygons to return |
Definition at line 115 of file ShapeContainer.cpp.
References MAX2(), MIN2(), ShapeContainer::myMaxLayer, ShapeContainer::myMinLayer, and ShapeContainer::myPOILayers.
Referenced by traci::TraCIServer::getPoiByExtId(), GUINet::getShapeIDs(), traci::TraCIServer::handlePoiDomain(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_POI::processSet(), and traci::TraCIServer::TraCIServer().
00115 { 00116 if (myPOILayers.find(layer)==myPOILayers.end()) { 00117 myPOILayers[layer] = NamedObjectCont<PointOfInterest*>(); 00118 myMinLayer = MIN2(layer, myMinLayer); 00119 myMaxLayer = MAX2(layer, myMaxLayer); 00120 } 00121 return myPOILayers[layer]; 00122 }
| const NamedObjectCont< Polygon2D * > & ShapeContainer::getPolygonCont | ( | int | layer | ) | const throw () [inherited] |
Returns the polygons located at the given layer.
| [in] | layer | The layer of polygons to return |
Definition at line 104 of file ShapeContainer.cpp.
References MAX2(), MIN2(), ShapeContainer::myMaxLayer, ShapeContainer::myMinLayer, and ShapeContainer::myPolygonLayers.
Referenced by traci::TraCIServer::getPolygonByExtId(), GUINet::getShapeIDs(), traci::TraCIServer::handlePolygonDomain(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Polygon::processSet(), and traci::TraCIServer::TraCIServer().
00104 { 00105 if (myPolygonLayers.find(layer)==myPolygonLayers.end()) { 00106 myPolygonLayers[layer] = NamedObjectCont<Polygon2D*>(); 00107 myMinLayer = MIN2(layer, myMinLayer); 00108 myMaxLayer = MAX2(layer, myMaxLayer); 00109 } 00110 return myPolygonLayers[layer]; 00111 }
| bool GUIShapeContainer::removePOI | ( | int | layer, | |
| const std::string & | id | |||
| ) | throw () [virtual] |
Removes a PoI from the container.
| [in] | layer | The layer the PoI is located in |
| [in] | id | The id of the PoI |
Reimplemented from ShapeContainer.
Definition at line 78 of file GUIShapeContainer.cpp.
References MFXMutex::lock(), myLock, ShapeContainer::removePOI(), and MFXMutex::unlock().
00078 { 00079 myLock.lock(); 00080 bool ret = ShapeContainer::removePOI(layer, id); 00081 myLock.unlock(); 00082 return ret; 00083 }
| bool GUIShapeContainer::removePolygon | ( | int | layer, | |
| const std::string & | id | |||
| ) | throw () [virtual] |
Removes a polygon from the container.
| [in] | layer | The layer the polygon is located in |
| [in] | id | The id of the polygon |
Reimplemented from ShapeContainer.
Definition at line 69 of file GUIShapeContainer.cpp.
References MFXMutex::lock(), myLock, ShapeContainer::removePolygon(), and MFXMutex::unlock().
00069 { 00070 myLock.lock(); 00071 bool ret = ShapeContainer::removePolygon(layer, id); 00072 myLock.unlock(); 00073 return ret; 00074 }
MFXMutex GUIShapeContainer::myLock [private] |
The mutex for adding/removing operations.
Definition at line 92 of file GUIShapeContainer.h.
Referenced by add(), removePOI(), and removePolygon().
1.5.6