55 std::ostringstream oss;
56 oss.setf(std::ios::fixed , std::ios::floatfield);
57 oss << std::setprecision(accuracy);
64 inline std::string
toHex(
const T i, std::streamsize numDigits = 0) {
66 std::stringstream stream;
67 stream <<
"0x" << std::setfill(
'0') << std::setw(numDigits == 0 ?
sizeof(T) * 2 : numDigits) << std::hex << i;
139 template <
typename V>
141 return toString<V>(v.begin(), v.end(), accuracy);
145 template <
typename V>
146 inline std::string
toString(
const typename std::vector<V*>::const_iterator& b,
const typename std::vector<V*>::const_iterator& e, std::streamsize accuracy =
OUTPUT_ACCURACY) {
148 std::ostringstream oss;
149 for (
typename std::vector<V*>::const_iterator it = b; it != e; ++it) {
159 template <
typename T,
typename T_BETWEEN>
161 std::ostringstream oss;
162 bool connect =
false;
163 for (
typename std::vector<T>::const_iterator it = v.begin(); it != v.end(); ++it) {
175 template <
typename T,
typename T_BETWEEN>
177 std::vector<T> sorted(v);
178 std::sort(sorted.begin(), sorted.end());
183 template <
typename V>
186 std::vector<std::string> ids;
187 for (
typename std::set<V*>::const_iterator it = v.begin(); it != v.end(); ++it) {
188 ids.push_back((*it)->getID());
195 inline std::string
toString(
const std::vector<int>& v, std::streamsize accuracy) {
201 inline std::string
toString(
const std::vector<long long int>& v, std::streamsize accuracy) {
207 inline std::string
toString(
const std::vector<SUMOReal>& v, std::streamsize accuracy) {
212 template <
typename T,
typename T_BETWEEN>
214 std::ostringstream oss;
215 bool connect =
false;
216 for (
typename std::set<T>::const_iterator it = s.begin(); it != s.end(); ++it) {
228 inline std::string
toString(
const std::set<std::string>& v, std::streamsize) {
232 template <
typename KEY,
typename VAL,
typename T_BETWEEN,
typename T_BETWEEN_KEYVAL>
233 inline std::string
joinToString(
const std::map<KEY, VAL>& s,
const T_BETWEEN& between,
const T_BETWEEN_KEYVAL& between_keyval, std::streamsize accuracy =
OUTPUT_ACCURACY) {
234 std::ostringstream oss;
235 bool connect =
false;
236 for (
typename std::map<KEY, VAL>::const_iterator it = s.begin(); it != s.end(); ++it) {
242 oss <<
toString(it->first, accuracy) << between_keyval <<
toString(it->second, accuracy);
248 inline std::string
toString(
const std::map<std::string, std::string>& v, std::streamsize) {
SumoXMLTag
Numbers representing SUMO-XML - element names.
std::string toString< LinkDirection >(const LinkDirection &linkDir, std::streamsize accuracy)
static StringBijection< SumoXMLNodeType > NodeTypes
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
static StringBijection< LinkState > LinkStates
#define UNUSED_PARAMETER(x)
std::string joinToStringSorting(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
static StringBijection< LinkDirection > LinkDirections
std::string toString< TrafficLightType >(const TrafficLightType &type, std::streamsize accuracy)
static StringBijection< TrafficLightType > TrafficLightTypes
const std::string & getString(const T key) const
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
std::string toString< SumoXMLTag >(const SumoXMLTag &tag, std::streamsize accuracy)
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
std::string toString< LaneChangeModel >(const LaneChangeModel &model, std::streamsize accuracy)
std::string toString< SumoXMLEdgeFunc >(const SumoXMLEdgeFunc &edgeFunc, std::streamsize accuracy)
std::string toHex(const T i, std::streamsize numDigits=0)
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
static StringBijection< int > Attrs
The names of SUMO-XML attributes for use in netbuild.
std::string toString< LinkState >(const LinkState &linkState, std::streamsize accuracy)
std::string toString< SUMOVehicleClass >(const SUMOVehicleClass &vClass, std::streamsize accuracy)
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
std::string toString< SumoXMLAttr >(const SumoXMLAttr &attr, std::streamsize accuracy)
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
static StringBijection< int > Tags
The names of SUMO-XML elements for use in netbuild.
static StringBijection< SumoXMLEdgeFunc > EdgeFunctions
static StringBijection< LaneChangeModel > LaneChangeModels
std::string toString< LaneSpreadFunction >(const LaneSpreadFunction &lsf, std::streamsize accuracy)
std::string toString< SumoXMLNodeType >(const SumoXMLNodeType &nodeType, std::streamsize accuracy)