Skip to content

Commit

Permalink
removed unused and outdated stream operators from gate & net, closes e…
Browse files Browse the repository at this point in the history
  • Loading branch information
not-a-trojan committed Dec 10, 2019
1 parent 94a6af4 commit c329a88
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 61 deletions.
11 changes: 1 addition & 10 deletions include/netlist/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,14 @@ class netlist_internal_manager;

/**
* Net class containing information about a net including its source and destination.
*
*
* @ingroup netlist
*/
class NETLIST_API net : public data_container, public std::enable_shared_from_this<net>
{
friend class netlist_internal_manager;

public:
/**
* Overloaded operator
*
* @param[in] os - Output stream
* @param[in] n - Graph net reference
* @returns A standard output stream.
*/
friend std::ostream& operator<<(std::ostream& os, const net& n);

/**
* Gets the unique id of the net.
*
Expand Down
28 changes: 0 additions & 28 deletions src/netlist/gate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,6 @@ gate::gate(std::shared_ptr<netlist> const g, const u32 id, std::shared_ptr<const
m_y = y;
}

std::ostream& operator<<(std::ostream& os, const gate& gate)
{
os << "\t\'" << gate.get_name() << "\'"
<< " (type = '" << gate.get_type()->get_name() << "', id = " << gate.get_id() << ")" << std::endl;
for (const auto& input_pin_type : gate.get_input_pins())
{
os << "\t\t" << input_pin_type << " => ";
auto net = gate.get_fan_in_net(input_pin_type);
if (net == nullptr)
os << "nullptr";
else
os << net->get_name();
os << std::endl;
}
for (const auto& output_pin_type : gate.get_output_pins())
{
os << "\t\t" << output_pin_type << " => ";
auto net = gate.get_fan_out_net(output_pin_type);
if (net == nullptr)
os << "nullptr";
else
os << net->get_name();
os << std::endl;
}

return os;
}

u32 gate::get_id() const
{
return m_id;
Expand Down
23 changes: 0 additions & 23 deletions src/netlist/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,6 @@ net::net(netlist_internal_manager* internal_manager, const u32 id, const std::st
m_src = {nullptr, ""};
}

std::ostream& operator<<(std::ostream& os, const net& net)
{
os << "\t\'" << net.m_name << "\'"
<< " (id = " << net.m_id << ")" << std::endl;

os << "\t\t src : ";
if (net.m_src.gate == nullptr)
{
os << "nullptr" << std::endl;
}
else
{
os << "'" << net.m_src.gate->get_name() << "' : " << net.m_src.pin_type << std::endl;
}

for (const auto& dst : net.m_dsts)
{
os << "\t\t dst : '" << dst.gate->get_name() << "' : " << dst.pin_type << std::endl;
}

return os;
}

u32 net::get_id() const
{
return m_id;
Expand Down

0 comments on commit c329a88

Please sign in to comment.