Skip to content

Commit

Permalink
🎨 use switch.
Browse files Browse the repository at this point in the history
  • Loading branch information
Drewniok committed Oct 31, 2024
1 parent 0c6c059 commit 712c94c
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions include/fiction/io/write_sqd_layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <fstream>
#include <ostream>
#include <sstream>
#include <string>
#include <string_view>
#include <unordered_map>
#include <vector>
Expand Down Expand Up @@ -254,12 +255,37 @@ class write_sqd_layout_impl
if constexpr (has_sidb_technology_v<Lyt>)
{
const auto type = this->lyt.get_cell_type(c);
const auto type_str =
type == sidb_technology::cell_type::NORMAL ? "" :
type == sidb_technology::cell_type::INPUT ? fmt::format(siqad::DOT_TYPE, "input") :
type == sidb_technology::cell_type::OUTPUT ? fmt::format(siqad::DOT_TYPE, "output") :
type == sidb_technology::cell_type::LOGIC ? fmt::format(siqad::DOT_TYPE, "logic") :
"";

std::string type_str;

switch (type)
{
case sidb_technology::cell_type::NORMAL:
{
type_str = "";
break;
}
case sidb_technology::cell_type::INPUT:
{
type_str = fmt::format(siqad::DOT_TYPE, "input");
break;
}
case sidb_technology::cell_type::OUTPUT:
{
type_str = fmt::format(siqad::DOT_TYPE, "output");
break;
}
case sidb_technology::cell_type::LOGIC:
{
type_str = fmt::format(siqad::DOT_TYPE, "logic");
break;
}
default:
{
type_str = "";
break;
}
}

if constexpr (has_siqad_coord_v<Lyt>)
{
Expand Down

0 comments on commit 712c94c

Please sign in to comment.