43 #ifdef CHECK_MEMORY_LEAKS
45 #endif // CHECK_MEMORY_LEAKS
52 const std::map<int, std::string>& predefinedTagsMML,
53 const std::string& objectType,
58 int type = in->
peek();
77 const int type = in->
peek();
81 throw ProcessError(
"Invalid binary file, only supporting position vectors.");
91 *in >> myIntValues[attr];
94 *in >> myIntValues[attr];
96 *in >> myCharValues[attr];
117 *in >> myIntValues[attr];
120 *in >> myCharValues[attr];
123 *in >> myCharValues[attr];
126 std::ostringstream into(std::ios::binary);
132 int intsToRead = size - 1;
137 if (bitsOrEntry < 0) {
138 intsToRead = (-bitsOrEntry * (size - 1) - 1) /
sizeof(
int) / 8 + 2;
140 while (intsToRead > 0) {
147 myStringValues[attr] = into.str();
170 const std::map<int, char>::const_iterator i = myCharValues.find(
id);
171 if (i == myCharValues.end()) {
174 return i->second != 0;
180 const std::map<int, char>::const_iterator i = myCharValues.find(
id);
181 if (i == myCharValues.end()) {
184 return i->second != 0;
190 const std::map<int, int>::const_iterator i =
myIntValues.find(
id);
201 const std::map<int, int>::const_iterator i =
myIntValues.find(
id);
217 const std::map<int, std::string>::const_iterator i = myStringValues.find(
id);
218 if (i == myStringValues.end()) {
227 const std::string& str)
const throw(
EmptyData) {
228 const std::map<int, std::string>::const_iterator i = myStringValues.find(
id);
229 if (i == myStringValues.end()) {
238 const std::map<int, SUMOReal>::const_iterator i =
myFloatValues.find(
id);
248 const std::map<int, SUMOReal>::const_iterator i =
myFloatValues.find(
id);
270 const std::string& )
const {
279 const char func = i->second;
293 const char type = i->second;
307 const int val = i->second;
308 return RGBColor((val & 0xff) / 255., ((val >> 8) & 0xff) / 255., ((val >> 16) & 0xff) / 255.);
316 bool allowEmpty)
const {
317 const std::map<int, PositionVector>::const_iterator i =
myPositionVectors.find(attr);
331 const std::map<int, PositionVector>::const_iterator i =
myPositionVectors.find(attr);
337 if (i->second.size() != 2) {
342 return Boundary(i->second[0].x(), i->second[0].y(), i->second[1].x(), i->second[1].y());
357 for (std::set<int>::const_iterator i =
myAttrs.begin(); i !=
myAttrs.end(); ++i) {