NBJunctionLogicCont Class Reference

#include <NBJunctionLogicCont.h>


Detailed Description

This class tries to load the logic for a given logickey even when key rotation must have been done If this is not possible (no permutation of the logic has been build), The class may be used for saving the logic build by NBRequest under the given key

Definition at line 53 of file NBJunctionLogicCont.h.


Public Member Functions

void add (const std::string &key, const std::string &xmlDescription)
 saves the given junction logic bitfield
void clear ()
 destroys all stored logics
 NBJunctionLogicCont ()
void writeXML (OutputDevice &into)
 saves all known logics
 ~NBJunctionLogicCont ()

Private Types

typedef std::map< std::string,
std::string > 
LogicMap
 definition o the logic-storage: a map from request to respond

Private Member Functions

bool exists (const std::string &key)
 tries to load a logic with the given key (and all of his permutations)
 NBJunctionLogicCont (const NBJunctionLogicCont &s)
NBJunctionLogicContoperator= (const NBJunctionLogicCont &s)

Private Attributes

LogicMap myMap
 the storage for the computed logic

Member Typedef Documentation

typedef std::map<std::string, std::string> NBJunctionLogicCont::LogicMap [private]

definition o the logic-storage: a map from request to respond

Definition at line 73 of file NBJunctionLogicCont.h.


Constructor & Destructor Documentation

NBJunctionLogicCont::NBJunctionLogicCont (  ) 

Definition at line 49 of file NBJunctionLogicCont.cpp.

00049 {}

NBJunctionLogicCont::~NBJunctionLogicCont (  ) 

Definition at line 52 of file NBJunctionLogicCont.cpp.

References clear().

00052                                           {
00053     clear();
00054 }

NBJunctionLogicCont::NBJunctionLogicCont ( const NBJunctionLogicCont s  )  [private]

invalid copy constructor


Member Function Documentation

void NBJunctionLogicCont::add ( const std::string &  key,
const std::string &  xmlDescription 
)

saves the given junction logic bitfield

Definition at line 64 of file NBJunctionLogicCont.cpp.

References myMap.

Referenced by NBRequest::buildBitfieldLogic().

00065                                                           {
00066     LogicMap::iterator i=myMap.find(key);
00067     if (i!=myMap.end()) {
00068         std::string tmp = (*i).second;
00069     }
00070     myMap.insert(LogicMap::value_type(key, xmlDescription));
00071 }

void NBJunctionLogicCont::clear (  ) 

destroys all stored logics

Definition at line 84 of file NBJunctionLogicCont.cpp.

References myMap.

Referenced by ~NBJunctionLogicCont().

00084                            {
00085     myMap.clear();
00086 }

bool NBJunctionLogicCont::exists ( const std::string &  key  )  [private]

tries to load a logic with the given key (and all of his permutations)

Definition at line 58 of file NBJunctionLogicCont.cpp.

References myMap.

00058                                                 {
00059     return myMap.find(key)!=myMap.end();
00060 }

NBJunctionLogicCont& NBJunctionLogicCont::operator= ( const NBJunctionLogicCont s  )  [private]

invalid assignment operator

void NBJunctionLogicCont::writeXML ( OutputDevice into  ) 

saves all known logics

Definition at line 75 of file NBJunctionLogicCont.cpp.

References myMap.

Referenced by NBNetBuilder::save().

00075                                                 {
00076     for (LogicMap::iterator i=myMap.begin(); i!=myMap.end(); i++) {
00077         into << (*i).second << "\n";
00078     }
00079     into << "\n";
00080 }


Field Documentation

the storage for the computed logic

Definition at line 76 of file NBJunctionLogicCont.h.

Referenced by add(), clear(), exists(), and writeXML().


The documentation for this class was generated from the following files:

Generated on Wed May 5 00:06:51 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6