51 #ifdef CHECK_MEMORY_LEAKS
53 #endif // CHECK_MEMORY_LEAKS
74 if (name ==
"stdout") {
76 }
else if (name ==
"stderr") {
83 throw IOError(
"Given port number '" + name.substr(name.find(
":") + 1) +
"' is not numeric.");
85 throw IOError(
"No port number given.");
88 const size_t len = name.length();
92 dev->
getOStream() << std::setiosflags(std::ios::fixed);
100 const std::string& rootElement,
101 const std::string& schemaFile) {
106 if (rootElement !=
"") {
107 if (schemaFile !=
"") {
108 dev.
writeXMLHeader(rootElement,
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/" + schemaFile +
"\"");
121 throw InvalidArgument(
"Device '" + devName +
"' has not been created.");
129 std::vector<OutputDevice*> errorDevices;
130 std::vector<OutputDevice*> nonErrorDevices;
133 errorDevices.push_back(i->second);
135 nonErrorDevices.push_back(i->second);
138 for (std::vector<OutputDevice*>::iterator i = nonErrorDevices.begin(); i != nonErrorDevices.end(); ++i) {
146 for (std::vector<OutputDevice*>::iterator i = errorDevices.begin(); i != errorDevices.end(); ++i) {
150 std::cerr <<
"Error on closing error output devices." << std::endl;
151 std::cerr << e.what() << std::endl;
159 std::ostringstream oss;
163 if (v < pow(10., -precision)) {
164 oss.setf(std::ios::scientific, std::ios::floatfield);
166 oss.setf(std::ios::fixed , std::ios::floatfield);
167 oss.setf(std::ios::showpoint);
168 oss << std::setprecision(precision);
179 : myAmBinary(binary) {
203 if (i->second ==
this) {
220 const std::string& attrs,
const std::string& comment) {