| 499 | } |
| 500 | |
| 501 | void DimBuilder::writeTypes(std::ostream& out) |
| 502 | { |
| 503 | out << "/// Get the default storage type of a predefined dimension.\n"; |
| 504 | out << "/// \\param id ID of the predefined dimension.\n"; |
| 505 | out << "/// \\return The dimension's default storage type. An " |
| 506 | "exception is thrown if\n"; |
| 507 | out << "/// the id doesn't represent a predefined dimension.\n"; |
| 508 | out << "inline Type defaultType(Id id)\n"; |
| 509 | out << "{\n"; |
| 510 | out << " switch (id)\n"; |
| 511 | out << " {\n"; |
| 512 | for (auto& d : m_dims) |
| 513 | { |
| 514 | out << " case Id::" << d.m_name << ":\n"; |
| 515 | out << " return Type::" << getTypename(d.m_type) << ";\n"; |
| 516 | } |
| 517 | out << " case Id::Unknown:\n"; |
| 518 | out << " throw pdal_error(\"No type found for undefined " |
| 519 | "dimension.\");\n"; |
| 520 | out << " }\n"; |
| 521 | out << " throw pdal_error(\"No type found for undefined " |
| 522 | "dimension.\");\n"; |
| 523 | out << "}\n"; |
| 524 | } |
| 525 | |
| 526 | void DimBuilder::writeIsDeprecated(std::ostream& out) |
| 527 | { |
nothing calls this directly
no test coverage detected