#include <NIImporter_DlrNavteq.h>

Being a LineHandler, this class retrieves each line from a LineReader and parses these information assuming they contain traffic light definitions in DLRNavteq's format.
Definition at line 198 of file NIImporter_DlrNavteq.h.
Public Member Functions | |
| bool | report (const std::string &result) throw (ProcessError) |
| Parsing method. | |
| TrafficlightsHandler (NBNodeCont &nc, NBTrafficLightLogicCont &tlc, const std::string &file) throw () | |
| Constructor. | |
| ~TrafficlightsHandler () throw () | |
| Destructor. | |
Protected Attributes | |
| NBNodeCont & | myNodeCont |
| The node container to get the referenced nodes from. | |
| NBTrafficLightLogicCont & | myTLLogicCont |
| The traffic lights container to add built tls to. | |
Private Member Functions | |
| TrafficlightsHandler & | operator= (const TrafficlightsHandler &) |
| Invalidated assignment operator. | |
| TrafficlightsHandler (const TrafficlightsHandler &) | |
| Invalidated copy constructor. | |
| NIImporter_DlrNavteq::TrafficlightsHandler::TrafficlightsHandler | ( | NBNodeCont & | nc, | |
| NBTrafficLightLogicCont & | tlc, | |||
| const std::string & | file | |||
| ) | throw () |
Constructor.
| [in] | nc | The node control to retrieve nodes from |
| in,filled] | tlc The traffic lights container to fill | |
| [in] | file | The name of the parsed file |
Definition at line 283 of file NIImporter_DlrNavteq.cpp.
00286 : myNodeCont(nc), myTLLogicCont(tlc) {}
| NIImporter_DlrNavteq::TrafficlightsHandler::~TrafficlightsHandler | ( | ) | throw () |
| NIImporter_DlrNavteq::TrafficlightsHandler::TrafficlightsHandler | ( | const TrafficlightsHandler & | ) | [private] |
Invalidated copy constructor.
| TrafficlightsHandler& NIImporter_DlrNavteq::TrafficlightsHandler::operator= | ( | const TrafficlightsHandler & | ) | [private] |
Invalidated assignment operator.
| bool NIImporter_DlrNavteq::TrafficlightsHandler::report | ( | const std::string & | result | ) | throw (ProcessError) [virtual] |
Parsing method.
Implementation of the LineHandler-interface called by a LineReader; interprets the retrieved information and alters the nodes.
| [in] | result | The read line |
| ProcessError | if something fails |
Implements LineHandler.
Definition at line 293 of file NIImporter_DlrNavteq.cpp.
References NBNode::getPosition(), NBNode::getType(), StringTokenizer::getVector(), NBTrafficLightLogicCont::insert(), myNodeCont, myTLLogicCont, NBNode::NODETYPE_TRAFFIC_LIGHT, NBNode::reinit(), NBNodeCont::retrieve(), StringTokenizer::WHITECHARS, and WRITE_WARNING.
00293 { 00294 // #ID POICOL-TYPE DESCRIPTION LONGITUDE LATITUDE NAVTEQ_LINK_ID NODEID 00295 00296 if (result[0]=='#') { 00297 return true; 00298 } 00299 StringTokenizer st(result, StringTokenizer::WHITECHARS); 00300 std::string nodeID = st.getVector().back(); 00301 NBNode *node = myNodeCont.retrieve(nodeID); 00302 if (node==0) { 00303 WRITE_WARNING("The traffic light node '" + nodeID + "' could not be found"); 00304 } else { 00305 if (node->getType() != NBNode::NODETYPE_TRAFFIC_LIGHT) { 00306 node->reinit(node->getPosition(), NBNode::NODETYPE_TRAFFIC_LIGHT); 00307 NBTrafficLightDefinition *tlDef = new NBOwnTLDef(nodeID, node); 00308 if (!myTLLogicCont.insert(tlDef)) { 00309 // actually, nothing should fail here 00310 delete tlDef; 00311 throw ProcessError("Could not allocate tls for '" + nodeID + "'."); 00312 } 00313 } 00314 } 00315 return true; 00316 }
The node container to get the referenced nodes from.
Definition at line 227 of file NIImporter_DlrNavteq.h.
Referenced by report().
The traffic lights container to add built tls to.
Definition at line 230 of file NIImporter_DlrNavteq.h.
Referenced by report().
1.5.6