Horizon
Loading...
Searching...
No Matches
tool_backannotate_connection_lines.hpp
1#pragma once
2#include "core/tool.hpp"
3#include "util/uuid_path.hpp"
4#include "nlohmann/json_fwd.hpp"
5
6namespace horizon {
7using json = nlohmann::json;
9public:
10 using ToolBase::ToolBase;
11 ToolResponse begin(const ToolArgs &args) override;
12 ToolResponse update(const ToolArgs &args) override;
13 bool can_begin() override;
14
16 public:
17 class Item {
18 public:
19 void from_json(class Block &block, const json &j);
20 bool is_valid() const;
21 class Net *net = nullptr;
22 class Component *component = nullptr;
23 UUIDPath<2> connpath;
24 };
25 std::vector<std::pair<Item, Item>> connections;
26 };
27
28private:
29 Net *create_net_stub(class Component *comp, const UUIDPath<2> &connpath, Net *net = nullptr);
30 int net_n = 0;
31};
32} // namespace horizon
A block is one level of hierarchy in the netlist.
Definition block.hpp:29
A Component is an instanced Entity in a Block.
Definition component.hpp:40
Definition net.hpp:11
This is what a Tool receives when the user did something.
Definition tool_pub.hpp:23
Definition tool_backannotate_connection_lines.hpp:17
Definition tool_backannotate_connection_lines.hpp:15
Definition tool_backannotate_connection_lines.hpp:8
bool can_begin() override
Definition tool_backannotate_connection_lines.cpp:29
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition tool_backannotate_connection_lines.cpp:116
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition tool_backannotate_connection_lines.cpp:94
Common interface for all Tools.
Definition tool_pub.hpp:94
Definition tool_data.hpp:4
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition tool_pub.hpp:40
Stores a sequence of up to 3 UUIDs.
Definition uuid_path.hpp:12
a class to store JSON values
Definition json.hpp:177
basic_json<> json
default JSON class
Definition json_fwd.hpp:62